RFR: 8337225: Demote maxStack and maxLocals from CodeModel to CodeAttribute [v2]

Chen Liang liach at openjdk.org
Mon Jul 29 00:50:35 UTC 2024


On Mon, 29 Jul 2024 00:37:21 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into fix/codemodel-maxes
>>  - Reuse local var management from buffered code builders
>>  - 8337225: Demote maxStack and maxLocals from CodeModel to CodeAttribute
>
> src/java.base/share/classes/jdk/internal/classfile/impl/TerminalCodeBuilder.java line 41:
> 
>> 39:         }
>> 40:         if (original instanceof CodeAttribute attr) {
>> 41:             return Math.max(paramSlots, attr.codeLength());
> 
> Suggestion:
> 
>             return Math.max(paramSlots, attr.maxLocals());

Good point, will add a test too to verify.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20338#discussion_r1694390946


More information about the core-libs-dev mailing list