A Verifiable, Control Flow Aware Constraint Analyzer for Bounds Check Elimination

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

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

  • Venue:
  • SAS '09 Proceedings of the 16th International Symposium on Static Analysis
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.