summaryrefslogtreecommitdiff
path: root/runtime/art_method-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/art_method-inl.h')
-rw-r--r--runtime/art_method-inl.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index 03b4ce9078..01fa33fc65 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -223,7 +223,14 @@ inline ObjPtr<mirror::String> ArtMethod::ResolveNameString() {
}
inline const dex::CodeItem* ArtMethod::GetCodeItem() {
- return GetDexFile()->GetCodeItem(GetCodeItemOffset());
+ if (!HasCodeItem()) {
+ return nullptr;
+ }
+ Runtime* runtime = Runtime::Current();
+ PointerSize pointer_size = runtime->GetClassLinker()->GetImagePointerSize();
+ return runtime->IsAotCompiler()
+ ? GetDexFile()->GetCodeItem(reinterpret_cast32<uint32_t>(GetDataPtrSize(pointer_size)))
+ : reinterpret_cast<const dex::CodeItem*>(GetDataPtrSize(pointer_size));
}
inline bool ArtMethod::IsResolvedTypeIdx(dex::TypeIndex type_idx) {
@@ -384,8 +391,6 @@ inline void ArtMethod::UpdateEntrypoints(const Visitor& visitor, PointerSize poi
if (old_native_code != new_native_code) {
SetEntryPointFromJniPtrSize(new_native_code, pointer_size);
}
- } else {
- DCHECK(GetDataPtrSize(pointer_size) == nullptr);
}
const void* old_code = GetEntryPointFromQuickCompiledCodePtrSize(pointer_size);
const void* new_code = visitor(old_code);