RFR: 8337225: Demote maxStack and maxLocals from CodeModel to CodeAttribute [v2]
ExE Boss
duke at openjdk.org
Mon Jul 29 00:40:37 UTC 2024
On Sun, 28 Jul 2024 02:39:23 GMT, Chen Liang <liach at openjdk.org> wrote:
>> As discussed in offline meeting, the max stack and locals information are part of the code attribute and not meaningful for buffered code elements. Computation would be costly and these see no real usage during transformations. Thus, the proposed solution is to move these APIs to be CodeAttribute specific, as this is already how all these APIs' users are using.
>>
>> Also removed useless `Writable` on buffered models, and fixed `BufferedMethodBuilder::code` implementation.
>
> 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());
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20338#discussion_r1694387536
More information about the core-libs-dev
mailing list