Type-Safe Method Inlining

  • Authors:
  • Neal Glew;Jens Palsberg

  • Affiliations:
  • -;-

  • Venue:
  • ECOOP '02 Proceedings of the 16th European Conference on Object-Oriented Programming
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

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.