summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Class.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-12-11 18:37:36 +0000
committer Vladimir Marko <vmarko@google.com> 2017-12-12 13:48:02 +0000
commit666ee3d7c6039c80e75287e311895bd6a9b01e9f (patch)
tree5e65f39ff7cc83af4be3b691c247d7348052f854 /runtime/native/java_lang_Class.cc
parent890111968fbd3f5ae528d97e42984c12a3dd27bd (diff)
Do not pass DexFile to ClassLinker::Lookup/ResolveType().
The DexFile can be easily retrieved from the DexCache, so reduce the number of arguments that need to be passed. Also refactor the code to avoid doing the DexCache lookup twice and avoid unnecessary read barriers in the initial DexCache lookup (also for Lookup/ResolveField()). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Idea9aa42b6a5bade947e93e330b1abdb9d11b2da
Diffstat (limited to 'runtime/native/java_lang_Class.cc')
-rw-r--r--runtime/native/java_lang_Class.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 9359ffc7fd..da5cee1ddc 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -146,11 +146,11 @@ static jobjectArray Class_getInterfacesInternal(JNIEnv* env, jobject javaThis) {
// with kActiveTransaction == false.
DCHECK(!Runtime::Current()->IsActiveTransaction());
+ ClassLinker* linker = Runtime::Current()->GetClassLinker();
MutableHandle<mirror::Class> interface(hs.NewHandle<mirror::Class>(nullptr));
for (uint32_t i = 0; i < num_ifaces; ++i) {
const dex::TypeIndex type_idx = iface_list->GetTypeItem(i).type_idx_;
- interface.Assign(ClassLinker::LookupResolvedType(
- type_idx, klass->GetDexCache(), klass->GetClassLoader()));
+ interface.Assign(linker->LookupResolvedType(type_idx, klass.Get()));
ifaces->SetWithoutChecks<false>(i, interface.Get());
}