Skip to main content

Inlining of Virtual Methods

  • Conference paper
  • First Online:
ECOOP’ 99 — Object-Oriented Programming (ECOOP 1999)

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

Included in the following conference series:

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.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

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

    Article  Google Scholar 

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

    Google Scholar 

  3. Ole-Johan Dahl, Bjørn Myrhaug, and Kristen Nygaard. Simula common base language. Technical Report S-22, Norwegian Computing Center, Oslo, Norway, 1970.

    Google Scholar 

  4. Jeffrey Dean. Whole-Program Optimization of Object-Oriented Languages. PhD thesis, University of Washington, Seattle, Washington, 1996.

    Google Scholar 

  5. Jeffrey Dean, Craig Chambers, and David Grove. Selective specialization for object-oriented languages. ACM SIGPLAN Notices, 30(6):93–102, June 1995.

    Article  Google Scholar 

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

    Article  Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  11. Neal Feinberg, Sonya E. Keene, Robert O. Mathews, and P. Tucker Withington. The Dylan Programming Book. Addison-Wesley Longman, Reading, Mass., 1997.

    Google Scholar 

  12. Mary F. Fernandez. Simple and effective link-time optimization of Modula-3 programs. ACM SIGPLAN Notices, 30(6):103–115, June 1995.

    Article  Google Scholar 

  13. Richard Gabriel, Jon White, and Daniel Bobrow. CLOS: Integrating objectoriented and functional programming. CACM: Communications of the ACM, 34, 1991.

    Google Scholar 

  14. Adele Goldberg and David Robson. Smalltalk-80: The Language and its Implementation. Addison-Wesley, Reading, MA, 1983.

    MATH  Google Scholar 

  15. James Gosling, Bill Joy, and Guy Steele. The JavaTM Language Specification. The Java Series. Addison-Wesley, 1.0 edition, August 1996.

    Google Scholar 

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

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Google Scholar 

  19. Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. The Java Series. Addison-Wesley, 1996.

    Google Scholar 

  20. Volano LLC. Volanomark benchmark. http://www.volano.com/benchmarks.html, Mar. 1999.

  21. Bertrand Meyer. Eiffel: The Language. Prentice Hall, 1992.

    Google Scholar 

  22. Greg Nelson, editor. Systems Programming in Modula-3. Prentice-Hall, Englewood Cliffs, NJ, 1991.

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  25. SPEC. SPECjvm98 benchmarks. http://www.spec.org/osg/jvm98, August 1998.

  26. Bjarne Stroustrup. The C++ Programming Language: Second Edition. Addison-Wesley, Reading, Massachusetts, 1991.

    Google Scholar 

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

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics