-
Enhancement
-
Resolution: Fixed
-
P4
-
9
-
b77
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8135635 | emb-9 | Aleksey Shipilev | P4 | Resolved | Fixed | team |
JDK-8149241 | 8u101 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
JDK-8145831 | 8u92 | Aleksey Shipilev | P4 | Resolved | Fixed | b02 |
JDK-8155337 | emb-8u101 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
This is observed in VarHandles work for JDK-8130923.
The reason is that C1 canonicalizer seems to assume a particular constant shape (InstanceConstant), while the Class instances coming through @Stable/static-final seem to be ObjectConstants. Accepting ObjectConstants as well fixes it:
http://cr.openjdk.java.net/~shade/8131782/webrev.01/
Simple benchmark articulates it clearly:
http://cr.openjdk.java.net/~shade/8131782/ClassCastConstants.java
(Runnable JAR: http://cr.openjdk.java.net/~shade/8131782/benchmarks.jar)
Baseline result calls into Runtime::isInstance in "static final" case, experiencing the 2x hit:
http://cr.openjdk.java.net/~shade/8131782/baseline.perfasm
Patched VM behaves perfectly well in both cases:
http://cr.openjdk.java.net/~shade/8131782/patched.perfasm
The reason is that C1 canonicalizer seems to assume a particular constant shape (InstanceConstant), while the Class instances coming through @Stable/static-final seem to be ObjectConstants. Accepting ObjectConstants as well fixes it:
http://cr.openjdk.java.net/~shade/8131782/webrev.01/
Simple benchmark articulates it clearly:
http://cr.openjdk.java.net/~shade/8131782/ClassCastConstants.java
(Runnable JAR: http://cr.openjdk.java.net/~shade/8131782/benchmarks.jar)
Baseline result calls into Runtime::isInstance in "static final" case, experiencing the 2x hit:
http://cr.openjdk.java.net/~shade/8131782/baseline.perfasm
Patched VM behaves perfectly well in both cases:
http://cr.openjdk.java.net/~shade/8131782/patched.perfasm
- backported by
-
JDK-8135635 C1 Class.cast optimization breaks when Class is loaded from static final
-
- Resolved
-
-
JDK-8145831 C1 Class.cast optimization breaks when Class is loaded from static final
-
- Resolved
-
-
JDK-8149241 C1 Class.cast optimization breaks when Class is loaded from static final
-
- Resolved
-
-
JDK-8155337 C1 Class.cast optimization breaks when Class is loaded from static final
-
- Resolved
-
- blocks
-
JDK-8130923 C1 trouble in VarHandle.getObject tests
-
- Resolved
-
- relates to
-
JDK-8130923 C1 trouble in VarHandle.getObject tests
-
- Resolved
-
(1 relates to)