RFR: 8267947: CI: Preserve consistency between has_subklass() and is_subclass_of()
Tobias Hartmann
thartmann at openjdk.java.net
Tue Jun 1 07:43:18 UTC 2021
On Mon, 31 May 2021 08:54:03 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> CI caches `Klass::subklass() != NULL` query, but concurrent class loading can
> invalidate the cached value. Though recorded dependency won't let the nmethod
> to be installed, the inconcistency can manifest as type paradoxes until
> compilation is finished.
>
> The fix caches only `true` value (since it can't change unless class unloading
> takes place) and queries the VM otherwise.
>
> Testing:
> - [x] hs-tier1 - hs-tier6
src/hotspot/share/ci/ciInstanceKlass.hpp line 155:
> 153: bool has_subklass() {
> 154: assert(is_loaded(), "must be loaded");
> 155: if (_has_subklass == subklass_true) {
A comment explaining why we only cache `subklass_true` would be good. Also, do we still need a tri-state including `subklass_unknown`? It's now only used for initialization but not queried anywhere.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4269
More information about the hotspot-compiler-dev
mailing list