RFR(XS): 8071821: Assert failed in UnexpectedDeoptimizationTest.java
Roland Westrelin
roland.westrelin at oracle.com
Tue Feb 10 09:07:59 UTC 2015
> http://cr.openjdk.java.net/~roland/8071821/webrev.00/
>
> 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:
http://cr.openjdk.java.net/~roland/8071821/webrev.01/
_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.
Roland.
More information about the hotspot-compiler-dev
mailing list