RFR: 8361211: C2: Final graph reshaping generates unencodeable klass constants [v2]

Aleksey Shipilev shade at openjdk.org
Tue Aug 5 10:25:46 UTC 2025


On Mon, 4 Aug 2025 22:07:12 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> src/hotspot/share/opto/compile.cpp line 3663:
>> 
>>> 3661:         n->subsume_by(ConNode::make(t->make_narrowoop()), this);
>>> 3662:       } else if (t->isa_klassptr()) {
>>> 3663:         ciKlass* klass = t->is_klassptr()->exact_klass();
>> 
>> This branch means that we are trying to compress a pointer that cannot be compressed. This seems wrong either way.
>
> I agree with @merykitty and @TheRealMDoerr. The code is wrong before and after. We should add an assert + compilation bailout in product or a guarantee.

All right, I agree with all three of you. New commit adds the assert and bailout when we detect that we are encounter the unencodable class in this `ConP` -> `EncodeP` path. Does that make more sense to you?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26559#discussion_r2253903082


More information about the hotspot-compiler-dev mailing list