case OBJECT: stack.push(new JS.Obj()); break;
case ARRAY: stack.push(new JSArray(Script.toInt((JS)arg))); break;
//case DECLARE: scope.declare((JS)(arg==null ? stack.peek() : arg)); if(arg != null) stack.push((JS)arg); break;
- case JT: if (Script.toBoolean(stack.pop())) pc += Script.toInt((JS)arg) - 1; break;
- case JF: if (!Script.toBoolean(stack.pop())) pc += Script.toInt((JS)arg) - 1; break;
+ case JT: if (Script.toBoolean((JS)stack.pop())) pc += Script.toInt((JS)arg) - 1; break;
+ case JF: if (!Script.toBoolean((JS)stack.pop())) pc += Script.toInt((JS)arg) - 1; break;
case JMP: pc += Script.toInt((JS)arg) - 1; break;
case POP: stack.pop(); break;
case SWAP: stack.swap(); break;
case OLDSCOPE: scope = scope.parent; break;
case GLOBALSCOPE: stack.push(scope.getGlobal()); break;
case SCOPEGET: stack.push(scope.get((JS)arg)); break;
- case SCOPEPUT: scope.put((JS)arg,stack.peek()); break;
- case ASSERT: if (!Script.toBoolean(stack.pop())) throw je("ibex.assertion.failed"); break;
- case BITNOT: stack.push(Script.N(~Script.toLong(stack.pop()))); break;
- case BANG: stack.push(Script.B(!Script.toBoolean(stack.pop()))); break;
+ case SCOPEPUT: scope.put((JS)arg, (JS)stack.peek()); break;
+ case ASSERT: if (!Script.toBoolean((JS)stack.pop())) throw je("ibex.assertion.failed"); break;
+ case BITNOT: stack.push(Script.N(~Script.toLong((JS)stack.pop()))); break;
+ case BANG: stack.push(Script.B(!Script.toBoolean((JS)stack.pop()))); break;
case NEWFUNCTION: stack.push(((JSFunction)arg)._cloneWithNewParentScope(scope)); break;
case LABEL: break;
int loopInstructionLocation = ((LoopMarker)o).location;
int endOfLoop = Script.toInt((JS)f.arg[loopInstructionLocation]) + loopInstructionLocation;
scope = ((LoopMarker)o).scope;
- if (op == CONTINUE) { stack.push(o); stack.push(JS.F); }
+ if (op == CONTINUE) { stack.push(o); stack.push(Script.F); }
pc = op == BREAK ? endOfLoop - 1 : loopInstructionLocation;
continue OUTER;
}
case CASCADE: {
boolean write = Script.toBoolean((JS)arg);
- JS val = write ? stack.pop() : null;
+ JS val = write ? (JS)stack.pop() : null;
CallMarker o = stack.findCall();
if(!(o instanceof TrapMarker)) throw new JSExn("tried to CASCADE while not in a trap");
TrapMarker tm = (TrapMarker) o;
boolean ret;
if(left == null && right == null) ret = true;
else if(left == null || right == null) ret = false;
- else ret = left.jsequals(right);
+ else ret = left.equals(right);
stack.push(Script.B(op == EQ ? ret : !ret)); break;
}
if(cm.f == null) break;
String s = cm.f.sourceName + ":" + cm.f.line[cm.pc-1];
if(cm instanceof Interpreter.TrapMarker)
- s += " (trap on " + Script.str(((Interpreter.TrapMarker)cm).t.key) + ")";
+ s += " (trap on " + Script.str(((Interpreter.TrapMarker)cm).t.key()) + ")";
e.addBacktrace(s);
}
}