You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/07/11 21:56:00 UTC
[jira] [Commented] (GROOVY-12151) hoist eligible closure bodies to a shared adapter @PackedClosures/flag (GEP-27 S1)
[ https://issues.apache.org/jira/browse/GROOVY-12151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095643#comment-18095643 ]
ASF GitHub Bot commented on GROOVY-12151:
-----------------------------------------
paulk-asert opened a new pull request, #2692:
URL: https://github.com/apache/groovy/pull/2692
…edClosures/flag off by default (GEP-27 S1)
Add closure packing on top of the SAM-lambda hoisting: an eligible closure literal's body is hoisted into a synthetic method on the enclosing class and the literal is replaced by a shared PackedClosure adapter, removing the per-closure generated class (and the nested $_closure1$_closure2 name explosion) while the value stays a real groovy.lang.Closure.
Capability analysis (PackStrategy, ClosureWriter.chooseStrategy):
- a single decision point selects FULL_CLASS (S0) vs PACKED_ADAPTER (S1);
- triggered by the @PackedClosures annotation (trust path, dynamic or static), or automatically under @CompileStatic when the type checker PROVES the closure delegate-independent
> hoist eligible closure bodies to a shared adapter @PackedClosures/flag (GEP-27 S1)
> ----------------------------------------------------------------------------------
>
> Key: GROOVY-12151
> URL: https://issues.apache.org/jira/browse/GROOVY-12151
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)