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.
[1]
Amer Diwan,et al.
Compiler support for garbage collection in a statically typed language
,
1992,
PLDI '92.
[2]
Frank Yellin,et al.
The Java Virtual Machine Specification
,
1996
.
[3]
Ali-Reza Adl-Tabatabai,et al.
Fast, effective code generation in a just-in-time Java compiler
,
1998,
PLDI.
[4]
David Detlefs,et al.
Garbage collection and local variable type-precision and liveness in Java virtual machines
,
1998,
PLDI.
[5]
Guy L. Steele,et al.
The Java Language Specification
,
1996
.
[6]
Alfred V. Aho,et al.
Compilers: Principles, Techniques, and Tools
,
1986,
Addison-Wesley series in computer science / World student series edition.
[7]
Hans-Juergen Boehm,et al.
Garbage collection in an uncooperative environment
,
1988,
Softw. Pract. Exp..
[8]
J. Eliot B. Moss,et al.
Incremental Collection of Mature Objects
,
1992,
IWMM.