diff --git a/src/jse/org/luaj/vm2/luajc/Slots.java b/src/jse/org/luaj/vm2/luajc/Slots.java index f1674464..2459f9eb 100644 --- a/src/jse/org/luaj/vm2/luajc/Slots.java +++ b/src/jse/org/luaj/vm2/luajc/Slots.java @@ -48,6 +48,7 @@ public class Slots { private static final byte BIT_INVALID = 0x20; // slot becomes invlaid at this pc private static final byte BIT_NIL = 0x40; // slot initialized to nil at this point + final Prototype p; final int n,m; public final byte[][] slots; public final boolean[] branchdest; @@ -68,22 +69,21 @@ public class Slots { return (slots[0][slot] & (BIT_INVALID)) == 0; } - public Slots(Prototype p) { + public Slots(Prototype prototype) { + p = prototype; n = p.code.length; m = p.maxstacksize; slots = new byte[n+1][m]; branchdest = new boolean[n+1]; - markassignments( p ); - markuninitialized( p ); - markupvalues( p ); - markforloopupvalues( p ); + markassignments(); + while ( propogatebranches() ) + ; + markuninitialized(); + markupvalues(); + markforloopupvalues(); } - - public String tojstring() { - return tojstring(null); - } - - private void markassignments( Prototype p ) { + + private void markassignments() { // mark initial assignments and references int j=0; for ( ; j