RFR: 8356548: Use ClassFile API instead of ASM to transform classes in tests [v9]

Chen Liang liach at openjdk.org
Wed Oct 15 18:21:50 UTC 2025


> One of the goals of ClassFile API is to avoid updating the copy of ASM in the JDK (now moved to the test library) to support future class file formats.
> 
> However, some tests in hotspot turn out to parse latest class files, usually produced by the javac in the JDK under test, to transform them to inject desired bytecode patterns. If we keep these tests, we must keep maintaining the ASM library to accept all current class files, which will be costly with the upcoming project Valhalla.
> 
> To avoid maintaining ASM down the road, we can either:
> 1. Migrate the transformation to ClassFile API
> 2. Set source and release version in javac flags to produce stable bytecode
> 
> I recommend migrating to ClassFile API; javac has a deprecation policy, that in the future, old source and target versions will no longer be supported, and we would still need another port at that time.

Chen Liang has updated the pull request incrementally with one additional commit since the last revision:

  Clarification

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25124/files
  - new: https://git.openjdk.org/jdk/pull/25124/files/e31476b1..697b8555

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25124&range=08
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25124&range=07-08

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/25124.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25124/head:pull/25124

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


More information about the serviceability-dev mailing list