Code generation scheme improvement in trace-based just-in-time compiler
The compilation of the lookup table dispatch instructions in the loop usually leads to code duplication or extra run-time cost.An improved code generation algorithm is proposed and is implemented in the trace-based just-in-time(JIT) compiler of the Dalvik virtual machine.Compared with the algorithms presented,the new method can get the information of the lookup table dispatch during the partition of basic blocks,and converts the lookup table dispatch instruction into a sequence of conditional branch instructions,through which the compiler can merge the child trace into its parent trace and avoid function call during the switch between parent trace and child traces.Experimental results show that,for applications which contain lookup dispatches in the loop,the algorithm can improve their performance.