diff options
author | Vladimir Marko <vmarko@google.com> | 2014-02-03 14:08:42 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-02-11 18:14:58 +0000 |
commit | bbcc0c0a17262f3d2a70fc0a82e1783862f708cc (patch) | |
tree | ccb113f6c8532d5656b2f38e464d1e1086d9d0de /runtime/entrypoints/quick | |
parent | 0a07f9391e9bef0f49bd3623892f9cf3d77c14a1 (diff) | |
download | art-bbcc0c0a17262f3d2a70fc0a82e1783862f708cc.zip art-bbcc0c0a17262f3d2a70fc0a82e1783862f708cc.tar.gz art-bbcc0c0a17262f3d2a70fc0a82e1783862f708cc.tar.bz2 |
Speed up method lookup in a different dex file.
Use already known name and proto.
Change-Id: I4505b81724bd6a0f3cf21ee6fed44774d38c4e15
Diffstat (limited to 'runtime/entrypoints/quick')
-rw-r--r-- | runtime/entrypoints/quick/quick_trampoline_entrypoints.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index 9f30190..f9486c3 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -561,9 +561,11 @@ extern "C" const void* artQuickResolutionTrampoline(mirror::ArtMethod* called, caller->GetDexCacheResolvedMethods()->Set(called->GetDexMethodIndex(), called); } else { // Calling from one dex file to another, need to compute the method index appropriate to - // the caller's dex file. + // the caller's dex file. Since we get here only if the original called was a runtime + // method, we've got the correct dex_file and a dex_method_idx from above. + DCHECK(&MethodHelper(caller).GetDexFile() == dex_file); uint32_t method_index = - MethodHelper(called).FindDexMethodIndexInOtherDexFile(MethodHelper(caller).GetDexFile()); + MethodHelper(called).FindDexMethodIndexInOtherDexFile(*dex_file, dex_method_idx); if (method_index != DexFile::kDexNoIndex) { caller->GetDexCacheResolvedMethods()->Set(method_index, called); } |