diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2019-08-13 00:33:27 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-08-13 00:33:27 -0700 |
commit | cb79b51eb6c06250f196713de9190e7379a28cd5 (patch) | |
tree | 3bad998c59ce8c7f76edb157d8b2a1a3a3d36698 | |
parent | 0cf8878a482ee257699ab8f1bcb25994b8987207 (diff) | |
parent | 93028dcc1a20e59b341228a19e3c4de031eb46c0 (diff) |
Update the entrypoint with the code entrypoint, not the code pointer. am: d5a9587acd am: 099fe54576 am: 1a2e2d60af am: cc1ecca45d
am: 93028dcc1a
Change-Id: Id9cc80572968990270612f759ae50b0977c1ea3e
-rw-r--r-- | runtime/instrumentation.cc | 9 | ||||
-rw-r--r-- | runtime/jit/jit.cc | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc index fc2143f11e..76065a3bf7 100644 --- a/runtime/instrumentation.cc +++ b/runtime/instrumentation.cc @@ -195,6 +195,15 @@ void Instrumentation::InstallStubsForClass(ObjPtr<mirror::Class> klass) { static void UpdateEntrypoints(ArtMethod* method, const void* quick_code) REQUIRES_SHARED(Locks::mutator_lock_) { + if (kIsDebugBuild) { + jit::Jit* jit = Runtime::Current()->GetJit(); + if (jit != nullptr && jit->GetCodeCache()->ContainsPc(quick_code)) { + // Ensure we always have the thumb entrypoint for JIT on arm32. + if (kRuntimeISA == InstructionSet::kArm) { + CHECK_EQ(reinterpret_cast<uintptr_t>(quick_code) & 1, 1u); + } + } + } method->SetEntryPointFromQuickCompiledCode(quick_code); } diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc index 97565ad238..52c0e9da30 100644 --- a/runtime/jit/jit.cc +++ b/runtime/jit/jit.cc @@ -947,9 +947,9 @@ bool Jit::MaybeCompileMethod(Thread* self, return false; } if (UNLIKELY(method->IsPreCompiled()) && !with_backedges /* don't check for OSR */) { - const void* code_ptr = code_cache_->GetZygoteMap()->GetCodeFor(method); - if (code_ptr != nullptr) { - Runtime::Current()->GetInstrumentation()->UpdateMethodsCode(method, code_ptr); + const void* entry_point = code_cache_->GetSavedEntryPointOfPreCompiledMethod(method); + if (entry_point != nullptr) { + Runtime::Current()->GetInstrumentation()->UpdateMethodsCode(method, entry_point); return true; } } |