Fix for loop (jit), make jist test use jit closures.
This commit is contained in:
@@ -547,15 +547,13 @@ public class LuaJit extends Lua {
|
|||||||
String step = "s"+(a+2);
|
String step = "s"+(a+2);
|
||||||
String idx = "s"+(a+3);
|
String idx = "s"+(a+3);
|
||||||
String back = "back"+(forlevel++);
|
String back = "back"+(forlevel++);
|
||||||
ps.println( "\t\t"+back+"="+step+".luaBinCmpInteger(Lua.OP_LT,0);");
|
ps.println( "\t\tfor ( "+idx+"="+init+", "+back+"="+step+".luaBinCmpInteger(Lua.OP_LT,0);\n" +
|
||||||
ps.println( "\t\tfor ( "+idx+"="+init+";\n" +
|
|
||||||
"\t\t\t"+back+"? "+idx+".luaBinCmpUnknown(Lua.OP_LE, "+limit+"): "+limit+".luaBinCmpUnknown(Lua.OP_LE, "+idx+");\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+") ) {");
|
"\t\t\t"+idx+"="+idx+".luaBinOpUnknown(Lua.OP_ADD,"+step+") ) {");
|
||||||
forlevel++;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LuaState.OP_FORLOOP: {
|
case LuaState.OP_FORLOOP: {
|
||||||
forlevel--;
|
--forlevel;
|
||||||
ps.println( "\t\t}");
|
ps.println( "\t\t}");
|
||||||
//i0 = this.stack[base + a];
|
//i0 = this.stack[base + a];
|
||||||
//step = this.stack[base + a + 2];
|
//step = this.stack[base + a + 2];
|
||||||
|
|||||||
@@ -195,7 +195,8 @@ public class LuaJTest extends TestCase {
|
|||||||
try {
|
try {
|
||||||
// create closure and execute
|
// create closure and execute
|
||||||
LClosure c = p.newClosure( state._G );
|
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 actualOutput = new String( outputStream.toByteArray() );
|
||||||
final String expectedOutput = getExpectedOutput( testName );
|
final String expectedOutput = getExpectedOutput( testName );
|
||||||
|
|||||||
Reference in New Issue
Block a user