Skip to main content

Thin Guards: A Simple and Effective Technique for Reducing the Penalty of Dynamic Class Loading

  • Conference paper
  • First Online:

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

Abstract

Dynamic class loading is an integral part of the Java™ programming language, offering a number of advantages such as lazy class loading and dynamic installation of software components. Unfortunately, these advantages often come at the cost of decreased performance because certain optimizations become more difficult to perform when an optimizing compiler cannot assume that it has seen the whole program. This paper introduces thin guards, a simple but effective technique that uses lightweight runtime tests to identify regions of code within which speculative optimizations can be performed. One application of thin guards is described in detail, demonstrating how they can be used to perform speculative inlining in the presence of dynamic class loading. Our experimental evaluation shows that when used in combination with other traditional compiler optimizations, thin guards can eliminate most of the penalty of dynamic class loading. Performance improvements of up to 27% are observed, eliminating up to 92% of the penalty imposed by dynamic class loading.

Funded, in part, by NSF grant CCR-9808607.

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   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.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. B. Alpern, C. R. Attanasio, J. J. Barton, M. G. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. F. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeño virtual machine. IBM Systems Journal, 39(1), 2000.

    Google Scholar 

  2. B. Alpern, A. Cocchi, and D. Grove. Dynamic typechecking in Jalapeño. In Usenix Java Virtual Machine Research and Technology Symposium (JVM’01), Apr. 2001.

    Google Scholar 

  3. M. Arnold, S. Fink, D. Grove, M. Hind, and P. Sweeney. Adaptive optimization in the Jalapeño JVM. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Oct. 2000.

    Google Scholar 

  4. M. Arnold. Online instrumentation and feedback-directed optimization of Java. Technical Report DCS-TR-469, Department of Computer Science, Rutgers University, 2001.

    Google Scholar 

  5. M. G. Burke, J.-D. Choi, S. Fink, D. Grove, M. Hind, V. Sarkar, M. J. Serrano, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeño dynamic optimizing compiler for Java. In ACM 1999 Java Grande Conference, pages 129–141, June 1999.

    Google Scholar 

  6. C. Chambers and D. Ungar. Making pure object-oriented languages practical. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 1–15, Nov. 1991. SIGPLAN Notices 26(11).

    Google Scholar 

  7. C. Chambers. The Design and Implementation of the SELF Compiler, an Optimizing Comiler for Object-Oriented Programming Languages. PhD thesis, Stanford University, 1992.

    Google Scholar 

  8. M. Cierniak, G.-Y. Lueh, and J. M. Stichnoth. Practicing JUDO: Java Under Dynamic Optimizations. In SIGPLAN 2000 Conference on Programming Language Design and Implementation, June 2000.

    Google Scholar 

  9. T. S. P. E. Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98/, 1998.

  10. J. Dean, D. Grove, and C. Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In 9th European Conference on Object-Oriented Programming, 1995.

    Google Scholar 

  11. D. Detlefs and O. Agesen. Inlining of virtual methods. In 13th European Conference on Object-Oriented Programming, 1999.

    Google Scholar 

  12. K. Driesen and U. Hoelzle. Minimizing row displacement dispatch tables. ACM SIGPLAN Notices, 30(10):141–155, Oct. 1995.

    Google Scholar 

  13. M. Fernandez. Simple and effective link-time optimizations of modula-3 programs. In SIGPLAN’ 95 Conference on Programming Language Design and Implementation, 1995.

    Google Scholar 

  14. D. Grove, J. Dean, C. Garrett, and C. Chambers. Profile-guided receiver class prediction. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 108–123, Oct. 1995.

    Google Scholar 

  15. U. Hölzle, C. Chambers, and D. Ungar. Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In P. America, editor, Proceedings ECOOP’ 91, LNCS 512, pages 21–38, Geneva, Switzerland, July 15–19 1991. Springer-Verlag.

    Google Scholar 

  16. U. Hölzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In Proceedings of the ACM SIGPLAN’ 92 Conference on Programming Language Design and Implementation, pages 32–43, June 1992.

    Google Scholar 

  17. U. Hölzle and D. Ungar. Optimizing dynamically-dispatched calls with run-time type feedback. In Proceedings of the ACM SIGPLAN’94 Conference on Programming Language Design and Implementation (PLDI), pages 326–336, Orlando, Florida, 20–24 June 1994. SIGPLAN Notices 29(6), June 1994.

    Google Scholar 

  18. K. Ishizaki, M. Kawahito, T. Yasue, H. Komatsu, and T. Nakatani. A study of devirtualization techniques for a Java Just-In-Time compiler. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Oct. 2000.

    Google Scholar 

  19. C. Krintz, D. Grove, D. Lieber, V. Sarkar, and B. Calder. Reducing the overhead of dynamic compilation. Software-Practice and Experience, 31(8):717–738, Dec. 2000.

    Google Scholar 

  20. S. Liang and G. Bracha. Dynamic class loading in the Java virtual machine. In Conference on Object-oriented programming, systems, languages, and applications (OOPSLA’ 98), pages 36–44, 1998.

    Google Scholar 

  21. M. Paleczny, C. Vic, and C. Click. The Java Hotspot(tm) server compiler. In USENIX Java Virtual Machine Research and Technology Symposium, 2001.

    Google Scholar 

  22. I. Pechtchanski and V. Sarkar. Dynamic optimistic whole program analysis: a framework and an application. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Oct. 2001.

    Google Scholar 

  23. V. C. Sreedhar, M. Burke, and J.-D. Choi. A framework for interprocedural optimization in the presence of dynamic class loading. In SIGPLAN 2000 Conference on Programming Language Design and Implementation, June 2000.

    Google Scholar 

  24. T. Suganuma, T. Yasue, M. Kawahito, H. Komatsu, and T. Nakatani. A dynamic optimization framework for a Java just-in-time compiler. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Oct. 2001.

    Google Scholar 

  25. M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems, 13(2):181–210, 1991.

    Article  Google Scholar 

  26. A. Zaks, V. Feldman, and N. Aizikowitz. Sealed calls in Java packages. In Conference on Object-oriented programming, systems, languages, and applications (OOP-SLA’00), pages 83–92, 2000.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Arnold, M., Ryder, B.G. (2002). Thin Guards: A Simple and Effective Technique for Reducing the Penalty of Dynamic Class Loading. In: Magnusson, B. (eds) ECOOP 2002 — Object-Oriented Programming. ECOOP 2002. Lecture Notes in Computer Science, vol 2374. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-47993-7_21

Download citation

  • DOI: https://doi.org/10.1007/3-540-47993-7_21

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43759-8

  • Online ISBN: 978-3-540-47993-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics