Research and Implementation of Bytecode Instruction Folding on Java Card

How to improve the run speed of the interpreter on Java Card with limited resources is an important issue. An optimized instruction folding algorithm is given in this paper. At first, the optimization scheme based on off-card and on-card virtual machine is given. The optimized instruction roles model for folding is defined and the grammar rules for folding are designed. Secondly, the byte codes dependency in instruction folding groups is analyzed. The instruction folding algorithm and the state diagram of folding process are designed and implemented. At last, the optimized algorithm is tested on SLE66CLX800PE smart card. The results show that the speed performance gain of instruction groups is 2.28 and the gain of typical financial Applets is 1.24.The instruction folding algorithm speeds up the execution of interpreter. Keywords—Java Card, stack computer, instruction folding