Supporting Binary Compatibility with Static Compilation
Dachuan Yu, Zhong Shao, Valery Trifonov · 2005
There is an ongoing debate in the Java community on whether statically compiled implementations can meet the Java specification on dynamic features such as binary compatibility. Static compilation is sometimes desirable because it provides better code optimization, smaller memory footprint, more robustness, and better intellec-tual property protection. Unfortunately, none of the ex-isting static Java compilers support binary compatibility, because it incurs unacceptable performance overhead. In this paper, we propose a simple yet effective solu-tion which handles all of the binary-compatibility cases specified by the Java Language Specification. Our ex-perimental results using an implementation in the GNU Java compiler shows that the performance penalty is on average less than 2%. Besides solving the problem for static compilers, it is also possible to use this technique in JIT compilers to achieve an optimal balance point be-tween static and dynamic compilation. 1