Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make state variables be stateful.
  • Loading branch information
jnthn committed Jun 21, 2013
1 parent 76b8dc0 commit 66d1166
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/vm/jvm/runtime/org/perl6/nqp/runtime/CallFrame.java
Expand Up @@ -118,9 +118,17 @@ public CallFrame(ThreadContext tc, CodeRef cr) {
case 0:
this.oLex[i] = sci.oLexStatic[i];
break;
default:
case 1:
this.oLex[i] = sci.oLexStatic[i].clone(tc);
break;
case 2:
if (cr.oLexState == null)
cr.oLexState = new SixModelObject[sci.oLexStatic.length];
if (cr.oLexState[i] == null)
this.oLex[i] = cr.oLexState[i] = sci.oLexStatic[i].clone(tc);
else
this.oLex[i] = cr.oLexState[i];
break;
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/CodeRef.java
Expand Up @@ -33,6 +33,11 @@ public class CodeRef extends SixModelObject {
*/
public boolean isCompilerStub;

/**
* State variable storage, if needed.
*/
public SixModelObject[] oLexState;

/**
* Sets up the code-ref data structure.
*/
Expand Down

0 comments on commit 66d1166

Please sign in to comment.