summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/entrypoints/quick/quick_trampoline_entrypoints.cc')
-rw-r--r--runtime/entrypoints/quick/quick_trampoline_entrypoints.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 66cec7113e7..39429c5b414 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -1170,7 +1170,7 @@ extern "C" TwoWordReturn artInstrumentationMethodExitFromCode(Thread* self,
instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
TwoWordReturn return_or_deoptimize_pc = instrumentation->PopInstrumentationStackFrame(
self, return_pc, gpr_result, fpr_result);
- if (self->IsExceptionPending()) {
+ if (self->IsExceptionPending() || self->ObserveAsyncException()) {
return GetTwoWordFailureValue();
}
return return_or_deoptimize_pc;
@@ -2356,10 +2356,6 @@ extern "C" TwoWordReturn artQuickGenericJniTrampoline(Thread* self, ArtMethod**
ArtMethod* called = *sp;
DCHECK(called->IsNative()) << called->PrettyMethod(true);
Runtime* runtime = Runtime::Current();
- jit::Jit* jit = runtime->GetJit();
- if (jit != nullptr) {
- jit->AddSamples(self, called, 1u, /*with_backedges*/ false);
- }
uint32_t shorty_len = 0;
const char* shorty = called->GetShorty(&shorty_len);
bool critical_native = called->IsCriticalNative();
@@ -2385,6 +2381,12 @@ extern "C" TwoWordReturn artQuickGenericJniTrampoline(Thread* self, ArtMethod**
self->VerifyStack();
+ // We can now walk the stack if needed by JIT GC from MethodEntered() for JIT-on-first-use.
+ jit::Jit* jit = runtime->GetJit();
+ if (jit != nullptr) {
+ jit->MethodEntered(self, called);
+ }
+
uint32_t cookie;
uint32_t* sp32;
// Skip calling JniMethodStart for @CriticalNative.