摘要
针对编译循环内的查找表分派指令导致的代码重复或额外运行开销,在Dalvik虚拟机的基于Trace的即时编译器中提出了改进的代码生成算法。同已有的代码生成算法相比,该方法在划分基本块阶段获取查找表分派的信息,并将查找表分派指令转换成一系列条件分支指令,通过条件分支指令实现子Trace同主Trace的合并,避免了主子Trace切换时额外的函数调用。实验结果表明,对于循环内含查找表分派的应用程序,该算法能提升其性能。
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 ofbasic blocks, and converts the lookup table dispatch instruction into asequence 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.
出处
《计算机工程与设计》
CSCD
北大核心
2011年第6期2027-2030,共4页
Computer Engineering and Design
基金
航空科学基金项目(20095596014)
陕西省自然科学基金项目(2009JM8001-4)