Safe bounds check annotations

The semantics of the Java programming language require that the out‐of‐bounds array accesses be caught at runtime. In general, this requires dynamic checks at the time the array element is accessed. Some of these checks can be eliminated statically during just‐in‐time (JIT) compilation, but the most precise analyses are too expensive to run in JIT compilers. This paper presents a framework in which thorough static range analyses can be used safely during the less‐performance‐critical compilation of Java source into machine‐independent mobile code. In this framework, the static analysis results are used to derive proofs that certain linear inequality constraints hold. These linear constraints and their proofs are then added to the mobile code as annotations. The annotation framework is designed so that proofs can be verified efficiently. This allows the JIT compiler to safely eliminate array bounds checks during compilation without an expensive runtime analysis. Experiments with a prototype system that can generate and verify these annotations demonstrate that this framework is more precise than prior work and that verification is efficient. Copyright © 2008 John Wiley & Sons, Ltd.

[1]  Laurie J. Hendren,et al.  A Comprehensive Approach to Array Bounds Check Elimination for Java , 2002, CC.

[2]  Thomas M. Conte,et al.  Proceedings of the 2005 international conference on Compilers, architectures and synthesis for embedded systems , 2003 .

[3]  Hanspeter Mössenböck,et al.  Array bounds check elimination for the Java HotSpot#8482; client compiler , 2007, PPPJ.

[4]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[5]  Michael Franz,et al.  A portable Virtual Machine target for Proof-Carrying Code , 2003, IVME '03.

[6]  Vivek Sarkar,et al.  ABCD: eliminating array bounds checks on demand , 2000, PLDI '00.

[7]  Martin C. Rinard,et al.  Symbolic bounds analysis of pointers, array indices, and accessed memory regions , 2005, TOPL.

[8]  Mahmut T. Kandemir,et al.  Verifiable annotations for embedded java environments , 2005, CASES '05.

[9]  Andrew McCreight,et al.  A verifiable SSA program representation for aggressive compiler optimization , 2006, POPL '06.

[10]  Jeffery von Ronne,et al.  An Inherently Type-Safe SSA-based Code Format , 2006 .

[11]  Jeffery von Ronne,et al.  SafeTSA: a type safe and referentially secure mobile-code representation based on static single assignment form , 2001, PLDI '01.

[12]  Robert Harper,et al.  A dependently typed assembly language , 2001, ICFP '01.

[13]  George C. Necula,et al.  Compiling with proofs , 1998 .

[14]  François Irigoin,et al.  Efficient and effective array bound checking , 2005, TOPL.

[15]  George C. Necula,et al.  A certifying compiler for Java , 2000, PLDI '00.

[16]  David Gregg,et al.  Proceedings of the 2003 workshop on Interpreters, virtual machines and emulators , 2003 .

[17]  Samuel P. Midkiff,et al.  From flop to megaflops: Java for technical computing , 1998, TOPL.

[18]  Ian Watson,et al.  Loop Parallelisation for the Jikes RVM , 2005, Sixth International Conference on Parallel and Distributed Computing Applications and Technologies (PDCAT'05).

[19]  Martin D. Westhead,et al.  A benchmark suite for high performance Java , 2000, Concurr. Pract. Exp..

[20]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.