RFR: 8348411: C2: Remove the control input of LoadKlassNode and LoadNKlassNode [v4]

Quan Anh Mai qamai at openjdk.org
Tue Feb 4 18:57:10 UTC 2025


On Tue, 4 Feb 2025 18:40:05 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/parseHelper.cpp line 170:
>> 
>>> 168:       !too_many_traps(Deoptimization::Reason_array_check) &&
>>> 169:       !tak->klass_is_exact() &&
>>> 170:       tak->isa_aryklassptr()) {
>> 
>> Looks like an implicit `nullptr` check. Not allowed by code style ;)
>
> Can you quickly explain this change from `tak != TypeInstKlassPtr::OBJECT` so I don't need to investigate myself, please?

> Looks like an implicit nullptr check. Not allowed by code style ;)

But the verb here is `isa` and we use these as a `bool` a lot, though :/

> Can you quickly explain this change from tak != TypeInstKlassPtr::OBJECT so I don't need to investigate myself, please?

The bottom type of an array can be either `Object` or an array of some kind, so `tak != TypeInstKlassPtr::OBJECT` is the same as `tak->isa_aryklassptr()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23274#discussion_r1941732694


More information about the hotspot-compiler-dev mailing list