Skip to content

Commit 5dbb0a5

Browse files
committed
do not explode closure assignments longer than 32
1 parent fbc2ad2 commit 5dbb0a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PClosureRootNode.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ protected void addClosureCellsToLocals(Frame frame) {
7878
assert freeVarSlots != null : "closure root node: the free var slots cannot be null when the closure is not null";
7979
assert frameClosure.length == freeVarSlots.length : "closure root node: the closure must have the same length as the free var slots array";
8080
if (closure != null && closure != NO_CLOSURE) {
81-
addClosureCellsToLocalsExploded(frame, closure);
81+
if (freeVarSlots.length < 32) {
82+
addClosureCellsToLocalsExploded(frame, closure);
83+
} else {
84+
addClosureCellsToLocalsLoop(frame, closure);
85+
}
8286
} else {
8387
if (freeVarSlots.length < 32) {
8488
addClosureCellsToLocalsExploded(frame, frameClosure);

0 commit comments

Comments
 (0)