RFR: 8341141: Optimize DirectCodeBuilder [v23]
Claes Redestad
redestad at openjdk.org
Mon Oct 7 21:42:23 UTC 2024
On Mon, 7 Oct 2024 20:03:29 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fix merge error
>
> src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java line 989:
>
>> 987: @Override
>> 988: public CodeBuilder aload(int slot) {
>> 989: if (slot >= 0 && slot <= 3) {
>
> Should we use `if ((slot & ~3) != 0)` for shorter bytecode? #21367
While fun, I wonder if such bit-fiddling optimizations obfuscate the code more than it helps performance. Would be good with some supporting evidence that it 1) helps interpreted performance and 2) that all JITs recognize and optimize this pattern well and without surprises.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21243#discussion_r1790909547
More information about the core-libs-dev
mailing list