GEP-15: avoid double dispatch#2628
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements GEP-15 support for dynamic compound-assignment (op=) using the existing invokedynamic (IndyInterface) bootstrap and inline-cache lifecycle, aiming to avoid the legacy uncached ScriptBytecodeAdapter.compoundAssign dispatch path while preserving dynamic semantics (MOP invalidation, overload correctness, etc.).
Changes:
- Adds a new
IndyCompoundAssignresolver used byIndyInterfacefallback forCallType.COMPOUND_ASSIGN. - Factors
Selectorso compound-assignment can reuse the normal (unguarded) method-selection/invocation-handle construction. - Updates indy bytecode generation (
IndyBinHelper) to emitinvokedynamicfor compound assignment and adds a new regression test suite.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/test/groovy/org/codehaus/groovy/classgen/asm/indy/IndyCompoundAssignTest.groovy | Adds behavioral tests intended to validate indy compound-assignment caching semantics and MOP invalidation behavior. |
| src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java | Refactors invocation-handle construction to allow reuse without installing guards, enabling compound-assign to build “normal call” handles. |
| src/main/java/org/codehaus/groovy/vmplugin/v8/IndyCompoundAssign.java | Introduces the GEP-15 compound-assignment resolver and guard logic for PIC entries. |
| src/main/java/org/codehaus/groovy/classgen/asm/indy/IndyBinHelper.java | Changes indy codegen for op= to emit invokedynamic using the shared bootstrap and COMPOUND_ASSIGN call type. |
5370940 to
4cde1dc
Compare
4cde1dc to
1e3548e
Compare
✅ All tests passed ✅🏷️ Commit: 1e3548e Learn more about TestLens at testlens.app. |
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.
No description provided.