Skip to content

GEP-15: avoid double dispatch#2628

Merged
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:gep15optSpike
Jun 27, 2026
Merged

GEP-15: avoid double dispatch#2628
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:gep15optSpike

Conversation

@paulk-asert

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IndyCompoundAssign resolver used by IndyInterface fallback for CallType.COMPOUND_ASSIGN.
  • Factors Selector so compound-assignment can reuse the normal (unguarded) method-selection/invocation-handle construction.
  • Updates indy bytecode generation (IndyBinHelper) to emit invokedynamic for 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.

Comment thread src/main/java/org/codehaus/groovy/vmplugin/v8/IndyCompoundAssign.java Outdated
Comment thread src/main/java/org/codehaus/groovy/vmplugin/v8/IndyCompoundAssign.java Outdated
Comment thread src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java Outdated
@testlens-app

testlens-app Bot commented Jun 26, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 1e3548e
▶️ Tests: 95897 executed
⚪️ Checks: 23/23 completed


Learn more about TestLens at testlens.app.

@paulk-asert paulk-asert merged commit 1fbd6be into apache:master Jun 27, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants