Does "-cv" option to jasm tool override the class file version in jasm file?
Leonid Kuskov
leonid.kuskov at oracle.com
Mon Dec 15 21:53:32 UTC 2025
Hello Jaikiran, Chrisitan,
Asmtools 9.1 has been switched to JDK 17 (LTS): https://bugs.openjdk.org/browse/CODETOOLS-7904123
Therefore, it is now possible to upgrade the jtreg asmtools version from 8.1 to 9.1, which supports Valhalla and is used for writing VM tests in JCK 26.
Thanks,
Leonid
Confidential- Oracle Internal
From: asmtools-dev <asmtools-dev-retn at openjdk.org> on behalf of Leonid Kuskov <leonid.kuskov at oracle.com>
Date: Friday, December 12, 2025 at 11:53 AM
To: Jaikiran Pai <jaikiran.pai at oracle.com>, asmtools-dev at openjdk.org <asmtools-dev at openjdk.org>
Subject: Re: Does "-cv" option to jasm tool override the class file version in jasm file?
Currently, asmtools is built using JDK 21 (LTS). If you prefer to continue using JDK 17, I can downgrade the build version to align with jtreg. A few changes can be integrated over the next few days.
Leonid
Confidential- Oracle Internal
From: Jaikiran Pai <jaikiran.pai at oracle.com>
Date: Thursday, December 11, 2025 at 5:54 PM
To: Leonid Kuskov <leonid.kuskov at oracle.com>, asmtools-dev at openjdk.org <asmtools-dev at openjdk.org>
Subject: Re: Does "-cv" option to jasm tool override the class file version in jasm file?
On 12/12/25 3:19 am, Leonid Kuskov wrote:
In typical usage, a .jasm file explicitly specifies the class-file version in its header, for example:
test.jasm
public super class test version 55:0 {}
If the version isn't specified in the file, jasm defaults to 45.3.
When a version is present in the .jasm file, the -cv option doesn’t override it. For example, given a header such as:
public super class test version 55:0 {}
and the command:
jasm -cv 66.0 -w . test.jasm
the generated class file will still use version 55.0, because the version defined in the source takes precedence.
Thank you Leonid, this is what I had hoped -cv would be, but got confused by the comment in that Main.java code. Thank you for confirming.
Leonid
BTW: The latest asmtools release is 9.1, which is preferable to version 8.1 for new or updated workflows.
I will take this up with the jtreg dev team and see if we should upgrade to it. One thing that's important for jtreg is the ability to use this library on older Java versions. asmtools 8.1 requires Java 17 runtime and when we upgraded jtreg to use 8.1 of asmtools, we had to enforce Java 17 as the minimum to build and launch the jtreg tool.
-Jaikiran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/asmtools-dev/attachments/20251215/be98364b/attachment-0001.htm>
More information about the asmtools-dev
mailing list