summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Class.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-10-04 13:54:57 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-10-13 10:59:28 -0700
commit28bd2e4f151267b34b8e1eb19c489d8d547bbf5c (patch)
treed99ae3fe74ea63b83091898d830d3efe68cd479d /runtime/native/java_lang_Class.cc
parent6e5fa09510c7280168e040382d27dd8b55760d9a (diff)
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
Diffstat (limited to 'runtime/native/java_lang_Class.cc')
-rw-r--r--runtime/native/java_lang_Class.cc13
1 files changed, 7 insertions, 6 deletions
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<mirror::Class> 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<kRuntimePointerSize, false>(
- soa.Self(),
- DecodeClass(soa, javaThis).Ptr(),
- soa.Decode<mirror::String>(name).Ptr(),
- soa.Decode<mirror::ObjectArray<mirror::Class>>(args).Ptr());
+ ObjPtr<mirror::Method> result =
+ mirror::Class::GetDeclaredMethodInternal<kRuntimePointerSize, false>(
+ soa.Self(),
+ DecodeClass(soa, javaThis),
+ soa.Decode<mirror::String>(name),
+ soa.Decode<mirror::ObjectArray<mirror::Class>>(args));
return soa.AddLocalReference<jobject>(result);
}