Repository navigation
[Hotspot] Fix CVM8 legacy interface static method resolution - #182
Merged
superajun-wsj merged 1 commit intoOct 8, 2026
Merged
superajun-wsj merged 1 commit into
superajun-wsj merged 1 commit into
Conversation
Scala 2.11 may emit invokestatic with a CONSTANT_Methodref when calling a static interface method. JDK17 HotSpot rejects this encoding with an IncompatibleClassChangeError, although it is accepted by JDK8. Allow this legacy encoding in CVM8 and add the default-enabled AllowLegacyInterfaceMethodref flag to restore strict checking when needed.
superajun-wsj
requested review from
K0u1e and
luchsh
and
a balanced review from Copilot
October 8, 2026 07:57
There was a problem hiding this comment.
🟢 Approval recommended
The exception is narrowly scoped to CVM8, preserves other resolution checks, and includes targeted regression coverage.
0 open findings
What changed in this PR
Adds CVM8 compatibility for Scala 2.11’s legacy interface static-method calls while retaining an option for strict checking.
Changes:
- Allows
Methodreffor interfaceinvokestaticcalls in CVM8. - Adds the default-enabled
AllowLegacyInterfaceMethodrefflag. - Tests default, interpreted, compiled, and strict-mode behavior.
| File | Description |
|---|---|
| src/hotspot/share/runtime/globals.hpp | Defines the CVM8 compatibility flag. |
| src/hotspot/share/interpreter/linkResolver.cpp | Adds the narrowly scoped resolution exception. |
| cvm/test/hotspot/runtime/linkResolver/LegacyInterfaceMethodrefCaller.jasm | Supplies legacy-encoded bytecode. |
| cvm/test/hotspot/runtime/linkResolver/LegacyInterfaceMethodref.java | Tests compatibility and strict rejection. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
luchsh
approved these changes
Oct 8, 2026
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.
Scala 2.11 may emit invokestatic with a CONSTANT_Methodref when calling a static interface method. JDK17 HotSpot rejects this encoding with an IncompatibleClassChangeError, although it is accepted by JDK8. Allow this legacy encoding in CVM8 and add the default-enabled AllowLegacyInterfaceMethodref flag to restore strict checking when needed.