MIPS32: Fix string loads that use kDexCacheViaMethod.
This fixes some string-related crashes, in particular,
failures in test 563-checker-fakestring.
The bug was introduced in commit
aad75c6d5bfab2dc8e30fc99fafe8cd2dc8b74d8.
Test: booted MIPS32R2 in QEMU
Test: test-art-target-run-test-optimizing (MIPS32R2) on CI20
Change-Id: Ie7d9a5b2c572b0933756f6e95c567968f811342c
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc
index f4a804f..12b1ab9 100644
--- a/compiler/optimizing/code_generator_mips.cc
+++ b/compiler/optimizing/code_generator_mips.cc
@@ -5695,7 +5695,12 @@
default:
break;
}
- locations->SetOut(Location::RequiresRegister());
+ if (load_kind == HLoadString::LoadKind::kDexCacheViaMethod) {
+ InvokeRuntimeCallingConvention calling_convention;
+ locations->SetOut(calling_convention.GetReturnLocation(load->GetType()));
+ } else {
+ locations->SetOut(Location::RequiresRegister());
+ }
}
void InstructionCodeGeneratorMIPS::VisitLoadString(HLoadString* load) {