Improve luajc bytecode generation.

This commit is contained in:
James Roseborough
2010-08-06 14:47:00 +00:00
parent 0348ac9f90
commit df86eca3c3
4 changed files with 24 additions and 13 deletions

View File

@@ -60,6 +60,13 @@ public class UpvalInfo {
// check for previous assignment
loop: while ( true ) {
// invalid values terminate search
if ( v == VarInfo.INVALID )
return;
// nil values also terminate (TODO: mark as unintialized upvalue)
if ( v.pc == -1 )
return;
BasicBlock b = pi.blocks[v.pc];
if ( v.upvalue == this ) {
// loop detected, include previous values
@@ -75,10 +82,6 @@ public class UpvalInfo {
if ( v.upvalue != null )
throw new IllegalArgumentException("upvalue collision detected between "+v.upvalue+" and "+this);
// invalid values terminate search
if ( v == VarInfo.INVALID )
return;
// assign the variable
v.upvalue = this;
this.includeVar(v);