Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8082623 | emb-9 | Roland Westrelin | P3 | Resolved | Fixed | team |
Description
Consider the following code:
static void setVolatile(ArrayRefHandle handle, Object[] array, int index,
Object value) {
if (index < 0 || index >= array.length) // bounds and null check
throw new ArrayIndexOutOfBoundsException();
UNSAFE.putObjectVolatile(array,
(((long) index) << handle.ashift) + handle.abase,
castReference(handle.componentType, value));
}
For such a user written range test the compiler does fully recognize an array access is going on and so certain optimizations tend not to kick in, such as removing or strength reducing range checks, treating "index" as an unsigned value as opposed to a signed value, or coalescing write barriers when loop unrolling.
Attachments
Issue Links
- backported by
-
JDK-8082623 C2 should optimize explicit range checks
- Resolved
- relates to
-
JDK-8075663 compiler/rangechecks/TestExplicitRangeChecks.java fails in compiler nightlies
- Resolved
-
JDK-8135069 C2 replaces range checks by unsigned comparison with -1
- Resolved
-
JDK-8261912 Code IfNode::fold_compares_helper more defensively
- Closed
-
JDK-8261914 IfNode::fold_compares_helper faces non-canonicalized bool when running JRuby JSON workload
- Closed
-
JDK-8325443 C2 misses fold_compare opportunity in loops
- Open
-
JDK-8042997 Make intrinsic some or all check index/range methods
- Resolved
-
JDK-8206932 Add utility methods to check machine word indexes and ranges
- New
-
JDK-8081823 C2 performs unsigned comparison against -1
- Resolved
-
JDK-8140574 C2 must re-execute checks after deoptimizing from merged uncommon traps
- Closed
-
JDK-8080976 Unexpected AIOOB thrown from 1.9.0-ea-b64 on (regression)
- Closed
-
JDK-8329101 Add IR checks to TestExplicitRangeChecks.java
- Open
-
JDK-8074383 Redundant "compare" in generated code for String.charAt bounds checks
- Resolved