From 0795f23920ee9aabf28e45c63cd592dcccf00216 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 27 Sep 2016 18:43:30 -0700 Subject: Clean up ScopedThreadStateChange to use ObjPtr Also fixed inclusion of -inl.h files in .h files by adding scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h Changed AddLocalReference / Decode to use ObjPtr. Changed libartbenchmark to be debug to avoid linkage errors. Bug: 31113334 Test: test-art-host Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483 --- runtime/native/java_lang_VMClassLoader.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/native/java_lang_VMClassLoader.cc') diff --git a/runtime/native/java_lang_VMClassLoader.cc b/runtime/native/java_lang_VMClassLoader.cc index 6f735aa6df..0694c4dd72 100644 --- a/runtime/native/java_lang_VMClassLoader.cc +++ b/runtime/native/java_lang_VMClassLoader.cc @@ -20,7 +20,7 @@ #include "jni_internal.h" #include "mirror/class_loader.h" #include "mirror/object-inl.h" -#include "scoped_fast_native_object_access.h" +#include "scoped_fast_native_object_access-inl.h" #include "ScopedUtfChars.h" #include "zip_archive.h" @@ -29,7 +29,7 @@ namespace art { static jclass VMClassLoader_findLoadedClass(JNIEnv* env, jclass, jobject javaLoader, jstring javaName) { ScopedFastNativeObjectAccess soa(env); - mirror::ClassLoader* loader = soa.Decode(javaLoader); + ObjPtr loader = soa.Decode(javaLoader); ScopedUtfChars name(env, javaName); if (name.c_str() == nullptr) { return nullptr; @@ -37,7 +37,10 @@ static jclass VMClassLoader_findLoadedClass(JNIEnv* env, jclass, jobject javaLoa ClassLinker* cl = Runtime::Current()->GetClassLinker(); std::string descriptor(DotToDescriptor(name.c_str())); const size_t descriptor_hash = ComputeModifiedUtf8Hash(descriptor.c_str()); - mirror::Class* c = cl->LookupClass(soa.Self(), descriptor.c_str(), descriptor_hash, loader); + mirror::Class* c = cl->LookupClass(soa.Self(), + descriptor.c_str(), + descriptor_hash, + loader.Decode()); if (c != nullptr && c->IsResolved()) { return soa.AddLocalReference(c); } -- cgit v1.2.3-59-g8ed1b