Fix generic JNI stubs to not discard the Java native frame.
Change-Id: Ic856b442fdde5ce91673fc5856eb0dfc84c75d28
diff --git a/runtime/arch/mips/quick_entrypoints_mips.S b/runtime/arch/mips/quick_entrypoints_mips.S
index df2feb7..16f0e70 100644
--- a/runtime/arch/mips/quick_entrypoints_mips.S
+++ b/runtime/arch/mips/quick_entrypoints_mips.S
@@ -1142,10 +1142,10 @@
addiu $sp, $sp, -24 # reserve arg slots
jal artQuickGenericJniEndTrampoline
s.d $f0, 16($sp) # pass result_f
- addiu $sp, $sp, 24 # remove arg slots
lw $t0, THREAD_EXCEPTION_OFFSET(rSELF) # load Thread::Current()->exception_
- bne $t0, $zero, 2f # check for pending exceptions
+ bne $t0, $zero, 1f # check for pending exceptions
+
move $sp, $s8 # tear down the alloca
# tear dpown the callee-save frame
@@ -1156,9 +1156,8 @@
nop
1:
- move $sp, $s8 # tear down the alloca
-2:
- RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME
+ lw $sp, THREAD_TOP_QUICK_FRAME_OFFSET(rSELF)
+ # This will create a new save-all frame, required by the runtime.
DELIVER_PENDING_EXCEPTION
END art_quick_generic_jni_trampoline