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
Родитель 76dfd52043
Коммит 4035bd2c91
4 изменённых файлов: 8 добавлений и 12 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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