A Verifiable, Control Flow Aware Constraint Analyzer for Bounds Check Elimination
- Cite this paper as:
- Niedzielski D., von Ronne J., Gampe A., Psarris K. (2009) A Verifiable, Control Flow Aware Constraint Analyzer for Bounds Check Elimination. In: Palsberg J., Su Z. (eds) Static Analysis. SAS 2009. Lecture Notes in Computer Science, vol 5673. Springer, Berlin, Heidelberg
The Java platform requires that out-of-bounds array accesses produce runtime exceptions. In general, this requires a dynamic bounds check each time an array element is accessed. However, if it can be proven that the array index is within the bounds of the array, the check can be eliminated. We present a new algorithm based on extended Static Single Assignment (eSSA) form that builds a constraint system representing control flow qualified, linear constraints among program variables derived from program statements. Our system then derives relationships among variables, and provides a verifiable proof of its conclusions. This proof can be verified by a runtime system to minimize the analysis’s performance impact. Our system simultaneously considers both control flow and data flow when analyzing the constraint system, handles general linear inequalities instead of simple difference constraints, and provides verifiable proofs for its claims. We present experimental results demonstrating that this method eliminates more bounds checks, and when combined with runtime verification, results in a lower runtime cost than prior work. Our algorithm improves benchmark performance by up to nearly 10% over the baseline SafeTSA system.
Unable to display preview. Download preview PDF.