Fix refs_and_args callee save order for Mips32.
This patch fixes an ART crash while using the soft keyboard.
Change-Id: Ib2d651c460ce2707356986cd733bed23b0cabb21
diff --git a/runtime/arch/mips/quick_entrypoints_mips.S b/runtime/arch/mips/quick_entrypoints_mips.S
index 509f991..9d89b1b 100644
--- a/runtime/arch/mips/quick_entrypoints_mips.S
+++ b/runtime/arch/mips/quick_entrypoints_mips.S
@@ -190,12 +190,12 @@
.cfi_rel_offset 19, 32
sw $s2, 28($sp)
.cfi_rel_offset 18, 28
- sw $a3, 12($sp)
- .cfi_rel_offset 7, 12
- sw $a2, 8($sp)
- .cfi_rel_offset 6, 8
- sw $a1, 4($sp)
- .cfi_rel_offset 5, 4
+ sw $a3, 24($sp)
+ .cfi_rel_offset 7, 24
+ sw $a2, 20($sp)
+ .cfi_rel_offset 6, 20
+ sw $a1, 16($sp)
+ .cfi_rel_offset 5, 16
# bottom will hold Method*
.endm
@@ -257,11 +257,11 @@
.cfi_restore 19
lw $s2, 28($sp)
.cfi_restore 18
- lw $a3, 12($sp)
+ lw $a3, 24($sp)
.cfi_restore 7
- lw $a2, 8($sp)
+ lw $a2, 20($sp)
.cfi_restore 6
- lw $a1, 4($sp)
+ lw $a1, 16($sp)
.cfi_restore 5
addiu $sp, $sp, 64 # pop frame
.cfi_adjust_cfa_offset -64
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 4bec70a..90d4a37 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -126,7 +126,7 @@
static constexpr size_t kNumQuickGprArgs = 3; // 3 arguments passed in GPRs.
static constexpr size_t kNumQuickFprArgs = 0; // 0 arguments passed in FPRs.
static constexpr size_t kQuickCalleeSaveFrame_RefAndArgs_Fpr1Offset = 0; // Offset of first FPR arg.
- static constexpr size_t kQuickCalleeSaveFrame_RefAndArgs_Gpr1Offset = 4; // Offset of first GPR arg.
+ static constexpr size_t kQuickCalleeSaveFrame_RefAndArgs_Gpr1Offset = 16; // Offset of first GPR arg.
static constexpr size_t kQuickCalleeSaveFrame_RefAndArgs_LrOffset = 60; // Offset of return address.
static size_t GprIndexToGprOffset(uint32_t gpr_index) {
return gpr_index * GetBytesPerGprSpillLocation(kRuntimeISA);