Improve bytecode generation.

This commit is contained in:
James Roseborough
2010-08-11 00:17:45 +00:00
parent d27f2d6e20
commit a1e8df5a11
2 changed files with 4 additions and 2 deletions

View File

@@ -113,7 +113,9 @@ public class BasicBlock {
break; break;
if ( Lua.GET_OPCODE(code[i+1]) == Lua.OP_JMP ) if ( Lua.GET_OPCODE(code[i+1]) == Lua.OP_JMP )
throw new IllegalArgumentException("OP_LOADBOOL followed by jump at "+i); throw new IllegalArgumentException("OP_LOADBOOL followed by jump at "+i);
break; visitor.visitBranch( i, i+1 );
visitor.visitBranch( i, i+2 );
continue;
case Lua.OP_EQ: case Lua.OP_EQ:
case Lua.OP_LT: case Lua.OP_LT:
case Lua.OP_LE: case Lua.OP_LE:

View File

@@ -61,7 +61,7 @@ public class UpvalInfo {
// check for previous assignment // check for previous assignment
loop: while ( true ) { loop: while ( true ) {
// invalid values terminate search // invalid values terminate search
if ( v == VarInfo.INVALID ) if ( v == null || v == VarInfo.INVALID )
return; return;
// basic block for nil values is initial block // basic block for nil values is initial block