Refactor String resolution.
Use the same pattern as type resolution and avoid some
unnecessary read barriers in the fast path. Consolidate
naming between ArtField and ArtMethod.
Test: m test-art-host-gtest
Test: testrunner.py --host
Change-Id: Iea69129085f61f04a4add09edd0eadbb7ac9ecb2
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index ec66966..18595cf 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -245,6 +245,12 @@
}
}
+inline ObjPtr<mirror::String> ArtMethod::ResolveNameString() {
+ DCHECK(!IsProxyMethod());
+ const DexFile::MethodId& method_id = GetDexFile()->GetMethodId(GetDexMethodIndex());
+ return Runtime::Current()->GetClassLinker()->ResolveString(method_id.name_idx_, this);
+}
+
inline const DexFile::CodeItem* ArtMethod::GetCodeItem() {
return GetDexFile()->GetCodeItem(GetCodeItemOffset());
}