Research Article
Elimination of Java array bounds checks in the presence of indirection
Article first published online: 22 FEB 2005
DOI: 10.1002/cpe.847
Copyright © 2005 John Wiley & Sons, Ltd.
Issue
1532-0634/asset/cover.gif?v=1&s=6094df24c795ce080ff6df6ff3b6bcec19adb708)
Concurrency and Computation: Practice and Experience
Special Issue: 2002 ACM Java Grande–ISCOPE Conference Part I
Volume 17, Issue 5-6, pages 489–514, April - May 2005
Additional Information
How to Cite
Luján, M., Gurd, J. R., Freeman, T. L. and Miguel, J. (2005), Elimination of Java array bounds checks in the presence of indirection. Concurrency Computat.: Pract. Exper., 17: 489–514. doi: 10.1002/cpe.847
Publication History
- Issue published online: 22 FEB 2005
- Article first published online: 22 FEB 2005
- Manuscript Accepted: 14 OCT 2003
- Manuscript Revised: 1 SEP 2003
- Manuscript Received: 15 JAN 2003
Funded by
- Postdoctoral Fellowship from the Department of Education, Universities and Research of the Basque Government
- Spanish MCYT. Grant Number: TIC2001-0591-C02-02
- Abstract
- References
- Cited By
Keywords:
- array bounds check;
- Java;
- array indirection
Abstract
The Java language specification states that every access to an array needs to be within the bounds of that array, i.e. between 0 and array length − 1. Different techniques for different programming languages have been proposed to eliminate explicit bounds checks. Some of these techniques are implemented in off-the-shelf Java Virtual Machines (JVMs). The underlying principle of these techniques is that bounds checks can be removed when a JVM/compiler has enough information to guarantee that a sequence of accesses (e.g. inside a for-loop) is safe (within the bounds). Most of the techniques for the elimination of array bounds checks have been developed for programming languages that do not support multi-threading and/or enable dynamic class loading. These two characteristics make most of these techniques unsuitable for Java. Techniques developed specifically for Java have not addressed the elimination of array bounds checks in the presence of indirection; that is, when the index is stored in another array (indirection array). With the objective of optimizing applications with array indirection, this paper proposes and evaluates three implementation strategies, each implemented as a Java class. The classes provide the functionality of Java arrays of type int so that objects of the classes can be used instead of indirection arrays. Each strategy enables JVMs, when examining only one of these classes at a time, to obtain enough information to remove array bounds checks. Copyright © 2005 John Wiley & Sons, Ltd.

1532-0634/asset/olbannerleft.gif?v=1&s=a4e4e145787de94e1d91eaab3c8c29d8a9d96a26)