Consider adding VM annotation to mark methods without any side effects except those needed to compute the return value (Integer.valueOf() is a good example.)
Relevant discussion:
https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2019-February/032638.html
Relevant discussion:
https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2019-February/032638.html
- relates to
-
JDK-8347901 C2 should remove unused leaf / pure runtime calls
-
- Open
-
-
JDK-6440430 C2 does not optimize away pointless calls to nanoTime, currentTimeMillis
-
- Closed
-