Simplified, extended jit implementation

This commit is contained in:
James Roseborough
2008-05-18 15:12:03 +00:00
parent c5c322fee1
commit 039d79fe5f
13 changed files with 314 additions and 174 deletions

View File

@@ -31,7 +31,7 @@ public class SimpleTests extends TestCase {
// try running the code!
LuaState state = Platform.newLuaState();
BaseLib.install( state._G );
LClosure c = new LClosure( state, p );
LClosure c = p.newClosure( state._G );
state.doCall( c, new LValue[0] );
} catch ( Exception e ) {
fail("i/o exception: "+e );

View File

@@ -55,7 +55,7 @@ public class DebugStackStateTest extends TestCase {
LPrototype p = LoadState.undump(state, is, script);
// create closure and execute
final LClosure c = new LClosure( state, p );
final LClosure c = p.newClosure( state._G );
// suspend the vm right away
state.suspend();

View File

@@ -194,7 +194,7 @@ public class LuaJTest extends TestCase {
BaseLib.redirectOutput( outputStream );
try {
// create closure and execute
LClosure c = new LClosure( p, state._G );
LClosure c = p.newClosure( state._G );
state.doCall(c, new LValue[0]);
final String actualOutput = new String( outputStream.toByteArray() );
@@ -207,7 +207,7 @@ public class LuaJTest extends TestCase {
}
}
private LPrototype loadScriptResource( LuaState state, String name ) throws IOException {
protected LPrototype loadScriptResource( LuaState state, String name ) throws IOException {
InputStream script = getClass().getResourceAsStream( "/"+name+".luac" );
if ( script == null ) {
script = getClass().getResourceAsStream( "/"+name+".lua" );

View File

@@ -74,7 +74,7 @@ public class StandardTest extends TestCase {
// the garbage collector. Until we implement that, remove the
// built-in collectgarbage function.
state._G.put( "collectgarbage", LNil.NIL );
LClosure c = new LClosure( code, state._G );
LClosure c = code.newClosure( state._G );
ByteArrayOutputStream output = new ByteArrayOutputStream();
BaseLib.redirectOutput( output );