Improve call stack handling to prepare for propert tail call handling.

This commit is contained in:
James Roseborough
2007-06-15 06:41:40 +00:00
parent 19bd995ba6
commit be20581731
10 changed files with 21 additions and 33 deletions

View File

@@ -27,15 +27,15 @@ final class Builtin extends LFunction {
}
public String toString() {
return "Builtin('"+NAMES[id]+"')";
return "builtin."+NAMES[id];
}
// perform a lua call
public void luaStackCall(StackState state, int base) {
public void luaStackCall(StackState state, int base, int top) {
int returnValues = 0;
switch ( id ) {
case PRINT:
for ( int i=base+1, n=state.top; i<n; i++ ) {
for ( int i=base+1; i<top; i++ ) {
System.out.print( String.valueOf(state.stack[i]) );
System.out.print( "\t" );
}