RFR: 8341141: Optimize DirectCodeBuilder [v24]
Claes Redestad
redestad at openjdk.org
Tue Oct 8 22:17:59 UTC 2024
On Mon, 7 Oct 2024 22:54:24 GMT, Shaojin Wen <swen at openjdk.org> wrote:
>> Some DirectCodeBuilder related optimizations to improve startup and running performance:
>> 1. Merge calls, merge writeU1 and writeU2 into writeU3
>> 2. Merge calls, merge writeU1 and writeIndex operations
>> 3. Directly use writeU1 instead of writeBytecode
>> 4. Rewrite the implementation of load and store
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>
> suggestion from @liach
src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java line 706:
> 704: public void writeLoadConstant(Opcode opcode, LoadableConstantEntry value) {
> 705: // Make sure Long and Double have LDC2_W and
> 706: // rewrite to _W if index is > 256
Pre-existing..
- Comment should say >= 256.
- As we're cloning from a pre-existing pool I assume there's a (perhaps unlikely) possibility we go from a wide to a lower index? In that case the opcode could profitably be "rewritten" to `Opcode.LDC` in an else clause. (I assume `LDC_W` with an index in the 0-255 range works fine functionally; it just wastes a byte.)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21243#discussion_r1791544609
More information about the core-libs-dev
mailing list