RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index
Aleksey Shipilev
shade at openjdk.org
Mon Jul 15 11:15:50 UTC 2024
On Mon, 15 Jul 2024 01:45:57 GMT, Chen Liang <liach at openjdk.org> wrote:
> The `@Stable` on the `index` field is incorrect, as stable only avoids inlining `0`. Solution is to use bit flip on the actual index (and rename the field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and 0 the default value is used as an unset indicator.
Is there are benefit from just doing `0` as unused, and `1..256` as payload values? I.e. doing `+1` and `-1` instead of inverting? I suspect that would be more straight-forward, and probably better for generated code quality, when immediates are not fully-blown negative immediates?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20178#issuecomment-2228253565
More information about the core-libs-dev
mailing list