diff options
-rw-r--r-- | runtime/entrypoints/quick/quick_trampoline_entrypoints.cc | 7 | ||||
-rw-r--r-- | runtime/instrumentation.h | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index a1afce88c0..664cf622a8 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -2522,6 +2522,11 @@ extern "C" void artJniMethodEntryHook(Thread* self) extern "C" void artMethodEntryHook(ArtMethod* method, Thread* self, ArtMethod** sp) REQUIRES_SHARED(Locks::mutator_lock_) { instrumentation::Instrumentation* instr = Runtime::Current()->GetInstrumentation(); + if (instr->HasFastMethodEntryListenersOnly()) { + instr->MethodEnterEvent(self, method); + return; + } + if (instr->HasMethodEntryListeners()) { instr->MethodEnterEvent(self, method); // MethodEnter callback could have requested a deopt for ex: by setting a breakpoint, so @@ -2552,7 +2557,7 @@ extern "C" void artMethodExitHook(Thread* self, DCHECK(instr->RunExitHooks()); ArtMethod* method = *sp; - if (instr->HasFastMethodExitListeners()) { + if (instr->HasFastMethodExitListenersOnly()) { // Fast method listeners are only used for tracing which don't need any deoptimization checks // or a return value. JValue return_value; diff --git a/runtime/instrumentation.h b/runtime/instrumentation.h index 29107b149c..2e81eef04b 100644 --- a/runtime/instrumentation.h +++ b/runtime/instrumentation.h @@ -380,7 +380,11 @@ class Instrumentation { return have_method_exit_listeners_ != 0; } - bool HasFastMethodExitListeners() const REQUIRES_SHARED(Locks::mutator_lock_) { + bool HasFastMethodEntryListenersOnly() const REQUIRES_SHARED(Locks::mutator_lock_) { + return have_method_entry_listeners_ == kFastTraceListeners; + } + + bool HasFastMethodExitListenersOnly() const REQUIRES_SHARED(Locks::mutator_lock_) { return have_method_exit_listeners_ == kFastTraceListeners; } |