Hi every body, As we know that when DalvikVM run a dex file,it read byte code from dex file and convert to machine code to execute on current platform. I do not understand the process about how to Dalvik converts byte code to machine code.
For example, op code invoke static in file \dalvik\vm\mterp\out \InterpAsm-armv5te.S .L_OP_INVOKE_STATIC: /* 0x71 */ /* File: armv5te/OP_INVOKE_STATIC.S */ /* * Handle a static method call. * * for: invoke-static, invoke-static/range */ /* op vB, {vD, vE, vF, vG, vA}, cl...@cccc */ /* op {vCCCC..v(CCCC+AA-1)}, m...@bbbb */ ldr r3, [rGLUE, #offGlue_methodClassDex] @ r3<- pDvmDex FETCH(r1, 1) @ r1<- BBBB ldr r3, [r3, #offDvmDex_pResMethods] @ r3<- pDvmDex- >pResMethods ldr r0, [r3, r1, lsl #2] @ r0<- resolved methodToCall cmp r0, #0 @ already resolved? EXPORT_PC() @ must export for invoke bne common_invokeMethodNoRange @ yes, continue on 0: ldr r3, [rGLUE, #offGlue_method] @ r3<- glue->method ldr r0, [r3, #offMethod_clazz] @ r0<- method->clazz mov r2, #METHOD_STATIC @ resolver method type bl dvmResolveMethod @ r0<- call(clazz, ref, flags) cmp r0, #0 @ got null? bne common_invokeMethodNoRange @ no, continue b common_exceptionThrown @ yes, handle exception I do not understand the above algorithm and the meaning of every lines code that implement op code invoke static for ARM assembler What is /* op vB, {vD, vE, vF, vG, vA}, cl...@cccc */ /* op {vCCCC..v(CCCC+AA-1)}, m...@bbbb */ and what is the meaning of every line of above code, for example ldr r3, [rGLUE, #offGlue_methodClassDex] @ r3<- pDvmDex Could you help me how to understand the above code and the algorithm to implement op code invoke static? Do we have any document about it? Thanks a lot Mercury --~--~---------~--~----~------------~-------~--~----~ unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---