From dlsmith at openjdk.org Sat Aug 31 00:36:42 2024 From: dlsmith at openjdk.org (Dan Smith) Date: Sat, 31 Aug 2024 00:36:42 GMT Subject: RFR: 7903806: Enhance jasm/jdis to support value classes and objects Message-ID: Some changes to align Valhalla support in asmtools with the latest design for JEP 401. Latest JVM specification can be found here: https://cr.openjdk.org/~dlsmith/jep401/jep401-20240624/specs/value-objects-jvms.html I originally made these changes on a custom copy of asmtools, so this was mostly a matter of reviewing my original patch and making updates. There have been some changes, though, and it's quite possible I've missed something. ------------- Commit messages: - 7903806: Enhance jasm/jdis to support value classes and objects Changes: https://git.openjdk.org/asmtools/pull/73/files Webrev: https://webrevs.openjdk.org/?repo=asmtools&pr=73&range=00 Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903806 Stats: 380 lines in 16 files changed: 198 ins; 114 del; 68 mod Patch: https://git.openjdk.org/asmtools/pull/73.diff Fetch: git fetch https://git.openjdk.org/asmtools.git pull/73/head:pull/73 PR: https://git.openjdk.org/asmtools/pull/73 From dlsmith at openjdk.org Sat Aug 31 01:00:04 2024 From: dlsmith at openjdk.org (Dan Smith) Date: Sat, 31 Aug 2024 01:00:04 GMT Subject: RFR: 7903806: Enhance jasm/jdis to support value classes and objects [v2] In-Reply-To: References: Message-ID: > Some changes to align Valhalla support in asmtools with the latest design for JEP 401. > > Latest JVM specification can be found here: https://cr.openjdk.org/~dlsmith/jep401/jep401-20240624/specs/value-objects-jvms.html > > I originally made these changes on a custom copy of asmtools, so this was mostly a matter of reviewing my original patch and making updates. There have been some changes, though, and it's quite possible I've missed something. > > Some things to be aware of: > > - There are no longer any new opcodes or any changes to special methods (like ``) > - The ACC_IDENTITY flag, which replaces ACC_VALUE, is aliased with ACC_SUPER?this will create some awkwardness until the feature is final. In the mean time, I've had jdis just print `super`; I imagine someone more experienced with this code might find a clean way to print the right thing based on the version number > - That said, I'm not sure what version number these features will be associated with?spec currently says 67.65535 (i.e., Java 23), but obviously that's going to change > - The Preload attribute, which contained a list of CONSTANT_Classes, has been replaced with LoadableDescriptors, which contains a list of Utf8 descriptor strings > - ACC_PERMITTED_SUBCLASSES and ACC_PRIMITIVE have been abandoned, can be deleted > - The ACC_STRICT flag is now allowed on fields; the spec has some constraints on its use (e.g., the field must be final), but I didn't include those checks, because we have plans to expand the feature to other kinds of fields > - I got this to compile, but I haven't tested anything. Not sure how to run the local tests; I'll do some targeted testing just to make sure the changes basically work. Dan Smith has updated the pull request incrementally with one additional commit since the last revision: Fix printing of inner class identity flag ------------- Changes: - all: https://git.openjdk.org/asmtools/pull/73/files - new: https://git.openjdk.org/asmtools/pull/73/files/aef02298..f927d5e8 Webrevs: - full: https://webrevs.openjdk.org/?repo=asmtools&pr=73&range=01 - incr: https://webrevs.openjdk.org/?repo=asmtools&pr=73&range=00-01 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.org/asmtools/pull/73.diff Fetch: git fetch https://git.openjdk.org/asmtools.git pull/73/head:pull/73 PR: https://git.openjdk.org/asmtools/pull/73