Support for garbage collection at every instruction in a Java compiler

JM Stichnoth, GY Lueh, M Cierniak - ACM SIGPLAN Notices, 1999 - dl.acm.org
ACM SIGPLAN Notices, 1999dl.acm.org
A high-performance implementation of a Java Virtual Machine1 requires a compiler to
translate Java bytecodes into native instructions, as well as an advanced garbage collector
(eg, copying or generational). When the Java heap is exhausted and the garbage collector
executes, the compiler must report to the garbage collector all live object references
contained in physical registers and stack locations. Typical compilers only allow certain
instructions (eg, call instructions and backward branches) to be GC-safe; if GC happens at …
A high-performance implementation of a Java Virtual Machine1 requires a compiler to translate Java bytecodes into native instructions, as well as an advanced garbage collector (e.g., copying or generational). When the Java heap is exhausted and the garbage collector executes, the compiler must report to the garbage collector all live object references contained in physical registers and stack locations. Typical compilers only allow certain instructions (e.g., call instructions and backward branches) to be GC-safe; if GC happens at some other instruction, the compiler may need to advance execution to the next GC-safe point. Until now, no one has ever attempted to make every compiler-generated instruction GC-safe, due to the perception that recording this information would require too much space. This kind of support could improve the GC performance in multithreaded applications. We show how to use simple compression techniques to reduce the size of the GC map to about 20% of the generated code size, a result that is competitive with the best previously published results. In addition, we extend the work of Agesen, Detlefs, and Moss, regarding the so-called "JSR Problem" (the single exception to Java's type safety property), in a way that eliminates the need for extra runtime overhead in the generated code.
ACM Digital Library