GROOVY-12022: replace indy code for array access in static compilation#2546
GROOVY-12022: replace indy code for array access in static compilation#2546blackdrag wants to merge 3 commits into
Conversation
…n mode with existing code in BytecodeInterface8 and deprecate now surplus IndyStaticTypesMultiTypeDispatcher. Performance wise there is no gain to use indy here and it simplifies code paths and JIT work
… old invokedynamic instruction is no longer valid
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2546 +/- ##
==================================================
- Coverage 68.1956% 68.1517% -0.0439%
- Complexity 32936 33102 +166
==================================================
Files 1503 1508 +5
Lines 125706 126145 +439
Branches 22743 22886 +143
==================================================
+ Hits 85726 85970 +244
- Misses 32422 32548 +126
- Partials 7558 7627 +69
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR (GROOVY-12022) simplifies static compilation bytecode generation for array access by replacing the indy-based array access path with the existing BytecodeInterface8 helpers, and deprecates the now-surplus indy static-types dispatcher.
Changes:
- Update static compilation bytecode generation to always use
StaticTypesBinaryExpressionMultiTypeDispatcher(removing the indy-specific dispatcher selection). - Adjust bytecode-oriented tests to expect
BytecodeInterface8.*ArrayGet/*ArraySetinvocations instead ofinvokedynamic. - Deprecate
IndyStaticTypesMultiTypeDispatchernow that it is no longer used.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/test/groovy/org/codehaus/groovy/classgen/asm/sc/StaticCompilationTest.groovy |
Updates expected bytecode for static array set to use BytecodeInterface8.intArraySet. |
src/test/groovy/org/codehaus/groovy/classgen/asm/sc/CombinedIndyAndStaticCompilationTest.groovy |
Strengthens array read/write assertions to check for BytecodeInterface8 array helpers across primitive and Object arrays. |
src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesWriterController.java |
Removes indy-based binary expression dispatcher selection; always uses the static multi-type dispatcher. |
src/main/java/org/codehaus/groovy/classgen/asm/indy/sc/IndyStaticTypesMultiTypeDispatcher.java |
Marks the indy static-types dispatcher as deprecated. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ All tests passed ✅🏷️ Commit: 1c2bd18 Learn more about TestLens at testlens.app. |



replace indy code for array access in static compilation mode with existing code in BytecodeInterface8 and deprecate now surplus IndyStaticTypesMultiTypeDispatcher. Performance wise there is no gain to use indy here and it simplifies code paths and JIT work