summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_mips.cc
diff options
context:
space:
mode:
authorGoran Jakovljevic <Goran.Jakovljevic@imgtec.com>2016-10-04 10:17:34 +0200
committerGoran Jakovljevic <Goran.Jakovljevic@imgtec.com>2016-10-04 12:28:51 +0200
commite919b074dbbc5feea4e68d9ee0bbd1a3e248c738 (patch)
treef5eacb1d1dfa59c4b734ff297441e6aa8a4e9a18 /compiler/optimizing/code_generator_mips.cc
parentf12831352ce7a697a7efed9ccecaf664acefe7af (diff)
MIPS32: Fix GenerateVirtualCall in the presence of intrinsics
Fix GenerateVirtualCall like it is done in the I0ed88a48b313a8d28bc39fae40631123aadb13ef for all other architectures. Test: mma -j2 test-art-target-run-test-optimizing on CI20 Change-Id: Ie55c62701b20c4f40badc95563b2aef9e83807de
Diffstat (limited to 'compiler/optimizing/code_generator_mips.cc')
-rw-r--r--compiler/optimizing/code_generator_mips.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc
index 5c0ca85c78..2bd9339490 100644
--- a/compiler/optimizing/code_generator_mips.cc
+++ b/compiler/optimizing/code_generator_mips.cc
@@ -4504,8 +4504,13 @@ void InstructionCodeGeneratorMIPS::VisitInvokeStaticOrDirect(HInvokeStaticOrDire
}
void CodeGeneratorMIPS::GenerateVirtualCall(HInvokeVirtual* invoke, Location temp_location) {
- LocationSummary* locations = invoke->GetLocations();
- Location receiver = locations->InAt(0);
+ // Use the calling convention instead of the location of the receiver, as
+ // intrinsics may have put the receiver in a different register. In the intrinsics
+ // slow path, the arguments have been moved to the right place, so here we are
+ // guaranteed that the receiver is the first register of the calling convention.
+ InvokeDexCallingConvention calling_convention;
+ Register receiver = calling_convention.GetRegisterAt(0);
+
Register temp = temp_location.AsRegister<Register>();
size_t method_offset = mirror::Class::EmbeddedVTableEntryOffset(
invoke->GetVTableIndex(), kMipsPointerSize).SizeValue();
@@ -4513,8 +4518,7 @@ void CodeGeneratorMIPS::GenerateVirtualCall(HInvokeVirtual* invoke, Location tem
Offset entry_point = ArtMethod::EntryPointFromQuickCompiledCodeOffset(kMipsPointerSize);
// temp = object->GetClass();
- DCHECK(receiver.IsRegister());
- __ LoadFromOffset(kLoadWord, temp, receiver.AsRegister<Register>(), class_offset);
+ __ LoadFromOffset(kLoadWord, temp, receiver, class_offset);
MaybeRecordImplicitNullCheck(invoke);
// temp = temp->GetMethodAt(method_offset);
__ LoadFromOffset(kLoadWord, temp, temp, method_offset);