RFR: 8339217: Optimize ClassFile API loadConstant [v2]

Chen Liang liach at openjdk.org
Thu Aug 29 15:40:19 UTC 2024


On Thu, 29 Aug 2024 15:35:32 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> This is a large method. By splitting it into multiple methods with the same name, the caller can automatically select based on the different types of parameters, avoiding this large call that cannot be inlined, which can also improve startup performance.
>> 
>> * current
>> 
>> CodeBuilder {
>>     default CodeBuilder loadConstant(ConstantDesc value) { ... }
>> }
>> 
>> java.lang.classfile.CodeBuilder::loadConstant (465 bytes)   failed to inline: callee is too large
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix comment

src/java.base/share/classes/java/lang/classfile/CodeBuilder.java line 650:

> 648: 
> 649:     /**
> 650:      * pushing an int onto the operand stack

Sorry, I didn't mean to truncate the sentence. The full sentence should be:

Generate an instruction pushing a constant int value onto the operand stack.

And so on for the other methods.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20761#discussion_r1736520046


More information about the core-libs-dev mailing list