Simplify GetNterpMethodHeader().
Reuse the existing function EntryPointToCodePointer() instead of
reimplementing it here.
Change-Id: If8de17428f0ff72249653c9cfb15f754a6ecd37d
diff --git a/runtime/oat_quick_method_header.cc b/runtime/oat_quick_method_header.cc
index 639e9e8..8fbf02a 100644
--- a/runtime/oat_quick_method_header.cc
+++ b/runtime/oat_quick_method_header.cc
@@ -92,11 +92,9 @@
if (!interpreter::IsNterpSupported()) {
return nullptr;
}
- uintptr_t nterp_entrypoint = reinterpret_cast<uintptr_t>(interpreter::GetNterpEntryPoint());
- uintptr_t nterp_code_pointer = (kRuntimeISA == InstructionSet::kArm)
- // Remove the Thumb mode bit if present on ARM.
- ? nterp_entrypoint & ~static_cast<uintptr_t>(1)
- : nterp_entrypoint;
+ const void* nterp_entrypoint = interpreter::GetNterpEntryPoint();
+ uintptr_t nterp_code_pointer =
+ reinterpret_cast<uintptr_t>(EntryPointToCodePointer(nterp_entrypoint));
return reinterpret_cast<OatQuickMethodHeader*>(nterp_code_pointer - sizeof(OatQuickMethodHeader));
}