TEMPLATE_RETURN.S revision 97319a8a234e9fe1cf90ca39aa6eca37d729afd5
1 /* 2 * Unwind a frame from the Dalvik stack for compiled OP_RETURN_XXX. 3 * If the stored value in returnAddr 4 * is non-zero, the caller is compiled by the JIT thus return to the 5 * address in the code cache following the invoke instruction. Otherwise 6 * return to the special dvmJitToInterpNoChain entry point. 7 */ 8 SAVEAREA_FROM_FP(r0, rFP) @ r0<- saveArea (old) 9 ldr r10, [r0, #offStackSaveArea_prevFrame] @ r10<- saveArea->prevFrame 10 ldr r8, [rGLUE, #offGlue_pSelfSuspendCount] @ r8<- &suspendCount 11 ldr rPC, [r0, #offStackSaveArea_savedPc] @ rPC<- saveArea->savedPc 12#if !defined(WITH_SELF_VERIFICATION) 13 ldr r9, [r0, #offStackSaveArea_returnAddr] @ r9<- chaining cell ret 14#else 15 mov r9, #0 @ disable chaining 16#endif 17 ldr r2, [r10, #(offStackSaveArea_method - sizeofStackSaveArea)] 18 @ r2<- method we're returning to 19 ldr r3, [rGLUE, #offGlue_self] @ r3<- glue->self 20 cmp r2, #0 @ break frame? 21#if !defined(WITH_SELF_VERIFICATION) 22 beq 1f @ bail to interpreter 23#else 24 blxeq lr @ punt to interpreter and compare state 25#endif 26 ldr r0, .LdvmJitToInterpNoChain @ defined in footer.S 27 mov rFP, r10 @ publish new FP 28 ldrne r10, [r2, #offMethod_clazz] @ r10<- method->clazz 29 ldr r8, [r8] @ r8<- suspendCount 30 31 str r2, [rGLUE, #offGlue_method]@ glue->method = newSave->method 32 ldr r1, [r10, #offClassObject_pDvmDex] @ r1<- method->clazz->pDvmDex 33 str rFP, [r3, #offThread_curFrame] @ self->curFrame = fp 34 add rPC, rPC, #6 @ publish new rPC (advance 6 bytes) 35 str r1, [rGLUE, #offGlue_methodClassDex] 36 cmp r8, #0 @ check the suspendCount 37 movne r9, #0 @ clear the chaining cell address 38 cmp r9, #0 @ chaining cell exists? 39 blxne r9 @ jump to the chaining cell 40 mov pc, r0 @ callsite is interpreted 411: 42 stmia rGLUE, {rPC, rFP} @ SAVE_PC_FP_TO_GLUE() 43 ldr r2, .LdvmMterpStdBail @ defined in footer.S 44 mov r1, #0 @ changeInterp = false 45 mov r0, rGLUE @ Expecting rGLUE in r0 46 blx r2 @ exit the interpreter 47