RFR: 8339401: Optimize ClassFile load and store instructions

Shaojin Wen swen at openjdk.org
Mon Sep 2 14:10:48 UTC 2024


On Mon, 2 Sep 2024 13:02:40 GMT, Chen Liang <liach at openjdk.org> wrote:

>> BytecodeHelpers' loadOpcode and storeOpcode are large methods with code size greater than 325, break it into multiple small methods and call them directly in DirectCodeBuilder
>
> src/java.base/share/classes/jdk/internal/classfile/impl/BytecodeHelpers.java line 61:
> 
>> 59:         return switch (tk) {
>> 60:             case INT, SHORT, BYTE, CHAR, BOOLEAN
>> 61:                            -> iload(slot);
> 
> Can you do
> 
> switch (tk.asLoadable()) {
>     case INT      -> iload(slot);

I'm not sure if that's better, because there's a getField and branch in the implementation of asLoadable

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20739#discussion_r1740969683


More information about the core-libs-dev mailing list