// The interpreter function takes considerable time to compile and link. // We compile the explicit definitions separately to speed up the build.
#include"interpreter_switch_impl-inl.h"
namespace art HIDDEN { namespace interpreter {
// Define the helper class that does not do any transaction checks. class InactiveTransactionChecker { public:
ALWAYS_INLINE staticbool WriteConstraint([[maybe_unused]] Thread* self,
[[maybe_unused]] ObjPtr<mirror::Object> obj)
REQUIRES_SHARED(Locks::mutator_lock_) { returnfalse;
}
staticbool ExceptionHandledEvent(Thread* self, bool is_move_exception, const instrumentation::Instrumentation* instrumentation)
REQUIRES_SHARED(Locks::mutator_lock_) {
StackHandleScope<1> hs(self);
Handle<mirror::Throwable> exception(hs.NewHandle(self->GetException())); // Clear any exception while reporting the ExceptionHandled event. We should not run the handler // with an exception set.
self->ClearException();
instrumentation->ExceptionHandledEvent(self, exception.Get()); // If there is an exception then that is the exception thrown by the exception handled event // and we should just handle the new exception. The earlier exception if any is ignored. if (self->IsExceptionPending()) { returnfalse; // Pending exception.
}
// Restore the original exception if the instruction we are going to execute is a move exception // instruction. if (is_move_exception) {
self->SetException(exception.Get());
} returntrue;
}
// Unlike most other events the DexPcMovedEvent can be sent when there is a pending exception (if // the next instruction is MOVE_EXCEPTION). This means it needs to be handled carefully to be able // to detect exceptions thrown by the DexPcMovedEvent itself. These exceptions could be thrown by // jvmti-agents while handling breakpoint or single step events. We had to move this into its own // function because it was making ExecuteSwitchImpl have too large a stack.
NO_INLINE staticbool DoDexPcMoveEvent(Thread* self, const CodeItemDataAccessor& accessor, const ShadowFrame& shadow_frame,
uint32_t dex_pc, const instrumentation::Instrumentation* instrumentation,
JValue* save_ref)
REQUIRES_SHARED(Locks::mutator_lock_) {
DCHECK(instrumentation->HasDexPcListeners());
StackHandleScope<2> hs(self);
Handle<mirror::Throwable> thr(hs.NewHandle(self->GetException()));
mirror::Object* null_obj = nullptr;
HandleWrapper<mirror::Object> h(
hs.NewHandleWrapper(LIKELY(save_ref == nullptr) ? &null_obj : save_ref->GetGCRoot()));
self->ClearException();
instrumentation->DexPcMovedEvent(self,
shadow_frame.GetThisObject(accessor.InsSize()),
shadow_frame.GetMethod(),
dex_pc); if (UNLIKELY(self->IsExceptionPending())) { // We got a new exception in the dex-pc-moved event. // We just let this exception replace the old one. // TODO It would be good to add the old exception to the // suppressed exceptions of the new one if possible. returnfalse; // Pending exception.
} if (UNLIKELY(!thr.IsNull())) {
self->SetException(thr.Get());
} returntrue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.