Safe, Multiphase Bounds Check Elimination in Java

Abstract

As part of its type-safety regime, the Java semantics require precise exceptions at runtime when programs attempt out-of-bound array accesses. This paper describes a Java implementation that utilizes a multiphase approach to identifying safe array accesses. This approach reduces runtime overhead by spreading the out-of-bounds checking effort across three phases of compilation and execution production of mobile code from source code, JIT compilation in the virtual machine and application code execution. The code producer uses multiple passes (including common subexpression elimination, load elimination, induction variable substitution, speculation of dynamically-verified invariants, and inequality constraint analysis) to identify and prove redundancy of bounds checks. During class-loading and JIT compilation, the virtual machine verifies the proofs, inserts code to dynamically validate speculated invariants, and generates code specialized under the assumption that the speculated invariants hold. At runtime, the method parameters and other inputs are checked against the speculated invariants and execution reverts to unoptimized code if the speculated invariants do not hold. The combined effect of the multiple phases is to shift the effort associated with bounds-checking array access to phases that are executed earlier and less frequently, thus, reducing runtime overhead. Experimental results show that this approach is able to eliminate more bounds checks than prior approaches with minimal overhead during JIT compilation. These results also show the contribution of each of the passes to the overall elimination. Furthermore, using our multiphase bounds check elimination method increased the speed at which the benchmarks executed by up to 16%.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Jan 28, 2010
Accession Number
ADA546169

Entities

People

  • Andreas Gampe
  • David Niedzielski
  • Jeffery Von Ronne
  • Kleanthis Psarris

Organizations

  • University of Texas at San Antonio

Tags

Communities of Interest

  • C4I
  • Energy and Power Technologies
  • Ground and Sea Platforms

DTIC Thesaurus Topics

  • Algorithms
  • Compilers
  • Computations
  • Computer Programming
  • Computer Programs
  • Computer Science
  • Computers
  • Inequalities
  • Java Programming Language
  • Language
  • Linear Programming
  • Optimization
  • Production
  • Programming Languages
  • Redundancy
  • Semantics
  • Virtual Machines

Fields of Study

  • Computer science
  • Engineering

Readers

  • Applied Combinatorial Optimization and Logic Circuit Design.
  • Computer Programming and Software Development.
  • Database Systems and Applications