Fix for loop (jit), make jist test use jit closures.

This commit is contained in:
James Roseborough
2008-05-18 19:24:09 +00:00
parent 039d79fe5f
commit d9c3f0ae15
2 changed files with 4 additions and 5 deletions

View File

@@ -547,15 +547,13 @@ public class LuaJit extends Lua {
String step = "s"+(a+2);
String idx = "s"+(a+3);
String back = "back"+(forlevel++);
ps.println( "\t\t"+back+"="+step+".luaBinCmpInteger(Lua.OP_LT,0);");
ps.println( "\t\tfor ( "+idx+"="+init+";\n" +
ps.println( "\t\tfor ( "+idx+"="+init+", "+back+"="+step+".luaBinCmpInteger(Lua.OP_LT,0);\n" +
"\t\t\t"+back+"? "+idx+".luaBinCmpUnknown(Lua.OP_LE, "+limit+"): "+limit+".luaBinCmpUnknown(Lua.OP_LE, "+idx+");\n" +
"\t\t\t"+idx+"="+idx+".luaBinOpUnknown(Lua.OP_ADD,"+step+") ) {");
forlevel++;
break;
}
case LuaState.OP_FORLOOP: {
forlevel--;
--forlevel;
ps.println( "\t\t}");
//i0 = this.stack[base + a];
//step = this.stack[base + a + 2];

View File

@@ -195,7 +195,8 @@ public class LuaJTest extends TestCase {
try {
// create closure and execute
LClosure c = p.newClosure( state._G );
state.doCall(c, new LValue[0]);
state.pushlvalue(c);
state.call(0,0);
final String actualOutput = new String( outputStream.toByteArray() );
final String expectedOutput = getExpectedOutput( testName );