1 @ r0 = methodToCall, r1 = returnCell, rPC = dalvikCallsite 2 ldrh r7, [r0, #offMethod_registersSize] @ r7<- methodToCall->regsSize 3 ldr r9, [rGLUE, #offGlue_interpStackEnd] @ r9<- interpStackEnd 4 ldr r8, [rGLUE, #offGlue_pSelfSuspendCount] @ r8<- &suspendCount 5 add r3, r1, #1 @ Thumb addr is odd 6 SAVEAREA_FROM_FP(r1, rFP) @ r1<- stack save area 7 sub r1, r1, r7, lsl #2 @ r1<- newFp (old savearea - regsSize) 8 SAVEAREA_FROM_FP(r10, r1) @ r10<- stack save area 9 ldr r8, [r8] @ r3<- suspendCount (int) 10 cmp r10, r9 @ bottom < interpStackEnd? 11 bxlt lr @ return to raise stack overflow excep. 12 @ r1 = newFP, r0 = methodToCall, r3 = returnCell, rPC = dalvikCallsite 13 str rPC, [rFP, #(offStackSaveArea_currentPc - sizeofStackSaveArea)] 14 str rPC, [r1, #(offStackSaveArea_savedPc - sizeofStackSaveArea)] 15 ldr rPC, [r0, #offMethod_insns] @ rPC<- methodToCall->insns 16 17 18 @ set up newSaveArea 19 str rFP, [r1, #(offStackSaveArea_prevFrame - sizeofStackSaveArea)] 20 str r3, [r1, #(offStackSaveArea_returnAddr - sizeofStackSaveArea)] 21 ldr r3, [rGLUE, #offGlue_self] @ r3<- glue->self 22 str r0, [r1, #(offStackSaveArea_method - sizeofStackSaveArea)] 23 cmp r8, #0 @ suspendCount != 0 24 ldr r8, [r0, #offMethod_nativeFunc] @ r8<- method->nativeFunc 25 bxne lr @ bail to the interpreter 26 27 @ go ahead and transfer control to the native code 28 ldr r9, [r3, #offThread_jniLocal_topCookie] @ r9<- thread->localRef->... 29 str r1, [r3, #offThread_curFrame] @ self->curFrame = newFp 30 str r9, [r1, #(offStackSaveArea_localRefCookie - sizeofStackSaveArea)] 31 @ newFp->localRefCookie=top 32 mov r9, r3 @ r9<- glue->self (preserve) 33 SAVEAREA_FROM_FP(r10, r1) @ r10<- new stack save area 34 35 mov r2, r0 @ r2<- methodToCall 36 mov r0, r1 @ r0<- newFP 37 add r1, rGLUE, #offGlue_retval @ r1<- &retval 38 39 blx r8 @ off to the native code 40 41 @ native return; r9=self, r10=newSaveArea 42 @ equivalent to dvmPopJniLocals 43 ldr r2, [r10, #offStackSaveArea_returnAddr] @ r2 = chaining cell ret 44 ldr r0, [r10, #offStackSaveArea_localRefCookie] @ r0<- saved->top 45 ldr r1, [r9, #offThread_exception] @ check for exception 46 str rFP, [r9, #offThread_curFrame] @ self->curFrame = fp 47 cmp r1, #0 @ null? 48 str r0, [r9, #offThread_jniLocal_topCookie] @ new top <- old top 49 bne .LhandleException @ no, handle exception 50 bx r2 51 52