diff options
author | Mathieu Chartier <mathieuc@google.com> | 2016-09-27 18:43:30 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2016-09-29 17:31:09 -0700 |
commit | 0795f23920ee9aabf28e45c63cd592dcccf00216 (patch) | |
tree | ff3f880c5e84f3316532b47d0e9a7729ade848ac /runtime/native/java_lang_VMClassLoader.cc | |
parent | d1224dce59eb0019507e41da5e10f12dda66bee4 (diff) |
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
Diffstat (limited to 'runtime/native/java_lang_VMClassLoader.cc')
-rw-r--r-- | runtime/native/java_lang_VMClassLoader.cc | 9 |
1 files changed, 6 insertions, 3 deletions
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<mirror::ClassLoader*>(javaLoader); + ObjPtr<mirror::ClassLoader> loader = soa.Decode<mirror::ClassLoader>(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<jclass>(c); } |