Abstract
We discuss aspects of inlining of virtual method invocations. First, we introduce a new method test to guard inlinings of such invocations, with a different set of tradeoffs from the class-equality tests proposed previously in the literature. Second, we consider the problem of inlining virtual methods directly, with no guarding test, in dynamic languages such as Self or the Java™ programming language, whose semantics prohibit a static identification of the complete set of modules that comprise a program. In non-dynamic languages, a whole-program analysis might prove the correctness of a direct virtual inlining. In dynamic languages, however, such analyses can be invalidated by later class loading, and must therefore be treated as assumptions whose later violation must cause recompilation. In the past, such systems have required an on-stack replacement mechanism to update currently-executing invocations of methods containing invalidated inlinings. This paper presents analyses that allow some virtual calls to be inlined directly, while ensuring that invocations in progress may complete safely even if class loading invalidates the inlining for future invocations. This provides the benefits of direct inlining without the need for on-stack replacement, which can be complicated and require space-consuming data structures.
★
Sun, Sun Microsystems, Java, and HotJava are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the United States and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc.
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
Craig Chambers, David Grove, Greg DeFouw, and Jeffrey Dean. Call graph construction in object-oriented languages. ACM SIGPLAN Notices, 32(10):108–124, October 1997.
Craig Chambers and David Ungar. Customization: Optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language. In Bruce Knobe, editor, Proceedings of the SIGPLAN 1989 Conference on Programming Language Design and Implementation, pages 146–160, Portland, OR, USA, June 1989. ACM Press.
Ole-Johan Dahl, Bjørn Myrhaug, and Kristen Nygaard. Simula common base language. Technical Report S-22, Norwegian Computing Center, Oslo, Norway, 1970.
Jeffrey Dean. Whole-Program Optimization of Object-Oriented Languages. PhD thesis, University of Washington, Seattle, Washington, 1996.
Jeffrey Dean, Craig Chambers, and David Grove. Selective specialization for object-oriented languages. ACM SIGPLAN Notices, 30(6):93–102, June 1995.
Jeffrey Dean, Greg DeFouw, David Grove, Vassily Livinov, and Craig Chambers. Vortex: an optimizing compiler for object-oriented languages. ACM SIGPLAN Notices, 31(10):83–100, October 1996.
Jeffrey Dean, David Grove, and Craig Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In Walter G. Olthoff, editor, Proceedings of the Ninth European Conference on Object-Oriented Programming, volume 952 of Lecture Notes in Computer Science, pages 77–101, Århus, Denmark, 7–11 August 1995. Springer-Verlag.
L. Peter Deutsch and Allan Schiffman. Effcient implementation of a Smalltalk-80 system. In Proceedings of the 11th Symposium on the Principles of Programming Languages, pages 297–302, Salt Lake City, 1984. ACM SIGPLAN.
Amer Diwan, J. Eliot B. Moss, and Kathryn S. McKinley. Simple and effective analysis of statically-typed object-oriented programs. In Proceedings of the 1996 Conference on Object-Oriented Programs, Systems, Languages, and Applications, pages 292–305. ACM SIGPLAN, October 1996.
Karel Driesen and Urs Hölzle. Accurate indirect branch prediction. In Proceedings of the 25th Annual International Symposium on Computer Architecture (ISCA-98), volume 26,3 of ACM Computer Architecture News, pages 167–178, New York, June 27–July 1 1998. ACM Press.
Neal Feinberg, Sonya E. Keene, Robert O. Mathews, and P. Tucker Withington. The Dylan Programming Book. Addison-Wesley Longman, Reading, Mass., 1997.
Mary F. Fernandez. Simple and effective link-time optimization of Modula-3 programs. ACM SIGPLAN Notices, 30(6):103–115, June 1995.
Richard Gabriel, Jon White, and Daniel Bobrow. CLOS: Integrating objectoriented and functional programming. CACM: Communications of the ACM, 34, 1991.
Adele Goldberg and David Robson. Smalltalk-80: The Language and its Implementation. Addison-Wesley, Reading, MA, 1983.
James Gosling, Bill Joy, and Guy Steele. The JavaTM Language Specification. The Java Series. Addison-Wesley, 1.0 edition, August 1996.
Urs Hölzle. Adaptive optimization for SELF: Reconciling high performance with exploratory programming. Ph.D. Thesis CS-TR-94-1520, Stanford University, Department of Computer Science, August 1994.
Urs Hölzle, Craig Chambers, and David Ungar. Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In P. America, editor, Proceedings of the 1991 European Conference on Object-oriented Programming, LNCS 512, pages 21–38, Geneva, Switzerland, July 1991. Springer-Verlag.
Urs Hölzle, Craig Chambers, and David Ungar. Debugging optimized code with dynamic deoptimization. In Christopher W. Fraser, editor, Proceedings of the ACM SIGPLAN’ 92 Conference on Programming Language Design and Implementation, pages 32–43, San Francisco, CA, June 1992. ACM Press.
Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. The Java Series. Addison-Wesley, 1996.
Volano LLC. Volanomark benchmark. http://www.volano.com/benchmarks.html, Mar. 1999.
Bertrand Meyer. Eiffel: The Language. Prentice Hall, 1992.
Greg Nelson, editor. Systems Programming in Modula-3. Prentice-Hall, Englewood Cliffs, NJ, 1991.
John Plevyak and Andrew A. Chien. Precise concrete type inference for objectoriented languages. In Proceedings of the Ninth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 324–324, October 1994.
Craig Schaffert, Topher Cooper, and Carrie Wilpolt. Trellis object-based environment language reference manual. DEC-TR 372, Digital Equipment Corp., Object-Based Systems Group, Hudson, Massachusetts, Nov. 1985.
SPEC. SPECjvm98 benchmarks. http://www.spec.org/osg/jvm98, August 1998.
Bjarne Stroustrup. The C++ Programming Language: Second Edition. Addison-Wesley, Reading, Massachusetts, 1991.
Jan Vitek, Nigel R. Horspool, and Andreas Krall. Effiient type inclusion tests. In Proceedings of the 1997 Conference on Object-Oriented Programming Systems, Languages, and Applications, Atlanta, GA, October 1997. ACM Press.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Detlefs, D., Agesen, O. (1999). Inlining of Virtual Methods. In: Guerraoui, R. (eds) ECOOP’ 99 — Object-Oriented Programming. ECOOP 1999. Lecture Notes in Computer Science, vol 1628. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48743-3_12
Download citation
DOI: https://doi.org/10.1007/3-540-48743-3_12
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66156-6
Online ISBN: 978-3-540-48743-2
eBook Packages: Springer Book Archive