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.
Supported in part by AFRL grant F30602-02-1-001, and NSF grants EIA-0117255 and CCF-0702527.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
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 Semantics
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
Schrijver, A.: Theory of Linear and Integer Programming. Wiley and Sons, Chichester (1986)
von Ronne, J., Gampe, A., Niedzielski, D., Psarris, K.: Safe bounds check annotations. Concurrency and Computations: Practice and Experience (2008), doi:10.1002/cpe.1341
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
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. https://doi.org/10.1007/978-3-642-03237-0_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-03237-0_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-03236-3
Online ISBN: 978-3-642-03237-0
eBook Packages: Computer ScienceComputer Science (R0)