[13] RFR (XS): 8225141: Better handling of classes in error state in fast class initialization checks

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Fri May 31 20:53:35 UTC 2019


Fast class initialization checks don't properly handle classes in error 
state when performed from (previously) initializing thread.

One way to fix it is to add one more fast path check 
(InstanceKlass::_init_state == being_initialized) into the barrier, but 
that would require significant changes, since both newly introduced 
checks (JDK-8223213 [1]) and existing C1 checks should be changed.

What I propose is to set InstanceKlass::_init_thread only for the 
duration when the klass is in being_initialized state and reset it back 
to NULL when changing class state. It makes existing "_init_thread == 
current_thread" check equivalent to "_init_state == being_initialized && 
_init_thread == current_thread".

Testing: hs-precheckin-comp, tier1-4

Best regards,
Vladimir Ivanov

[1] https://bugs.openjdk.java.net/browse/JDK-8223213

More information about the hotspot-compiler-dev mailing list