Speculative improvements to verifiable bounds check elimination

  • Authors:
  • Andreas Gampe;Jeffery von Ronne;David Niedzielski;Kleanthis Psarris

  • Affiliations:
  • University of Texas at San Antonio, San Antonio, Texas;University of Texas at San Antonio, San Antonio, Texas;University of Texas at San Antonio, San Antonio, Texas;University of Texas at San Antonio, San Antonio, Texas

  • Venue:
  • Proceedings of the 6th international symposium on Principles and practice of programming in Java
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

As a safety measure, the Java programming language requires bounds checking of array accesses. This usually translates to dynamic checks each time an array element is accessed. Static analysis can help eliminate some of those checks by proving them to be redundant, reducing the runtime overhead. Compilation of Java programs is usually method-based, and dynamic dispatch complicates interprocedural analysis. The result is a severely restricted static analysis. This paper presents a novel combination of two techniques to alleviate this problem. By assuming constraints that cannot safely be inferred from the program, the amount of provable safe bounds can be greatly extended. These constraints, called speculations, can be derived automatically from the program code by an analyzer, which assumes that there will be no violation of the array bounds. To ensure that the speculations hold at runtime, additional checks have to be injected into the code. Finding good speculations that benefit the runtime performance can be expensive. This paper shows that the speculation technique can be combined with a verifiable annotation framework, allowing most of the work to be shifted to compile-time. Experimental results show that this combination of techniques increases the number of eliminated bounds checks and can result in speedups that approach unconditional bounds check removal.