Details
-
Enhancement
-
Resolution: Unresolved
-
P4
-
9, 10
Description
Current intrinsic code in C1 optimizes Class.isInstance (and Class.cast, transitively) quite well, but it misses an opportunity in optimizing for Object.class case.
Benchmark:
http://cr.openjdk.java.net/~shade/8135033/ClassCastConstants.java
-XX:TieredStopAtLevel=1:
myClass_inlined 3.766 ± 0.021 ns/op
myClass_staticFinal 3.763 ± 0.002 ns/op
object_inlined 3.086 ± 0.001 ns/op
object_staticFinal 3.106 ± 0.038 ns/op
The disassembly for object_* tests show the redundant compare against Object.class.
Benchmark:
http://cr.openjdk.java.net/~shade/8135033/ClassCastConstants.java
-XX:TieredStopAtLevel=1:
myClass_inlined 3.766 ± 0.021 ns/op
myClass_staticFinal 3.763 ± 0.002 ns/op
object_inlined 3.086 ± 0.001 ns/op
object_staticFinal 3.106 ± 0.038 ns/op
The disassembly for object_* tests show the redundant compare against Object.class.
Attachments
Issue Links
- relates to
-
JDK-8130923 C1 trouble in VarHandle.getObject tests
-
- Resolved
-