Skip to main content

Type-Safe Method Inlining

  • Conference paper
  • First Online:
ECOOP 2002 — Object-Oriented Programming (ECOOP 2002)

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

Included in the following conference series:

Abstract

In a typed language such as Java, inlining of virtual methods does not always preserve typability. The best known solution to this problem is to insert type casts, which may hurt performance. This paper presents a solution that never hurts performance. The solution is based on a transformation that modifies static type annotations and changes some virtual calls into static calls, which can then be safely inlined. The transformation is parameterised by a flow analysis, and for any analysis that satisfies certain conditions, the transformation is correct and idempotent. The paper presents the transformation, the conditions on the flow analysis, and proves the correctness properties; all in the context of a variant of Featherweight Java.

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Lars Ole Andersen. Self-applicable C program specialization. In Proceedings of PEPM’92, Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pages 54–61, June 1992. (Technical Report YALEU/DCS/RR-909, Yale University).

    Google Scholar 

  2. Jeffrey Dean, David Grove, and Craig Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of European Conference on Object-Oriented Programming, pages 77–101, Aarhus, Denmark, August 1995. Springer-Verlag (LNCS 952).

    Chapter  Google Scholar 

  3. David Detlefs and Ole Agesen. Inlining of virtual methods. In Proceedings of ECOOP’99, pages 258–278. Springer-Verlag (LNCS 1628), 1999.

    Google Scholar 

  4. Manuel Fähndrich and Alexander Aiken. Program analysis using mixed term and set constraints. In Proceedings of SAS’97, International Static Analysis Symposium, pages 114–126. Springer-Verlag (LNCS), 1997.

    Chapter  Google Scholar 

  5. Etienne M. Gagnon, Laurie J. Hendren, and Guillaume Marceau. Efficient inference of static types for Java bytecode. In Proceedings of SAS’00, International Static Analysis Symposium, pages 199–219. Springer-Verlag (LNCS 1824), 2000.

    Chapter  Google Scholar 

  6. Neal Glew. An efficient class and object encoding. In Proceedings of OOPSLA’ 00, ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, pages 311–324, Minneapolis, Minnesota, October 2000.

    Google Scholar 

  7. Nevin Heintze. Control-flow analysis and type systems. In Proceedings of SAS’95, International Static Analysis Symposium, pages 189–206. Springer-Verlag (LNCS 983), Glasgow, Scotland, September 1995.

    Chapter  Google Scholar 

  8. Atsushi Igarashi, Benjamion Pierce, and Philip Wadler. Featherweight Java: A minimal core calculus for Java and GJ. In ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 132–146, Denver, CO, USA, October 1999.

    Google Scholar 

  9. Suresh Jagannathan, Andrew Wright, and Stephen Weeks. Type-directed flow analysis for typed intermediate languages. In Proceedings of SAS’97, International Static Analysis Symposium. Springer-Verlag (LNCS), 1997.

    Google Scholar 

  10. Todd Knoblock and Jakob Rehof. Type elaboration and subtype completion for Java Bytecode. ACM Transactions on Programming Languages and Systems, 23(2):243–272, March 2001.

    Google Scholar 

  11. Greg Morrisett, David Tarditi, Perry Cheng, Christopher Stone, Robert Harper, and Peter Lee. The TIL/ML compiler: Performance and safety through types. In ACM SIGPLAN Workshop on Compiler Support for System Software, Tucson, AZ, USA, February 1996.

    Google Scholar 

  12. Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to typed assembly language. ACM Transactions on Progamming Languages and Systems, 21(3):528–569, May 1999.

    Google Scholar 

  13. Flemming Nielson. The typed lambda-calculus with first-class processes. In Proceedings of PARLE, pages 357–373, April 1989.

    Google Scholar 

  14. Jens Palsberg. Closure analysis in constraint form. ACM Transactions on Programming Languages and Systems, 17(1):47–62, January 1995. Preliminary version in Proceedings of CAAP’94, Colloquium on Trees in Algebra and Programming, Springer-Verlag (LNCS 787), pages 276–290, Edinburgh, Scotland, April 1994.

    Google Scholar 

  15. Jens Palsberg. Equality-based flow analysis versus recursive types. ACM Transactions on Programming Languages and Systems, 20(6):1251–1264, 1998.

    Article  Google Scholar 

  16. Jens Palsberg and Patrick M. O’Keefe. A type system equivalent to flow analysis. ACM Transactions on Programming Languages and Systems, 17(4):576–599, July 1995. Preliminary version in Proceedings of POPL’95, 22nd Annual SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 367–378, San Francisco, California, January 1995.

    Google Scholar 

  17. Jens Palsberg and Christina Pavlopoulou. From polyvariant flow information to intersection and union types. Journal of Functional Programming, 11(3):263–317, May 2001. Preliminary version in Proceedings of POPL’98, 25th Annual SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 197–208, San Diego, California, January 1998.

    Google Scholar 

  18. Jens Palsberg and Michael I. Schwartzbach. Object-Oriented Type Systems. John Wiley & Sons, 1994.

    Google Scholar 

  19. David Tarditi, Greg Morrisett, Perry Cheng, Christopher Stone, Robert Harper, and Peter Lee. TIL: A type-directed optimizing compiler for ML. In 1996 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 181–192, Philadelphia, PA, USA, May 1996. ACM Press.

    Google Scholar 

  20. Andrew Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994.

    Article  MathSciNet  MATH  Google Scholar 

  21. Andrew Wright, Suresh Jagannathan, Cristian Ungureanu, and Aaron Hertzmann. Compiling Java to a typed lambda-calculus: A preliminary report. In ACM Workshop on Types in Compilation, Kyoto, Japan, March 1998.

    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

Glew, N., Palsberg, J. (2002). Type-Safe Method Inlining. 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_22

Download citation

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

  • 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