RFR (XS): 8023472: C2 optimization breaks with G1
vladimir.kozlov at oracle.com
Wed Aug 21 15:18:16 PDT 2013
The load of previous value in G1 pre-barrier code (method
GraphKit::g1_write_barrier_pre()) does not have control. It is from the
time when G1 code was merged into Hotspot sources. I can only speculate
that it was done to allow commoning with a preceding normal load if it
exists and to avoid generation of 2 loads.
This problem, I think, only affects loads from an array because a load
from a field should be guarded by NULL check of object.
The fix is to put control on this load to always generate it after if
(marking) check. I doubt it affect performance much. If there was load
before the value should be in cache.
Added regression test.
More information about the hotspot-compiler-dev