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.
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
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.
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.
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.
M. Arnold. Online instrumentation and feedback-directed optimization of Java. Technical Report DCS-TR-469, Department of Computer Science, Rutgers University, 2001.
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.
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).
C. Chambers. The Design and Implementation of the SELF Compiler, an Optimizing Comiler for Object-Oriented Programming Languages. PhD thesis, Stanford University, 1992.
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.
T. S. P. E. Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98/, 1998.
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.
D. Detlefs and O. Agesen. Inlining of virtual methods. In 13th European Conference on Object-Oriented Programming, 1999.
K. Driesen and U. Hoelzle. Minimizing row displacement dispatch tables. ACM SIGPLAN Notices, 30(10):141–155, Oct. 1995.
M. Fernandez. Simple and effective link-time optimizations of modula-3 programs. In SIGPLAN’ 95 Conference on Programming Language Design and Implementation, 1995.
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.
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.
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.
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.
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.
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.
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.
M. Paleczny, C. Vic, and C. Click. The Java Hotspot(tm) server compiler. In USENIX Java Virtual Machine Research and Technology Symposium, 2001.
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.
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.
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.
M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems, 13(2):181–210, 1991.
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.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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