Skip to content

Commit fae6c62

Browse files
committed
Add flag indicating HLL init status in CodeRef
Add a value that indicates whether the statevar associated with the coderef has been assigned a value by the HLL (flag set via extop on HLL side). This change is being made to coincide with a Rakudo development regarding statevar initialization. See [RT#102994](https://rt.perl.org/Public/Bug/Display.html?id=102994)
1 parent 25dec5d commit fae6c62

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public CallFrame(ThreadContext tc, CodeRef cr) {
138138
int numoLex = sci.oLexStatic.length;
139139
this.oLex = new SixModelObject[numoLex];
140140
for (int i = 0; i < numoLex; i++) {
141+
// 0 = static, 1 = clone, 2 = state
141142
switch (sci.oLexStaticFlags[i]) {
142143
case 0:
143144
this.oLex[i] = sci.oLexStatic[i];
@@ -148,6 +149,7 @@ public CallFrame(ThreadContext tc, CodeRef cr) {
148149
case 2:
149150
if (cr.oLexState == null) {
150151
cr.oLexState = new SixModelObject[sci.oLexStatic.length];
152+
cr.oLexStateIsHllInit = new boolean[sci.oLexStatic.length];
151153
this.stateInit = true;
152154
}
153155
if (cr.oLexState[i] == null)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public class CodeRef extends SixModelObject {
3838
*/
3939
public SixModelObject[] oLexState;
4040

41+
/**
42+
* Has the given statevar been assigned a value by the HLL?
43+
*/
44+
public boolean[] oLexStateIsHllInit;
45+
4146
/**
4247
* The (human-readable) name of the code-ref (not in staticInfo as a
4348
* number of places want to tweak it per closure clone).

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public class StaticCodeInfo implements Cloneable {
5555

5656
/**
5757
* Flags for each static lexical usage.
58+
* 0 = static, 1 = clone, 2 = state
5859
*/
5960
public byte[] oLexStaticFlags;
6061

0 commit comments

Comments
 (0)