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

  • David Niedzielski
  • Jeffery von Ronne
  • Andreas Gampe
  • Kleanthis Psarris
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5673)


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.


Virtual Machine Program Constraint Constraint System Conditional Branch Array Access 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Amme, W., von Ronne, J., Franz, M.: Ssa-based mobile code: Implementation and empirical evaluation. ACM Trans. Archit. Code Optim. 4(2), Article 13 (2007)Google Scholar
  2. 2.
    Besson, F., Jensen, T., Pichardie, D.: Proof-carrying code from certified abstract interpretation and fixpoint compression. Theoretical Computer Science 364(3), 273–291 (2006); Applied SemanticsMathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Blume, W., Eigenmann, R.: Demand-driven, symbolic range propagation. In: Huang, C.-H., Sadayappan, P., Banerjee, U., Gelernter, D., Nicolau, A., Padua, D.A. (eds.) LCPC 1995. LNCS, vol. 1033, pp. 141–160. Springer, Heidelberg (1996)CrossRefGoogle Scholar
  4. 4.
    Bodík, R., Gupta, R., Sarkar, V.: Abcd: eliminating array bounds checks on demand. In: PLDI 2000: Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation, pp. 321–333. ACM Press, New York (2000)CrossRefGoogle Scholar
  5. 5.
    Bull, J.M., Smith, L.A., Westhead, M.D., Henty, D.S., Davey, R.A.: A benchmark suite for high performance Java. Concurrency: Practice and Experience 12(6), 375–388 (2000)CrossRefGoogle Scholar
  6. 6.
    Burke, M.G., Choi, J.-D., Fink, S., Grove, D., Hind, M., Sarkar, V., Serrano, M.J., Sreedhar, V.C., Srinivasan, H., Whaley, J.: The jalapeño dynamic optimizing compiler for java. In: JAVA 1999: Proceedings of the ACM 1999 conference on Java Grande, pp. 129–141. ACM, New York (1999)CrossRefGoogle Scholar
  7. 7.
    Chen, G., Kandemir, M.: Verifiable annotations for embedded java environments. In: CASES 2005: Proceedings of the 2005 international conference on Compilers, architectures and synthesis for embedded systems, pp. 105–114. ACM Press, New York (2005)Google Scholar
  8. 8.
    Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: POPL 1977: Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pp. 238–252. ACM, New York (1977)Google Scholar
  9. 9.
    Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: POPL 1978: Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pp. 84–96. ACM Press, New York (1978)Google Scholar
  10. 10.
    Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems (TOPLAS) 13(4), 451–490 (1991)CrossRefGoogle Scholar
  11. 11.
    Gampe, A., von Ronne, J., Niedzielski, D., Psarris, K.: Speculative improvements to verifiable bounds check elimination. In: Proceedings of the International Conference on Principles and Practice of Programming In Java (PPPJ 2008). ACM Press, New York (2008)Google Scholar
  12. 12.
    Menon, V.S., Glew, N., Murphy, B.R., McCreight, A., Shpeisman, T., Adl-Tabatabai, A.-R., Petersen, L.: A verifiable ssa program representation for aggressive compiler optimization. In: POPL 2006: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 397–408. ACM Press, New York (2006)CrossRefGoogle Scholar
  13. 13.
    Moreira, J.E., Midkiff, S.P., Gupta, M.: From flop to megaflops: Java for technical computing. ACM Trans. Program. Lang. Syst. 22(2), 265–295 (2000)CrossRefGoogle Scholar
  14. 14.
    Qian, F., Hendren, L.J., Verbrugge, C.: A comprehensive approach to array bounds check elimination for java. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, pp. 325–342. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  15. 15.
    Schrijver, A.: Theory of Linear and Integer Programming. Wiley and Sons, Chichester (1986)zbMATHGoogle Scholar
  16. 16.
    von Ronne, J., Gampe, A., Niedzielski, D., Psarris, K.: Safe bounds check annotations. Concurrency and Computations: Practice and Experience (2008), doi:10.1002/cpe.1341Google Scholar
  17. 17.
    Würthinger, T., Wimmer, C., Mössenböck, H.: Array bounds check elimination for the java hotspot client compiler. In: PPPJ 2007: Proceedings of the 5th international symposium on Principles and practice of programming in Java, pp. 125–133. ACM, New York (2007)Google Scholar
  18. 18.
    Zhao, J., Rogers, I., Kirkham, C., Watson, I.: Loop parallelisation for the jikes rvm. In: Proceedings of the Sixth International Conference on Parallel and Distributed Computing (PDCAT 2005), pp. 35–39. IEEE Computer Society Press, Los Alamitos (2005)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • David Niedzielski
    • 1
  • Jeffery von Ronne
    • 1
  • Andreas Gampe
    • 1
  • Kleanthis Psarris
    • 1
  1. 1.The University of TexasSan Antonio

Personalised recommendations