RFR: 8267947: CI: Preserve consistency between has_subklass() and is_subclass_of() [v2]

Vladimir Ivanov vlivanov at openjdk.java.net
Tue Jun 1 10:24:38 UTC 2021


On Tue, 1 Jun 2021 07:39:56 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Vladimir Ivanov has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Refactor asserts
>>  - Improve comment
>
> 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.

Comment added.

Regarding `subclass_false` and `subklass_unknown`, keeping tri-state enum looks benign. Also, it makes sense to keep `subklass_unknown` to be able to distinguish between not yet initialized and already initialized cases (at least, during debugging).

-------------

PR: https://git.openjdk.java.net/jdk/pull/4269


More information about the hotspot-compiler-dev mailing list