diff options
Diffstat (limited to 'runtime/entrypoints')
-rw-r--r-- | runtime/entrypoints/quick/quick_trampoline_entrypoints.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index 8ab90eb..a67ebca 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -930,6 +930,16 @@ extern "C" const void* artQuickResolutionTrampoline(mirror::ArtMethod* called, (caller->GetDexCacheResolvedMethod(update_dex_cache_method_index) != called)) { caller->SetDexCacheResolvedMethod(update_dex_cache_method_index, called); } + } else if (invoke_type == kStatic) { + const auto called_dex_method_idx = called->GetDexMethodIndex(); + // For static invokes, we may dispatch to the static method in the superclass but resolve + // using the subclass. To prevent getting slow paths on each invoke, we force set the + // resolved method for the super class dex method index if we are in the same dex file. + // b/19175856 + if (called->GetDexFile() == called_method.dex_file && + called_method.dex_method_index != called_dex_method_idx) { + called->GetDexCache()->SetResolvedMethod(called_dex_method_idx, called); + } } // Ensure that the called method's class is initialized. StackHandleScope<1> hs(soa.Self()); |