RFR(XS): 8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland.westrelin at oracle.com
Tue Feb 10 09:07:59 UTC 2015
> Some ciInstanceKlass objects are shared between compiler threads so has_injected_fields() can be called on the same ciInstanceKlass concurrently by multiple threads and cause a concurrent initialization of the _has_injected_fields. In itself it’s armless (all threads will get the same result, the _has_inkected_fields will be set correctly) but it causes an assert to fire. The assert is pretty useless so I removed it.
I was wrong. It’s not good enough to remove the assert. _has_injected_fields is set to 0 before it’s incremented so there’s a small window of time when some other thread can see 0 and assume there’s no injected fields. Here is a new webrev:
_has_injected_fields is only set once it’s final value is known. So other threads may either see -1 and compute the final value on their own or a non -1 value and have the final value.
More information about the hotspot-compiler-dev