Skip to content

Commit 66d1166

Browse files
committed
Make state variables be stateful.
1 parent 76b8dc0 commit 66d1166

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,17 @@ public CallFrame(ThreadContext tc, CodeRef cr) {
118118
case 0:
119119
this.oLex[i] = sci.oLexStatic[i];
120120
break;
121-
default:
121+
case 1:
122122
this.oLex[i] = sci.oLexStatic[i].clone(tc);
123123
break;
124+
case 2:
125+
if (cr.oLexState == null)
126+
cr.oLexState = new SixModelObject[sci.oLexStatic.length];
127+
if (cr.oLexState[i] == null)
128+
this.oLex[i] = cr.oLexState[i] = sci.oLexStatic[i].clone(tc);
129+
else
130+
this.oLex[i] = cr.oLexState[i];
131+
break;
124132
}
125133
}
126134
}

src/vm/jvm/runtime/org/perl6/nqp/runtime/CodeRef.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public class CodeRef extends SixModelObject {
3333
*/
3434
public boolean isCompilerStub;
3535

36+
/**
37+
* State variable storage, if needed.
38+
*/
39+
public SixModelObject[] oLexState;
40+
3641
/**
3742
* Sets up the code-ref data structure.
3843
*/

0 commit comments

Comments
 (0)