Abstract
This paper proposes a run-time bytecode specialization (BCS) technique that analyzes programs and generates specialized programs at run-time in an intermediate language. By using an intermediate language for code generation, a back-end system can optimize the specialized programs after specialization. As the intermediate language, the system uses Java virtual machine language (JVML), which allows the system to easily achieve practical portability and to use sophisticated just-in-time compilers as its back-end. The binding-time analysis algorithm, which is based on a type system, covers a non-object-oriented subset of JVML. A specializer, which generates programs on a per-instruction basis, can perform method inlining at run-time. The performance measurement showed that a non-trivial application program specialized at run-time by BCS runs approximately 3–4 times faster than the unspecialized one. Despite the large amount of overheads at JIT compilation of specialized code, we observed that the overall performance of the application can be improved.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
K. Asai. Binding-time analysis for both static and dynamic expressions. In SAS’ 99 (LNCS 1694), 1999.
J. Auslander, M. Philipose, C. Chambers, S. J. Eggers, and B. N. Bershad. Fast, effective dynamic compilation. In PLDI’96, pp.149–159, 1996.
N. Benton, A. Kennedy, and G. Russell. Compiling standard ML to Java bytecodes. In ICFP’98, 1998.
A. A. Berlin and R. J. Surati. Partial evaluation for scientific computing: The supercomputer toolkit experience. In PEPM’94, pp.133–141, 1994.
P. Bertelsen. Binding-time analysis for a JVM core language. Apr. 1999. http://www.dina.kvl.dk/~pmb/.
P. Bothner. Kawa — compilinig dynamic languages to the Java VM. In USENIX, 1998.
J.-D. Choi, M. Gupta, M. Serrano, V. C. Sreedhar, and S. Midkiff. Escape analysis for Java. In L. M. Northrop, editor, OOPSLA’99, pp.1–19, 1999.
C. Consel and F. Noël. A general approach for run-time specialization and its application to C. In POPL’ 96, pp.145–170, 1996.
D. R. Engler. VCODE: a retargetable, extensible, very fast dynamic code generation system. In PLDI’96, pp.160–170, 1996.
N. Fujinami. Determination of dynamic method dispatches using run-time code generation. In TIC’98, pp.253–271, 1998.
Y. Futamura. Partial evaluation of computation process—an approach to a compiler-compiler. Higher-Order and Symbolic Computation, 12(4):381–391, 1999. Reprinted from Systems, Computers, Controls, 2(5):45–50, 1971.
B. Grant, M. Philipose, M. Mock, C. Chambers, and S. J. Eggers. An evaluation of staged run-time optimization in DyC. In PLDI’99, 1999.
B. Guenter, T. B. Knoblock, and E. Ruf. Specializing shaders. In SIGGRAPH’95, pp.343–349, 1995.
F. Henglein. Efficient type inference for higher-order binding-time analysis. In FPCA’91, pp.448–472, 1991.
L. Hornof and T. Jim. Certifying compilation and run-time code generation. In PEPM’99, pp.60–74, 1999.
L. Hornof and J. Noyé. Accurate binding-time analysis for imperative languages: Flow, context, and return sensitivity. In PEPM’97, pp. 63–73, 1997.
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, 1993.
P. Lee and M. Leone. Optimizing ML with run-time code generation. In PLDI’96, pp.137–148, 1996.
T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1997.
H. Masuhara and A. Yonezawa. Design and partial evaluation of meta-objects for a concurrent reflective language. In ECOOP’98, pp.418–439, 1998.
H. Masuhara and A. Yonezawa. Generating optimized residual code in run-time specialization. In International Colloquium on Partial Evaluation and Program Transformation, pp.83–102, 1999.
F. Noël, L. Hornof, C. Consel, and J. L. Lawall. Automatic, template-based runtime specialization: Implementation and experimental study. In ICCL’98, pp.123–142, 1998.
H. Ogawa, K. Shimura, S. Matsuoka, F. Maruyama, Y. Sohda, Y. Kimura, Open-JIT: an open-ended, reflective JIT compiler framework for Java, In ECOOP 2000, pp.362–387, 2000.
M. Poletto, W. C. Hsieh, D. R. Engler, and M. F. Kaashoek. ‘C and tcc: a language and compiler for dynamic code generation. TOPLAS, 21(2):324–369, 1999.
C. Pu, T. Autrey, A. Black, C. Consel, C. Cowan, J. Inouye, L. Kethana, J. Walpole, and K. Zhang. Optimistic incremental specialization: streamlining a commercial operating system. In SOSP’95, pp.314–324, 1995.
U. P. Schultz, J. L. Lawall, C. Consel, and G. Muller. Towards automatic specialization of Java programs. In ECOOP99, pp.367–390, 1999.
R. Stata and M. Abadi. A type system for Java bytecode subroutines. TOPLAS, 21(1):90–137, 1999.
E. Volanschi, C. Consel, G. Muller, and C. Cowan. Declarative specialization of object-oriented programs. In OOPSLA’ 97, pp.286–300, 1997.
P. Wickline, P. Lee, and F. Pfenning. Run-time code generation and Modal-ML. In PLDI’98, pp.224–235, 1998.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Masuhara, H., Yonezawa, A. (2001). Run-Time Bytecode Specialization. In: Danvy, O., Filinski, A. (eds) Programs as Data Objects. PADO 2001. Lecture Notes in Computer Science, vol 2053. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44978-7_9
Download citation
DOI: https://doi.org/10.1007/3-540-44978-7_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42068-2
Online ISBN: 978-3-540-44978-2
eBook Packages: Springer Book Archive