[13] RFR (S): 8075052: Autobox elimination hinders loop unrolling

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Sat Feb 2 03:19:18 UTC 2019


C2 doesn't optimize Integer.valueOf() as good as new Integer().
(There's a benchmark in the bug which demonstrates the difference.)

It is caused by the fact that though Integer.intValue() can see through 
the call, the call itself isn't optimized away if the result (box) is 
not used. It is unconditionally inlined and hinders consequent 

Proposed fix is to treat Integer.valueOf() as if it were a pure method 
and remove the call if its result (boxed value) isn't used.

Testing: hs-precheckin-comp, tier1-7 (in progress)

Best regards,
Vladimir Ivanov

More information about the hotspot-compiler-dev mailing list