Move ArtField to ObjPtr
Added EXPECT_OBJ_PTR_EQ and variants to gtests.
Fixed moving GC bugs in:
ClassLinker::CreatePathClassLoader
ClassLinkerTest: StaticFields
ObjPtr Decode call sites: 186 -> 181.
Some tests fail due to ResolvedFieldAccessTest, will fix in follow
up CL.
Bug: 31113334
Test: test-art-host CC baker
Change-Id: I8b266ad00f3c20c8cbe7cfdf280d175083df0b88
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index 39846da..eb8cdbc 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -786,9 +786,9 @@
kAndroidHardcodedSystemPropertiesFieldName);
return;
}
- Handle<mirror::ObjectArray<mirror::ObjectArray<mirror::String>>> h_2string_array(
- hs.NewHandle(reinterpret_cast<mirror::ObjectArray<mirror::ObjectArray<mirror::String>>*>(
- static_properties->GetObject(h_props_class.Get()))));
+ ObjPtr<mirror::Object> props = static_properties->GetObject(h_props_class.Get());
+ Handle<mirror::ObjectArray<mirror::ObjectArray<mirror::String>>> h_2string_array(hs.NewHandle(
+ props->AsObjectArray<mirror::ObjectArray<mirror::String>>()));
if (h_2string_array.Get() == nullptr) {
AbortTransactionOrFail(self, "Field %s is null", kAndroidHardcodedSystemPropertiesFieldName);
return;