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 bxlo 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 #if !defined(WITH_SELF_VERIFICATION) 26 bxne lr @ bail to the interpreter 27 #else 28 bx lr @ bail to interpreter unconditionally 29 #endif 30 31 @ go ahead and transfer control to the native code 32 ldr r9, [r3, #offThread_jniLocal_topCookie] @ r9<- thread->localRef->... 33 mov r2, #0 34 str r1, [r3, #offThread_curFrame] @ self->curFrame = newFp 35 str r2, [r3, #offThread_inJitCodeCache] @ not in the jit code cache 36 str r9, [r1, #(offStackSaveArea_localRefCookie - sizeofStackSaveArea)] 37 @ newFp->localRefCookie=top 38 mov r9, r3 @ r9<- glue->self (preserve) 39 SAVEAREA_FROM_FP(r10, r1) @ r10<- new stack save area 40 41 mov r2, r0 @ r2<- methodToCall 42 mov r0, r1 @ r0<- newFP 43 add r1, rGLUE, #offGlue_retval @ r1<- &retval 44 45 blx r8 @ off to the native code 46 47 @ native return; r9=self, r10=newSaveArea 48 @ equivalent to dvmPopJniLocals 49 ldr r2, [r10, #offStackSaveArea_returnAddr] @ r2 = chaining cell ret 50 ldr r0, [r10, #offStackSaveArea_localRefCookie] @ r0<- saved->top 51 ldr r1, [r9, #offThread_exception] @ check for exception 52 str rFP, [r9, #offThread_curFrame] @ self->curFrame = fp 53 cmp r1, #0 @ null? 54 str r0, [r9, #offThread_jniLocal_topCookie] @ new top <- old top 55 ldr r0, [rFP, #(offStackSaveArea_currentPc - sizeofStackSaveArea)] 56 57 @ r0 = dalvikCallsitePC 58 bne .LhandleException @ no, handle exception 59 60 str r2, [r9, #offThread_inJitCodeCache] @ set the mode properly 61 cmp r2, #0 @ return chaining cell still exists? 62 bxne r2 @ yes - go ahead 63 64 @ continue executing the next instruction through the interpreter 65 ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S 66 add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes) 67 #if defined(WITH_JIT_TUNING) 68 mov r0, #kCallsiteInterpreted 69 #endif 70 mov pc, r1 71