[pr/110] RFR: 8317812: [Lilliput] Make C2 LoadNKlassCompactHeader more robust

Roman Kennke rkennke at openjdk.org
Tue Oct 10 20:32:04 UTC 2023


On Tue, 10 Oct 2023 19:09:20 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/cpu/x86/x86_64.ad line 5336:
>> 
>>> 5334:   format %{ "movl    $dst, $mem\t# compressed klass ptr" %}
>>> 5335:   ins_encode %{
>>> 5336:     Register index = $mem$$index != 4 ? $mem$$index$$Register : noreg;
>> 
>> I don't understand what`$mem$$index != 4` is supposed to check. Can't we just pass the whole register to `load_nklass_compact_c2`? Is it already `noreg` when index is not set?
>
> Or is unset index `-1`, not `4`?

For some reason, in x86 C2, register index 4 is 'no' register. Similar checks are used elsewhere, e.g. in encode_RegMem in x86_64.ad, line 643. Not sure how to make that better.

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

PR Review Comment: https://git.openjdk.org/lilliput/pull/111#discussion_r1353209048


More information about the lilliput-dev mailing list