RFR: 8341141: Optimize DirectCodeBuilder [v14]

Chen Liang liach at openjdk.org
Mon Sep 30 23:11:42 UTC 2024


On Mon, 30 Sep 2024 21:14:50 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 two additional commits since the last revision:
> 
>  - optimize MethodTypeDescImpl::descriptorString
>  - Remove redundant requireNonNull

src/java.base/share/classes/jdk/internal/classfile/impl/SplitConstantPool.java line 103:

> 101:     @Override
> 102:     public <T extends PoolEntry> T entryByIndex(int index, Class<T> cls) {
> 103:         Objects.requireNonNull(cls);

I think this was added because we want the NPE to be thrown before IAE if index is 0 but cls is null. It might be fine one way or another.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21243#discussion_r1781881645


More information about the core-libs-dev mailing list