From 28bd2e4f151267b34b8e1eb19c489d8d547bbf5c Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 4 Oct 2016 13:54:57 -0700 Subject: Move mirror::Class to use ObjPtr Leave the return types as non ObjPtr for now. Fixed moving GC bugs in tests. Test: test-art-host Bug: 31113334 Change-Id: I5da1b5ac55dfbc5cc97a64be2c870ba9f512d9b0 --- runtime/native/java_lang_Class.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'runtime/native/java_lang_Class.cc') diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc index 2a5c04d54b..75631616e7 100644 --- a/runtime/native/java_lang_Class.cc +++ b/runtime/native/java_lang_Class.cc @@ -278,7 +278,7 @@ static mirror::Field* GetPublicFieldRecursive( uint32_t num_direct_interfaces = h_clazz->NumDirectInterfaces(); for (uint32_t i = 0; i < num_direct_interfaces; i++) { - mirror::Class *iface = mirror::Class::GetDirectInterface(self, h_clazz, i); + ObjPtr iface = mirror::Class::GetDirectInterface(self, h_clazz, i); if (UNLIKELY(iface == nullptr)) { self->AssertPendingException(); return nullptr; @@ -403,11 +403,12 @@ static jobject Class_getDeclaredMethodInternal(JNIEnv* env, jobject javaThis, ScopedFastNativeObjectAccess soa(env); DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), kRuntimePointerSize); DCHECK(!Runtime::Current()->IsActiveTransaction()); - mirror::Method* result = mirror::Class::GetDeclaredMethodInternal( - soa.Self(), - DecodeClass(soa, javaThis).Ptr(), - soa.Decode(name).Ptr(), - soa.Decode>(args).Ptr()); + ObjPtr result = + mirror::Class::GetDeclaredMethodInternal( + soa.Self(), + DecodeClass(soa, javaThis), + soa.Decode(name), + soa.Decode>(args)); return soa.AddLocalReference(result); } -- cgit v1.2.3-59-g8ed1b