RFR: 8337225: Demote maxStack and maxLocals from CodeModel to CodeAttribute

Chen Liang liach at openjdk.org
Thu Jul 25 22:46:58 UTC 2024


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.

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

Commit messages:
 - 8337225: Demote maxStack and maxLocals from CodeModel to CodeAttribute

Changes: https://git.openjdk.org/jdk/pull/20338/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20338&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8337225
  Stats: 106 lines in 11 files changed: 32 ins; 54 del; 20 mod
  Patch: https://git.openjdk.org/jdk/pull/20338.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20338/head:pull/20338

PR: https://git.openjdk.org/jdk/pull/20338


More information about the core-libs-dev mailing list