Allow bytecode version to be open-ended#9444
Merged
Merged
Conversation
Member
Author
|
As I feared, if ASM doesn't know about the bytecode version, it will not allow it. I will investigate if there is a way to programmatically determine the highest version it supports because I really want to eliminate this manual code. |
Member
Author
|
Latest changes seem to work but I want to add a test to verify that it is picking the latest version. |
The ASM library hard codes a set of known bytecode versions, which can only be programmatically queried with reflection. This change uses reflection to pick the correct bytecode version for the JVM we are running on, falling back on the highest version supported by ASM if the JVM version is newer than that. Fixes #9443
headius
force-pushed
the
headius-patch-1
branch
2 times, most recently
from
May 15, 2026 16:01
cb8db4b to
af0ddc4
Compare
chadlwilson
added a commit
to jruby/warbler
that referenced
this pull request
Jun 9, 2026
…bytecode.version=8) See jruby/jruby#9444 - likely unintentionally removed the mapping for `8`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ASM library hard codes a set of known bytecode versions, which frequently forces us to select an earlier version than the JVM we are running on. This change makes that byte code version open-ended, decoupling us from the ASM supported bytecode versions.
This is somewhat experimental, since we do not know how ASM will react if the JDK version is much newer than it's known byte code versions. If this patch does not work, we will fall back on updating ASM to latest and dealing with and updating our version calculation in the future.
Fixes #9443
Update: as suspected, ASM will not permit us to use bytecode versions newer than it supports, so I have made an additional change to limit the open-endedness of this to just the values the current ASM version supports.