1 /* 2 * For polymorphic callsites - setup the Dalvik frame and load Dalvik PC 3 * into rPC then jump to dvmJitToInterpNoChain to dispatch the 4 * runtime-resolved callee. 5 */ 6 @ r0 = methodToCall, r1 = returnCell, rPC = dalvikCallsite 7 ldrh r7, [r0, #offMethod_registersSize] @ r7<- methodToCall->regsSize 8 ldrh r2, [r0, #offMethod_outsSize] @ r2<- methodToCall->outsSize 9 ldr r9, [rGLUE, #offGlue_interpStackEnd] @ r9<- interpStackEnd 10 ldr r8, [rGLUE, #offGlue_pSelfSuspendCount] @ r8<- &suspendCount 11 add r3, r1, #1 @ Thumb addr is odd 12 SAVEAREA_FROM_FP(r1, rFP) @ r1<- stack save area 13 sub r1, r1, r7, lsl #2 @ r1<- newFp (old savearea - regsSize) 14 SAVEAREA_FROM_FP(r10, r1) @ r10<- stack save area 15 sub r10, r10, r2, lsl #2 @ r10<- bottom (newsave - outsSize) 16 ldr r8, [r8] @ r8<- suspendCount (int) 17 cmp r10, r9 @ bottom < interpStackEnd? 18 bxlo lr @ return to raise stack overflow excep. 19 @ r1 = newFP, r0 = methodToCall, r3 = returnCell, rPC = dalvikCallsite 20 ldr r9, [r0, #offMethod_clazz] @ r9<- method->clazz 21 ldr r10, [r0, #offMethod_accessFlags] @ r10<- methodToCall->accessFlags 22 str rPC, [rFP, #(offStackSaveArea_currentPc - sizeofStackSaveArea)] 23 str rPC, [r1, #(offStackSaveArea_savedPc - sizeofStackSaveArea)] 24 ldr rPC, [r0, #offMethod_insns] @ rPC<- methodToCall->insns 25 26 27 @ set up newSaveArea 28 str rFP, [r1, #(offStackSaveArea_prevFrame - sizeofStackSaveArea)] 29 str r3, [r1, #(offStackSaveArea_returnAddr - sizeofStackSaveArea)] 30 str r0, [r1, #(offStackSaveArea_method - sizeofStackSaveArea)] 31 cmp r8, #0 @ suspendCount != 0 32 bxne lr @ bail to the interpreter 33 tst r10, #ACC_NATIVE 34#if !defined(WITH_SELF_VERIFICATION) 35 bne .LinvokeNative 36#else 37 bxne lr @ bail to the interpreter 38#endif 39 40 ldr r10, .LdvmJitToInterpTraceSelectNoChain 41 ldr r3, [r9, #offClassObject_pDvmDex] @ r3<- method->clazz->pDvmDex 42 ldr r2, [rGLUE, #offGlue_self] @ r2<- glue->self 43 44 @ Update "glue" values for the new method 45 str r0, [rGLUE, #offGlue_method] @ glue->method = methodToCall 46 str r3, [rGLUE, #offGlue_methodClassDex] @ glue->methodClassDex = ... 47 mov rFP, r1 @ fp = newFp 48 str rFP, [r2, #offThread_curFrame] @ self->curFrame = newFp 49 50 @ Start executing the callee 51#if defined(WITH_JIT_TUNING) 52 mov r0, #kInlineCacheMiss 53#endif 54 mov pc, r10 @ dvmJitToInterpTraceSelectNoChain 55