MIPS64: Fix art_quick_aput_obj stubs
Prevent situations where $gp is calculated and saved twice in a row
without restoring it. When restored in the end, its value was wrong.
This fixes test failure in stub_test.APutObj.
Test: mma test-art-target-gtest-stub_test64 on QEMU
Change-Id: I63b37ecee8d3576c57c0f6862d00bc03965b042d
diff --git a/runtime/arch/mips64/quick_entrypoints_mips64.S b/runtime/arch/mips64/quick_entrypoints_mips64.S
index 8fc7bc3..cb2d1c8 100644
--- a/runtime/arch/mips64/quick_entrypoints_mips64.S
+++ b/runtime/arch/mips64/quick_entrypoints_mips64.S
@@ -1368,7 +1368,7 @@
bne $a0, $zero, .Lart_quick_aput_obj_with_bound_check_gp_set
nop
b art_quick_throw_null_pointer_exception
- nop
+ .cpreturn # Restore gp from t8 in branch delay slot.
END art_quick_aput_obj_with_null_and_bound_check
ENTRY art_quick_aput_obj_with_bound_check
@@ -1377,8 +1377,9 @@
bne $t1, $zero, .Lart_quick_aput_obj_gp_set
nop
move $a0, $a1
- b art_quick_throw_array_bounds
move $a1, $t0
+ b art_quick_throw_array_bounds
+ .cpreturn # Restore gp from t8 in branch delay slot.
END art_quick_aput_obj_with_bound_check
ENTRY art_quick_aput_obj