RFR: 8339401: Optimize ClassFile load and store instructions

Chen Liang liach at openjdk.org
Mon Sep 2 14:10:48 UTC 2024


On Wed, 28 Aug 2024 04:14:53 GMT, Shaojin Wen <swen 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);

src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java line 1479:

> 1477: 
> 1478:     @Override
> 1479:     public CodeBuilder iload(int slot) {

Can you put them in the same order they are declared in `CodeBuilder`, like `iload` between `iinc` and `imul`?

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

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


More information about the core-libs-dev mailing list