Removal of Tiken.UNDEFINED: it was not used outside Interpreter

This commit is contained in:
igor%mir2.org 2004-07-01 16:40:44 +00:00
parent 76dfd52043
commit 4035bd2c91
4 changed files with 8 additions and 12 deletions

View File

@ -1072,7 +1072,6 @@ final class IRFactory
switch (node.getType()) {
case Token.FALSE:
case Token.NULL:
case Token.UNDEFINED:
return ALWAYS_FALSE_BOOLEAN;
case Token.TRUE:
return ALWAYS_TRUE_BOOLEAN;

View File

@ -129,8 +129,10 @@ public class Interpreter
Icode_GETVAR1 = -43,
Icode_SETVAR1 = -44,
Icode_UNDEF = -45,
// Last icode
MIN_ICODE = -44;
MIN_ICODE = -45;
static {
// Checks for byte code consistencies, good compiler can eliminate them
@ -727,7 +729,7 @@ public class Interpreter
iCodeTop = generateICode(child, iCodeTop);
if (type == Token.VOID) {
iCodeTop = addToken(Token.POP, iCodeTop);
iCodeTop = addToken(Token.UNDEFINED, iCodeTop);
iCodeTop = addIcode(Icode_UNDEF, iCodeTop);
} else {
iCodeTop = addToken(type, iCodeTop);
}
@ -1008,7 +1010,6 @@ public class Interpreter
case Token.THISFN:
case Token.FALSE:
case Token.TRUE:
case Token.UNDEFINED:
stackDelta = 1;
iCodeTop = addToken(type, iCodeTop);
itsStackDepth++;
@ -1640,6 +1641,7 @@ public class Interpreter
case Icode_REG_STR4: return "LOAD_STR4";
case Icode_GETVAR1: return "GETVAR1";
case Icode_SETVAR1: return "SETVAR1";
case Icode_UNDEF: return "UNDEF";
}
// icode without name
@ -2776,8 +2778,8 @@ switch (op) {
case Token.TRUE :
stack[++stackTop] = Boolean.TRUE;
continue Loop;
case Token.UNDEFINED :
stack[++stackTop] = Undefined.instance;
case Icode_UNDEF :
stack[++stackTop] = undefined;
continue Loop;
case Token.ENTERWITH : {
Object lhs = stack[stackTop];

View File

@ -131,7 +131,7 @@ public class Token
LOCAL_LOAD = 57,
GETVAR = 58,
SETVAR = 59,
UNDEFINED = 60,
// XXX removed unused UNDEFINED
CATCH_SCOPE = 61,
ENUM_INIT = 62,
ENUM_NEXT = 63,
@ -282,7 +282,6 @@ public class Token
case LOCAL_LOAD: return "LOCAL_LOAD";
case GETVAR: return "GETVAR";
case SETVAR: return "SETVAR";
case UNDEFINED: return "UNDEFINED";
case CATCH_SCOPE: return "CATCH_SCOPE";
case ENUM_INIT: return "ENUM_INIT";
case ENUM_NEXT: return "ENUM_NEXT";

View File

@ -1449,10 +1449,6 @@ class BodyCodegen
"FALSE", "Ljava/lang/Boolean;");
break;
case Token.UNDEFINED:
Codegen.pushUndefined(cfw);
break;
case Token.REGEXP:
visitRegexp(node);
break;