On Fri, 13 Sep 2024 17:14:17 GMT, Shaojin Wen <s...@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 with a new target base due to a 
> merge or a rebase. The pull request now contains six commits:
> 
>  - Merge remote-tracking branch 'upstream/master' into 
> optim_classfile_loadconstant_2020408
>    
>    # Conflicts:
>    #  
> src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
>  - Merge remote-tracking branch 'upstream/master' into 
> optim_classfile_loadconstant_2020408
>    
>    # Conflicts:
>    #  src/java.base/share/classes/java/lang/classfile/CodeBuilder.java
>  - comments
>  - fix comment
>  - since 24
>  - optimize loadConstant

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

> 626: 
> 627:     /**
> 628:      * Generate an instruction pushing a constant int value onto the 
> operand stack.

@wenshao After offline discussion with @kevinb9n, we think we should add 
another sentence in the API specification:

This is identical to {@link #loadConstant(ConstantDesc) 
loadConstant(Integer.valueOf(value))}.

And repeat this for long, float, and double versions (with 
`Long.valueOf(value)` etc.)
This avoids confusions around this API.

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

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

Reply via email to