Skip to main content

Run-Time Bytecode Specialization

A Portable Approach to Generating Optimized Specialized Code

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2053))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. K. Asai. Binding-time analysis for both static and dynamic expressions. In SAS’ 99 (LNCS 1694), 1999.

    Google Scholar 

  2. J. Auslander, M. Philipose, C. Chambers, S. J. Eggers, and B. N. Bershad. Fast, effective dynamic compilation. In PLDI’96, pp.149–159, 1996.

    Google Scholar 

  3. N. Benton, A. Kennedy, and G. Russell. Compiling standard ML to Java bytecodes. In ICFP’98, 1998.

    Google Scholar 

  4. A. A. Berlin and R. J. Surati. Partial evaluation for scientific computing: The supercomputer toolkit experience. In PEPM’94, pp.133–141, 1994.

    Google Scholar 

  5. P. Bertelsen. Binding-time analysis for a JVM core language. Apr. 1999. http://www.dina.kvl.dk/~pmb/.

  6. P. Bothner. Kawa — compilinig dynamic languages to the Java VM. In USENIX, 1998.

    Google Scholar 

  7. 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.

    Google Scholar 

  8. 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.

    Google Scholar 

  9. D. R. Engler. VCODE: a retargetable, extensible, very fast dynamic code generation system. In PLDI’96, pp.160–170, 1996.

    Google Scholar 

  10. N. Fujinami. Determination of dynamic method dispatches using run-time code generation. In TIC’98, pp.253–271, 1998.

    Google Scholar 

  11. 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.

    Article  MATH  Google Scholar 

  12. 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.

    Google Scholar 

  13. B. Guenter, T. B. Knoblock, and E. Ruf. Specializing shaders. In SIGGRAPH’95, pp.343–349, 1995.

    Google Scholar 

  14. F. Henglein. Efficient type inference for higher-order binding-time analysis. In FPCA’91, pp.448–472, 1991.

    Google Scholar 

  15. L. Hornof and T. Jim. Certifying compilation and run-time code generation. In PEPM’99, pp.60–74, 1999.

    Google Scholar 

  16. L. Hornof and J. Noyé. Accurate binding-time analysis for imperative languages: Flow, context, and return sensitivity. In PEPM’97, pp. 63–73, 1997.

    Google Scholar 

  17. N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, 1993.

    Google Scholar 

  18. P. Lee and M. Leone. Optimizing ML with run-time code generation. In PLDI’96, pp.137–148, 1996.

    Google Scholar 

  19. T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1997.

    Google Scholar 

  20. H. Masuhara and A. Yonezawa. Design and partial evaluation of meta-objects for a concurrent reflective language. In ECOOP’98, pp.418–439, 1998.

    Google Scholar 

  21. 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.

    Google Scholar 

  22. 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.

    Google Scholar 

  23. 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.

    Google Scholar 

  24. 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.

    Article  Google Scholar 

  25. 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.

    Google Scholar 

  26. U. P. Schultz, J. L. Lawall, C. Consel, and G. Muller. Towards automatic specialization of Java programs. In ECOOP99, pp.367–390, 1999.

    Google Scholar 

  27. R. Stata and M. Abadi. A type system for Java bytecode subroutines. TOPLAS, 21(1):90–137, 1999.

    Article  Google Scholar 

  28. E. Volanschi, C. Consel, G. Muller, and C. Cowan. Declarative specialization of object-oriented programs. In OOPSLA’ 97, pp.286–300, 1997.

    Google Scholar 

  29. P. Wickline, P. Lee, and F. Pfenning. Run-time code generation and Modal-ML. In PLDI’98, pp.224–235, 1998.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics