diff options
author | Vladimir Marko <vmarko@google.com> | 2016-04-06 17:33:41 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2016-04-06 17:33:41 +0100 |
commit | 40ecb12f8eeb97b810e11f895278abbf7988ed4d (patch) | |
tree | 54d999605c0eaf3b4d311f83f8162684506f4a31 /compiler/optimizing/code_generator_mips.cc | |
parent | 5827507da8efdaf4536c70dfdc54407c28e37852 (diff) |
Optimizing: Fix codegens for MethodLoadKind::kDexCacheViaMethod.
Use the original method index instead of the target method
index because the target method may point to a different dex
file.
No regression test: this currently happens only if the
codegen uses the kDexCacheViaMethod as a fallback for
another load kind and we aim to avoid that fallback, so it
would be difficult to write a reliable regression test. We
could try and exploit current fallbacks for irreducible
loops on x86 and arm but those fallbacks will eventually
disappear anyway.
Bug: 28036230
Change-Id: I4cc9e046480d3d60a7fb521f0ca6a98914625cdc
Diffstat (limited to 'compiler/optimizing/code_generator_mips.cc')
-rw-r--r-- | compiler/optimizing/code_generator_mips.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index 8b19f84e1c..bbfdb30563 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -3896,8 +3896,9 @@ void CodeGeneratorMIPS::GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke reg, method_reg, ArtMethod::DexCacheResolvedMethodsOffset(kMipsPointerSize).Int32Value()); - // temp = temp[index_in_cache] - uint32_t index_in_cache = invoke->GetTargetMethod().dex_method_index; + // temp = temp[index_in_cache]; + // Note: Don't use invoke->GetTargetMethod() as it may point to a different dex file. + uint32_t index_in_cache = invoke->GetDexMethodIndex(); __ LoadFromOffset(kLoadWord, reg, reg, |