Moved from stack to inline execution.

git-svn-id: svn://10.0.0.236/trunk@33132 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogerl%netscape.com
1999-05-28 19:00:48 +00:00
parent 734272ce20
commit 7448fc1fe9
23 changed files with 279 additions and 396 deletions

View File

@@ -5,31 +5,32 @@ class BitwiseNode extends BinaryNode {
super(aOp, aLeft, aRight);
}
void eval(Environment theEnv)
JSValue eval(Environment theEnv)
{
left.eval(theEnv);
JSInteger lV = theEnv.theStack.pop().toJSInteger(theEnv);
right.eval(theEnv);
JSInteger lV = left.eval(theEnv).toJSInteger(theEnv);
JSValue rV = right.eval(theEnv);
if (op == "&")
lV.and(theEnv);
return lV.and(theEnv, rV);
else
if (op == "|")
lV.or(theEnv);
return lV.or(theEnv, rV);
else
if (op == "^")
lV.xor(theEnv);
return lV.xor(theEnv, rV);
else
if (op == "<<")
lV.shr(theEnv);
return lV.shr(theEnv, rV);
else
if (op == ">>")
lV.shl(theEnv);
return lV.shl(theEnv, rV);
else
if (op == ">>>")
lV.ushl(theEnv);
else
return lV.ushl(theEnv, rV);
else {
System.out.println("missing bitwise op " + op);
return null;
}
}
}