RFR: 8328480: C2: SubTypeCheckNode in checkcast should use the klass constant of a unique concrete sub class [v2]
Christian Hagedorn
chagedorn at openjdk.org
Thu Apr 4 15:15:11 UTC 2024
On Wed, 3 Apr 2024 14:32:38 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>>> Should we go back to the previously suggested version without CastPP?
>>
>> Isn't there a risk with that one too? if `superklass` is a `TypeNode` and its input changes to a constant for instance.
>
> If doing this in `GraphKit` doesn't work well, maybe it should be done in `SubTypeCheckNode::Value`? This way it would apply all all stages of compilation? (That assumes we don't care of what happens if `ExpandSubTypeCheckAtParseTime` is true).
> > Should we go back to the previously suggested version without CastPP?
>
> Isn't there a risk with that one too? if `superklass` is a `TypeNode` and its input changes to a constant for instance.
I'm afraid you're right. This could probably happen, too.
> If doing this in `GraphKit` doesn't work well, maybe it should be done in `SubTypeCheckNode::Value`? This way it would apply all all stages of compilation? (That assumes we don't care of what happens if `ExpandSubTypeCheckAtParseTime` is true).
I've first thought of doing it in `SubTypeCheckNode::Value()` but assumed we can get away with handling it in `GraphKit`. But as now figured out, this comes with new problems and does not seem to be safe. I will try to undo my current fix idea in `GraphKit` and do it in `SubTypeCheckNode::Value()` instead. This should work (not yet sure though what to do with `ExpandSubTypeCheckAtParseTime` and if it's easy to fix - otherwise, we could move forward with the proposal to remove it for good).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18515#discussion_r1551873024
More information about the hotspot-compiler-dev
mailing list