Generation of fast interpreters for Huffman compressed bytecode

Embedded systems often have severe memory constraints requiring careful encoding of programs. For example, smart cards have on the order of 1K of RAM, 16K of non-volatile memory, and 24K of ROM. A virtual machine can be an effective approach to obtain compact programs but instructions are commonly encoded using one byte for the opcode and multiple bytes for the operands, which can be wasteful and thus limit the size of programs runnable on embedded systems. Our approach uses canonical Huffman codes to generate compact opcodes with custom-sized operand fields and with a virtual machine that directly executes this compact code. We present techniques to automatically generate the new instruction formats and the decoder. In effect, this automatically creates both an instruction set for a customized virtual machine and an implementation of that machine. We demonstrate that, without prior decompression, fast decoding of these virtual compressed instructions is feasible. Through experiments on Scheme and Java, we demonstrate the speed of these decoders. Java benchmarks show an average execution slowdown of 9%. Compression factors highly depend on the original bytecode and the training sample, but typically vary from 30% to 60%.

[1]  M. Kozuch,et al.  Compression of embedded system programs , 1994, Proceedings 1994 IEEE International Conference on Computer Design: VLSI in Computers and Processors.

[2]  Todd A. Proebsting Optimizing an ANSI C interpreter with superoperators , 1995, POPL '95.

[3]  Alistair Moffat,et al.  On the implementation of minimum-redundancy prefix codes , 1996, Proceedings of Data Compression Conference - DCC '96.

[4]  Andrew Wolfe,et al.  A fast asynchronous Huffman decoder for compressed-code embedded processors , 1998, Proceedings Fourth International Symposium on Advanced Research in Asynchronous Circuits and Systems.

[5]  Mario Latendresse Automatic Generation of Compact Programs and Virtual Machines for Scheme , 2000 .

[6]  David A. Patterson,et al.  Computer Architecture - A Quantitative Approach, 5th Edition , 1996 .

[7]  Kevin D. Kissell MIPS16: High-density MIPS for the Embedded Market1 , 1997 .

[8]  David Gregg,et al.  Primitive Sequences in General Purpose Forth Programs , 2002 .

[9]  Ulrik Pagh Schultz,et al.  Java bytecode compression for low-end embedded systems , 2000, TOPL.

[10]  William Pugh,et al.  Compressing Java class files , 1999, PLDI '99.

[11]  Keith D. Cooper,et al.  Enhanced code compression for embedded RISC processors , 1999, PLDI '99.

[12]  D CooperKeith,et al.  Enhanced code compression for embedded RISC processors , 1999 .

[13]  J. P. Bennett,et al.  The Need for Reduced Byte Stream Instruction Sets , 1989, Comput. J..

[14]  D. Huffman A Method for the Construction of Minimum-Redundancy Codes , 1952 .

[15]  Eugene S. Schwartz,et al.  Generating a canonical prefix encoding , 1964, CACM.

[16]  Shmuel Tomi Klein,et al.  Efficient variants of Huffman codes in high level languages , 1985, SIGIR '85.

[17]  David A. Patterson,et al.  Computer Architecture: A Quantitative Approach , 1969 .

[18]  Christopher W. Fraser,et al.  Bytecode compression via profiled grammar rewriting , 2001, PLDI '01.

[19]  Lex Augusteijn,et al.  A code compression system based on pipelined interpreters , 1999, Softw. Pract. Exp..

[20]  Steven Lucco,et al.  Split-stream dictionary program compression , 2000, PLDI '00.

[21]  W. T. Wilner,et al.  Burroughs B1700 memory utilization , 1972, AFIPS '72 (Fall, part I).

[22]  David A. Huffman,et al.  A method for the construction of minimum-redundancy codes , 1952, Proceedings of the IRE.

[23]  W. Paul,et al.  Computer Architecture , 2000, Springer Berlin Heidelberg.

[24]  Wayne H. Wolf,et al.  Code compression for embedded systems , 1998, Proceedings 1998 Design and Automation Conference. 35th DAC. (Cat. No.98CH36175).

[25]  Robert K. Montoye,et al.  A decompression core for PowerPC , 1998, IBM J. Res. Dev..

[26]  Charles Consel,et al.  Harissa: A Flexible and Efficient Java Environment Mixing Bytecode and Compiled Code , 1997, COOTS.

[27]  Saumya K. Debray,et al.  Profile-guided code compression , 2002, PLDI '02.

[28]  Derek Rayside,et al.  Compact Java binaries for embedded systems , 1999, CASCON.

[29]  Keith D. Cooper,et al.  Optimizing for reduced code space using genetic algorithms , 1999, LCTES '99.