diff --git a/js/src/debugger/Debugger.cpp b/js/src/debugger/Debugger.cpp index c14805b72cd6..54c2f7dc5f79 100644 --- a/js/src/debugger/Debugger.cpp +++ b/js/src/debugger/Debugger.cpp @@ -1806,7 +1806,7 @@ Completion Completion::fromJSFramePop(JSContext* cx, AbstractFramePtr frame, // possibility, so it's fine to call genObj->isClosed(). Rooted generatorObj( cx, GetGeneratorObjectForFrame(cx, frame)); - switch (JSOp(*pc)) { + switch (*pc) { case JSOP_INITIALYIELD: MOZ_ASSERT(!generatorObj->isClosed()); return Completion(InitialYield(generatorObj)); @@ -2120,7 +2120,7 @@ ResumeMode Debugger::fireEnterFrame(JSContext* cx, MutableHandleValue vp) { #if DEBUG // Assert that the hook won't be able to re-enter the generator. - if (iter.hasScript() && JSOp(*iter.pc()) == JSOP_AFTERYIELD) { + if (iter.hasScript() && *iter.pc() == JSOP_AFTERYIELD) { auto* genObj = GetGeneratorObjectForFrame(cx, iter.abstractFramePtr()); MOZ_ASSERT(genObj->isRunning()); } diff --git a/js/src/debugger/Script.cpp b/js/src/debugger/Script.cpp index 6226b1730dfa..0664052132fe 100644 --- a/js/src/debugger/Script.cpp +++ b/js/src/debugger/Script.cpp @@ -1710,6 +1710,7 @@ static bool BytecodeIsEffectful(JSOp op) { case JSOP_RETSUB: case JSOP_THROWMSG: case JSOP_FORCEINTERPRETER: + case JSOP_LIMIT: return false; } diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 461159247630..2570d70ca08f 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -340,7 +340,7 @@ bool BytecodeEmitter::emitN(JSOp op, size_t extra, BytecodeOffset* offset) { * Don't updateDepth if op's use-count comes from the immediate * operand yet to be stored in the extra bytes after op. */ - if (CodeSpec(op).nuses >= 0) { + if (CodeSpec[op].nuses >= 0) { bytecodeSection().updateDepth(off); } @@ -1654,7 +1654,7 @@ bool BytecodeEmitter::emitNewInit() { } jsbytecode* code = bytecodeSection().code(offset); - code[0] = jsbytecode(JSOP_NEWINIT); + code[0] = JSOP_NEWINIT; code[1] = 0; code[2] = 0; code[3] = 0; @@ -5878,7 +5878,7 @@ bool BytecodeEmitter::emitReturn(UnaryNode* returnNode) { return false; } } else if (isDerivedClassConstructor) { - MOZ_ASSERT(JSOp(bytecodeSection().code()[top.value()]) == JSOP_SETRVAL); + MOZ_ASSERT(bytecodeSection().code()[top.value()] == JSOP_SETRVAL); if (!emitReturnRval()) { return false; } @@ -5887,7 +5887,7 @@ bool BytecodeEmitter::emitReturn(UnaryNode* returnNode) { // If we are instrumenting, make sure we use RETRVAL and add any // instrumentation for the frame exit. instrumentationKinds) { - bytecodeSection().code()[top.value()] = jsbytecode(JSOP_SETRVAL); + bytecodeSection().code()[top.value()] = JSOP_SETRVAL; if (!emitReturnRval()) { return false; } @@ -8475,8 +8475,8 @@ bool BytecodeEmitter::replaceNewInitWithNewObject(JSObject* obj, jsbytecode* code = bytecodeSection().code(offset); - MOZ_ASSERT(JSOp(code[0]) == JSOP_NEWINIT); - code[0] = jsbytecode(JSOP_NEWOBJECT); + MOZ_ASSERT(code[0] == JSOP_NEWINIT); + code[0] = JSOP_NEWOBJECT; SET_UINT32(code, index); return true; diff --git a/js/src/frontend/TryEmitter.cpp b/js/src/frontend/TryEmitter.cpp index 041912f96c22..4c2b2532632d 100644 --- a/js/src/frontend/TryEmitter.cpp +++ b/js/src/frontend/TryEmitter.cpp @@ -72,7 +72,7 @@ bool TryEmitter::emitTryEnd() { // Patch the JSOP_TRY offset. jsbytecode* trypc = bce_->bytecodeSection().code(tryOpOffset_); BytecodeOffsetDiff offset = bce_->bytecodeSection().offset() - tryOpOffset_; - MOZ_ASSERT(JSOp(*trypc) == JSOP_TRY); + MOZ_ASSERT(*trypc == JSOP_TRY); SET_CODE_OFFSET(trypc, offset.value()); // Emit jump over catch and/or finally. diff --git a/js/src/gdb/tests/test-Interpreter.cpp b/js/src/gdb/tests/test-Interpreter.cpp index 06dd39fb48e4..55039275319f 100644 --- a/js/src/gdb/tests/test-Interpreter.cpp +++ b/js/src/gdb/tests/test-Interpreter.cpp @@ -52,7 +52,7 @@ FRAGMENT(Interpreter, Regs) { JS::Value slot1; JS::Value slot2; } fakeFrame; - uint8_t fakeOpcode = uint8_t(JSOP_TRUE); + uint8_t fakeOpcode = JSOP_TRUE; js::InterpreterRegs regs; js::GDBTestInitInterpreterRegs(regs, &fakeFrame.frame, &fakeFrame.slot2, diff --git a/js/src/gdb/tests/test-jsop.cpp b/js/src/gdb/tests/test-jsop.cpp index dd0c8453c15b..c80f3d587c6c 100644 --- a/js/src/gdb/tests/test-jsop.cpp +++ b/js/src/gdb/tests/test-jsop.cpp @@ -5,9 +5,11 @@ FRAGMENT(jsop, simple) { JSOp undefined = JSOP_UNDEFINED; JSOp debugger = JSOP_DEBUGGER; + JSOp limit = JSOP_LIMIT; breakpoint(); use(undefined); use(debugger); + use(limit); } diff --git a/js/src/gdb/tests/test-jsop.py b/js/src/gdb/tests/test-jsop.py index d3c07f53bcf0..6b10f08a800d 100644 --- a/js/src/gdb/tests/test-jsop.py +++ b/js/src/gdb/tests/test-jsop.py @@ -7,3 +7,4 @@ run_fragment('jsop.simple') assert_pretty('undefined', 'JSOP_UNDEFINED') assert_pretty('debugger', 'JSOP_DEBUGGER') +assert_pretty('limit', 'JSOP_LIMIT') diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp index c1f2c25fcde2..34cfe976e1b6 100644 --- a/js/src/jit/BaselineBailouts.cpp +++ b/js/src/jit/BaselineBailouts.cpp @@ -1082,7 +1082,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun, #ifdef JS_JITSPEW JitSpew(JitSpew_BaselineBailouts, " Resuming %s pc offset %d (op %s) (line %d) of %s:%u:%u", - resumeAfter ? "after" : "at", (int)pcOff, CodeName(op), + resumeAfter ? "after" : "at", (int)pcOff, CodeName[op], PCToLineNumber(script, pc), script->filename(), script->lineno(), script->column()); JitSpew(JitSpew_BaselineBailouts, " Bailout kind: %s", @@ -1141,7 +1141,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun, } snprintf(buf.get(), len, "%s %s %s on line %u of %s:%u", BailoutKindString(bailoutKind), resumeAfter ? "after" : "at", - CodeName(op), PCToLineNumber(script, pc), filename, + CodeName[op], PCToLineNumber(script, pc), filename, script->lineno()); cx->runtime()->geckoProfiler().markEvent(buf.get()); } diff --git a/js/src/jit/BaselineCodeGen.cpp b/js/src/jit/BaselineCodeGen.cpp index 7ccf2e921be1..b4dc87a8df51 100644 --- a/js/src/jit/BaselineCodeGen.cpp +++ b/js/src/jit/BaselineCodeGen.cpp @@ -6810,7 +6810,7 @@ MethodStatus BaselineCompiler::emitBody() { while (true) { JSOp op = JSOp(*handler.pc()); JitSpew(JitSpew_BaselineOp, "Compiling op @ %d: %s", - int(script->pcToOffset(handler.pc())), CodeName(op)); + int(script->pcToOffset(handler.pc())), CodeName[op]); BytecodeInfo* info = handler.analysis().maybeInfo(handler.pc()); @@ -6981,7 +6981,7 @@ bool BaselineInterpreterGenerator::emitInterpreterLoop() { Label opLabels[JSOP_LIMIT]; #define EMIT_OP(OP, ...) \ { \ - masm.bind(&opLabels[uint8_t(OP)]); \ + masm.bind(&opLabels[OP]); \ handler.setCurrentOp(OP); \ if (!this->emit_##OP()) { \ return false; \ diff --git a/js/src/jit/BaselineDebugModeOSR.cpp b/js/src/jit/BaselineDebugModeOSR.cpp index 2d55f82ef460..f251d25a8f6f 100644 --- a/js/src/jit/BaselineDebugModeOSR.cpp +++ b/js/src/jit/BaselineDebugModeOSR.cpp @@ -207,7 +207,7 @@ static void SpewPatchBaselineFrame(const uint8_t* oldReturnAddress, "Patch return %p -> %p on BaselineJS frame (%s:%u:%u) from %s at %s", oldReturnAddress, newReturnAddress, script->filename(), script->lineno(), script->column(), - RetAddrEntryKindToString(frameKind), CodeName(JSOp(*pc))); + RetAddrEntryKindToString(frameKind), CodeName[(JSOp)*pc]); } static void PatchBaselineFramesForDebugMode( diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index e2cec7a9087d..d707ec1bdc6e 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -1826,7 +1826,7 @@ bool DoGetElemFallback(JSContext* cx, BaselineFrame* frame, jsbytecode* pc = stub->icEntry()->pc(frame->script()); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "GetElem(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "GetElem(%s)", CodeName[op]); MOZ_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM); @@ -1892,7 +1892,7 @@ bool DoGetElemSuperFallback(JSContext* cx, BaselineFrame* frame, jsbytecode* pc = stub->icEntry()->pc(frame->script()); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "GetElemSuper(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "GetElemSuper(%s)", CodeName[op]); MOZ_ASSERT(op == JSOP_GETELEM_SUPER); @@ -2034,7 +2034,7 @@ bool DoSetElemFallback(JSContext* cx, BaselineFrame* frame, RootedScript outerScript(cx, script); jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "SetElem(%s)", CodeName(JSOp(*pc))); + FallbackICSpew(cx, stub, "SetElem(%s)", CodeName[JSOp(*pc)]); MOZ_ASSERT(op == JSOP_SETELEM || op == JSOP_STRICTSETELEM || op == JSOP_INITELEM || op == JSOP_INITHIDDENELEM || @@ -2318,7 +2318,7 @@ bool DoGetNameFallback(JSContext* cx, BaselineFrame* frame, RootedScript script(cx, frame->script()); jsbytecode* pc = stub->icEntry()->pc(script); mozilla::DebugOnly op = JSOp(*pc); - FallbackICSpew(cx, stub, "GetName(%s)", CodeName(JSOp(*pc))); + FallbackICSpew(cx, stub, "GetName(%s)", CodeName[JSOp(*pc)]); MOZ_ASSERT(op == JSOP_GETNAME || op == JSOP_GETGNAME); @@ -2368,7 +2368,7 @@ bool DoBindNameFallback(JSContext* cx, BaselineFrame* frame, jsbytecode* pc = stub->icEntry()->pc(frame->script()); mozilla::DebugOnly op = JSOp(*pc); - FallbackICSpew(cx, stub, "BindName(%s)", CodeName(JSOp(*pc))); + FallbackICSpew(cx, stub, "BindName(%s)", CodeName[JSOp(*pc)]); MOZ_ASSERT(op == JSOP_BINDNAME || op == JSOP_BINDGNAME); @@ -2413,7 +2413,7 @@ bool DoGetIntrinsicFallback(JSContext* cx, BaselineFrame* frame, RootedScript script(cx, frame->script()); jsbytecode* pc = stub->icEntry()->pc(script); mozilla::DebugOnly op = JSOp(*pc); - FallbackICSpew(cx, stub, "GetIntrinsic(%s)", CodeName(JSOp(*pc))); + FallbackICSpew(cx, stub, "GetIntrinsic(%s)", CodeName[JSOp(*pc)]); MOZ_ASSERT(op == JSOP_GETINTRINSIC); @@ -2489,7 +2489,7 @@ bool DoGetPropFallback(JSContext* cx, BaselineFrame* frame, RootedScript script(cx, frame->script()); jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "GetProp(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "GetProp(%s)", CodeName[op]); MOZ_ASSERT(op == JSOP_GETPROP || op == JSOP_CALLPROP || op == JSOP_LENGTH || op == JSOP_GETBOUNDNAME); @@ -2514,7 +2514,7 @@ bool DoGetPropSuperFallback(JSContext* cx, BaselineFrame* frame, RootedScript script(cx, frame->script()); jsbytecode* pc = stub->icEntry()->pc(script); - FallbackICSpew(cx, stub, "GetPropSuper(%s)", CodeName(JSOp(*pc))); + FallbackICSpew(cx, stub, "GetPropSuper(%s)", CodeName[JSOp(*pc)]); MOZ_ASSERT(JSOp(*pc) == JSOP_GETPROP_SUPER); @@ -2617,7 +2617,7 @@ bool DoSetPropFallback(JSContext* cx, BaselineFrame* frame, RootedScript script(cx, frame->script()); jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "SetProp(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "SetProp(%s)", CodeName[op]); MOZ_ASSERT(op == JSOP_SETPROP || op == JSOP_STRICTSETPROP || op == JSOP_SETNAME || op == JSOP_STRICTSETNAME || @@ -2819,7 +2819,7 @@ bool DoCallFallback(JSContext* cx, BaselineFrame* frame, ICCall_Fallback* stub, RootedScript script(cx, frame->script()); jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "Call(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "Call(%s)", CodeName[op]); MOZ_ASSERT(argc == GET_ARGC(pc)); bool constructing = (op == JSOP_NEW || op == JSOP_SUPERCALL); @@ -2962,7 +2962,7 @@ bool DoSpreadCallFallback(JSContext* cx, BaselineFrame* frame, jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); bool constructing = (op == JSOP_SPREADNEW || op == JSOP_SPREADSUPERCALL); - FallbackICSpew(cx, stub, "SpreadCall(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "SpreadCall(%s)", CodeName[op]); // Ensure vp array is rooted - we may GC in here. AutoArrayRooter vpRoot(cx, 3 + constructing, vp); @@ -3400,7 +3400,7 @@ bool DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, RootedScript script(cx, frame->script()); jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName[op]); // The unary operations take a copied val because the original value is needed // below. @@ -3476,7 +3476,7 @@ bool DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); FallbackICSpew( - cx, stub, "CacheIRBinaryArith(%s,%d,%d)", CodeName(op), + cx, stub, "CacheIRBinaryArith(%s,%d,%d)", CodeName[op], int(lhs.isDouble() ? JSVAL_TYPE_DOUBLE : lhs.extractNonDoubleType()), int(rhs.isDouble() ? JSVAL_TYPE_DOUBLE : rhs.extractNonDoubleType())); @@ -3601,7 +3601,7 @@ bool DoCompareFallback(JSContext* cx, BaselineFrame* frame, jsbytecode* pc = stub->icEntry()->pc(script); JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "Compare(%s)", CodeName(op)); + FallbackICSpew(cx, stub, "Compare(%s)", CodeName[op]); // Don't pass lhs/rhs directly, we need the original values when // generating stubs. diff --git a/js/src/jit/BaselineInspector.cpp b/js/src/jit/BaselineInspector.cpp index 862fb478cad5..7359dd1a2ec4 100644 --- a/js/src/jit/BaselineInspector.cpp +++ b/js/src/jit/BaselineInspector.cpp @@ -749,7 +749,7 @@ ObjectGroup* BaselineInspector::getTemplateObjectGroup(jsbytecode* pc) { } JSFunction* BaselineInspector::getSingleCallee(jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_NEW); + MOZ_ASSERT(*pc == JSOP_NEW); const ICEntry& entry = icEntryFromPC(pc); ICStub* stub = entry.firstStub(); @@ -1571,7 +1571,7 @@ MIRType BaselineInspector::expectedPropertyAccessInputType(jsbytecode* pc) { bool BaselineInspector::instanceOfData(jsbytecode* pc, Shape** shape, uint32_t* slot, JSObject** prototypeObject) { - MOZ_ASSERT(JSOp(*pc) == JSOP_INSTANCEOF); + MOZ_ASSERT(*pc == JSOP_INSTANCEOF); const ICEntry& entry = icEntryFromPC(pc); ICStub* firstStub = entry.firstStub(); diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp index 1c2b01be8216..47d27c0878f8 100644 --- a/js/src/jit/BaselineJIT.cpp +++ b/js/src/jit/BaselineJIT.cpp @@ -410,7 +410,7 @@ bool jit::BaselineCompileFromBaselineInterpreter(JSContext* cx, RootedScript script(cx, frame->script()); jsbytecode* pc = frame->interpreterPC(); - MOZ_ASSERT(pc == script->code() || JSOp(*pc) == JSOP_LOOPHEAD); + MOZ_ASSERT(pc == script->code() || *pc == JSOP_LOOPHEAD); MethodStatus status = CanEnterBaselineJIT(cx, script, /* osrSourceFrame = */ frame); @@ -424,7 +424,7 @@ bool jit::BaselineCompileFromBaselineInterpreter(JSContext* cx, return true; case Method_Compiled: { - if (JSOp(*pc) == JSOP_LOOPHEAD) { + if (*pc == JSOP_LOOPHEAD) { MOZ_ASSERT(pc > script->code(), "Prologue vs OSR cases must not be ambiguous"); BaselineScript* baselineScript = script->baselineScript(); diff --git a/js/src/jit/BytecodeAnalysis.cpp b/js/src/jit/BytecodeAnalysis.cpp index 3a52971ceeaa..dc65e8213cd5 100644 --- a/js/src/jit/BytecodeAnalysis.cpp +++ b/js/src/jit/BytecodeAnalysis.cpp @@ -52,7 +52,7 @@ bool BytecodeAnalysis::init(TempAllocator& alloc) { uint32_t offset = it.bytecodeToOffset(script_); JitSpew(JitSpew_BaselineOp, "Analyzing op @ %u (end=%u): %s", - unsigned(offset), unsigned(script_->length()), CodeName(op)); + unsigned(offset), unsigned(script_->length()), CodeName[op]); // If this bytecode info has not yet been initialized, it's not reachable. if (!infos_[offset].initialized) { diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index b5a65aba8789..e174508dbf1e 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -514,7 +514,7 @@ static bool IsCacheableNoProperty(JSContext* cx, JSObject* obj, // If we're doing a name lookup, we have to throw a ReferenceError. If // extra warnings are enabled, we may have to report a warning. // Note that Ion does not generate idempotent caches for JSOP_GETBOUNDNAME. - if ((pc && JSOp(*pc) == JSOP_GETBOUNDNAME) || + if ((pc && *pc == JSOP_GETBOUNDNAME) || cx->realm()->behaviors().extraWarnings(cx)) { return false; } diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h index d2a71e423ad2..2221acffaf7f 100644 --- a/js/src/jit/CacheIR.h +++ b/js/src/jit/CacheIR.h @@ -2023,87 +2023,91 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter { writeOperandId(rhs); } - void compareStringResult(JSOp op, StringOperandId lhs, StringOperandId rhs) { + void compareStringResult(uint32_t op, StringOperandId lhs, + StringOperandId rhs) { writeOpWithOperandId(CacheOp::CompareStringResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareObjectResult(JSOp op, ObjOperandId lhs, ObjOperandId rhs) { + void compareObjectResult(uint32_t op, ObjOperandId lhs, ObjOperandId rhs) { writeOpWithOperandId(CacheOp::CompareObjectResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareObjectUndefinedNullResult(JSOp op, ObjOperandId object) { + void compareObjectUndefinedNullResult(uint32_t op, ObjOperandId object) { writeOpWithOperandId(CacheOp::CompareObjectUndefinedNullResult, object); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareSymbolResult(JSOp op, SymbolOperandId lhs, SymbolOperandId rhs) { + void compareSymbolResult(uint32_t op, SymbolOperandId lhs, + SymbolOperandId rhs) { writeOpWithOperandId(CacheOp::CompareSymbolResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareInt32Result(JSOp op, Int32OperandId lhs, Int32OperandId rhs) { + void compareInt32Result(uint32_t op, Int32OperandId lhs, Int32OperandId rhs) { writeOpWithOperandId(CacheOp::CompareInt32Result, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareDoubleResult(JSOp op, NumberOperandId lhs, NumberOperandId rhs) { + void compareDoubleResult(uint32_t op, NumberOperandId lhs, + NumberOperandId rhs) { writeOpWithOperandId(CacheOp::CompareDoubleResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareBigIntResult(JSOp op, BigIntOperandId lhs, BigIntOperandId rhs) { + void compareBigIntResult(uint32_t op, BigIntOperandId lhs, + BigIntOperandId rhs) { writeOpWithOperandId(CacheOp::CompareBigIntResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareBigIntInt32Result(JSOp op, BigIntOperandId lhs, + void compareBigIntInt32Result(uint32_t op, BigIntOperandId lhs, Int32OperandId rhs) { writeOpWithOperandId(CacheOp::CompareBigIntInt32Result, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareInt32BigIntResult(JSOp op, Int32OperandId lhs, + void compareInt32BigIntResult(uint32_t op, Int32OperandId lhs, BigIntOperandId rhs) { writeOpWithOperandId(CacheOp::CompareInt32BigIntResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareBigIntNumberResult(JSOp op, BigIntOperandId lhs, + void compareBigIntNumberResult(uint32_t op, BigIntOperandId lhs, NumberOperandId rhs) { writeOpWithOperandId(CacheOp::CompareBigIntNumberResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareNumberBigIntResult(JSOp op, NumberOperandId lhs, + void compareNumberBigIntResult(uint32_t op, NumberOperandId lhs, BigIntOperandId rhs) { writeOpWithOperandId(CacheOp::CompareNumberBigIntResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareBigIntStringResult(JSOp op, BigIntOperandId lhs, + void compareBigIntStringResult(uint32_t op, BigIntOperandId lhs, StringOperandId rhs) { writeOpWithOperandId(CacheOp::CompareBigIntStringResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } - void compareStringBigIntResult(JSOp op, StringOperandId lhs, + void compareStringBigIntResult(uint32_t op, StringOperandId lhs, BigIntOperandId rhs) { writeOpWithOperandId(CacheOp::CompareStringBigIntResult, lhs); writeOperandId(rhs); - buffer_.writeByte(uint8_t(op)); + buffer_.writeByte(uint32_t(op)); } void callPrintString(const char* str) { diff --git a/js/src/jit/CacheIRSpewer.cpp b/js/src/jit/CacheIRSpewer.cpp index ce3f9368fc0c..bf77611114c9 100644 --- a/js/src/jit/CacheIRSpewer.cpp +++ b/js/src/jit/CacheIRSpewer.cpp @@ -189,7 +189,7 @@ void CacheIRSpewer::opcodeProperty(const char* name, const JSOp op) { JSONPrinter& j = json_.ref(); j.beginStringProperty(name); - output_.put(CodeName(op)); + output_.put(CodeName[op]); j.endStringProperty(); } diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index a3505a63a349..e53c553ea8d2 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -6178,7 +6178,7 @@ static void DumpTrackedSite(const BytecodeSite* site) { unsigned column = 0; unsigned lineNumber = PCToLineNumber(site->script(), site->pc(), &column); JitSpew(JitSpew_OptimizationTracking, "Types for %s at %s:%u:%u", - CodeName(JSOp(*site->pc())), site->script()->filename(), lineNumber, + CodeName[JSOp(*site->pc())], site->script()->filename(), lineNumber, column); #endif } @@ -11106,7 +11106,7 @@ void CodeGenerator::visitCallGetElement(LCallGetElement* lir) { pushArg(ToValue(lir, LCallGetElement::RhsInput)); pushArg(ToValue(lir, LCallGetElement::LhsInput)); - uint8_t op = *lir->mir()->resumePoint()->pc(); + JSOp op = JSOp(*lir->mir()->resumePoint()->pc()); pushArg(Imm32(op)); using Fn = diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index acaab2561f9b..9c5779a1a96c 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -1124,7 +1124,7 @@ static void EliminateTriviallyDeadResumePointOperands(MIRGraph& graph, MResumePoint* rp) { // If we will pop the top of the stack immediately after resuming, // then don't preserve the top value in the resume point. - if (rp->mode() != MResumePoint::ResumeAt || JSOp(*rp->pc()) != JSOP_POP) { + if (rp->mode() != MResumePoint::ResumeAt || *rp->pc() != JSOP_POP) { return; } @@ -4742,7 +4742,7 @@ static bool ArgumentsUseCanBeLazy(JSContext* cx, JSScript* script, bool* argumentsContentsObserved) { // We can read the frame's arguments directly for f.apply(x, arguments). if (ins->isCall()) { - if (JSOp(*ins->toCall()->resumePoint()->pc()) == JSOP_FUNAPPLY && + if (*ins->toCall()->resumePoint()->pc() == JSOP_FUNAPPLY && ins->toCall()->numActualArgs() == 2 && index == MCall::IndexOfArgument(1)) { *argumentsContentsObserved = true; diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 509874441f39..7ab2087342db 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -1756,7 +1756,7 @@ AbortReasonOr IonBuilder::startTraversingBlock(MBasicBlock* block) { } AbortReasonOr IonBuilder::jsop_goto(bool* restarted) { - MOZ_ASSERT(JSOp(*pc) == JSOP_GOTO); + MOZ_ASSERT(*pc == JSOP_GOTO); if (IsBackedgePC(pc)) { return visitBackEdge(restarted); @@ -1801,7 +1801,7 @@ AbortReasonOr IonBuilder::jsop_loophead() { // ... // IFNE/GOTO to LOOPHEAD - MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD); + MOZ_ASSERT(*pc == JSOP_LOOPHEAD); if (hasTerminatedBlock()) { // The whole loop is unreachable. @@ -2101,7 +2101,7 @@ AbortReasonOr IonBuilder::inspectOpcode(JSOp op, bool* restarted) { // SET* opcodes. Place a resume point afterwards to avoid capturing // the dead value in later snapshots, except in places where that // resume point is obviously unnecessary. - if (JSOp(pc[JSOP_POP_LENGTH]) == JSOP_POP) { + if (pc[JSOP_POP_LENGTH] == JSOP_POP) { return Ok(); } if (def->isConstant()) { @@ -2180,8 +2180,8 @@ AbortReasonOr IonBuilder::inspectOpcode(JSOp op, bool* restarted) { case JSOP_CALLITER: case JSOP_NEW: MOZ_TRY(jsop_call(GET_ARGC(pc), - JSOp(*pc) == JSOP_NEW || JSOp(*pc) == JSOP_SUPERCALL, - JSOp(*pc) == JSOP_CALL_IGNORES_RV)); + (JSOp)*pc == JSOP_NEW || (JSOp)*pc == JSOP_SUPERCALL, + (JSOp)*pc == JSOP_CALL_IGNORES_RV)); if (op == JSOP_CALLITER) { if (!outermostBuilder()->iterators_.append(current->peek(-1))) { return abort(AbortReason::Alloc); @@ -2571,6 +2571,9 @@ AbortReasonOr IonBuilder::inspectOpcode(JSOp op, bool* restarted) { case JSOP_FORCEINTERPRETER: // Intentionally not implemented. break; + + case JSOP_LIMIT: + break; } // Track a simpler message, since the actionable abort message is a @@ -2578,10 +2581,9 @@ AbortReasonOr IonBuilder::inspectOpcode(JSOp op, bool* restarted) { // thing anyways. trackActionableAbort("Unsupported bytecode"); #ifdef DEBUG - return abort(AbortReason::Disable, "Unsupported opcode: %s", CodeName(op)); + return abort(AbortReason::Disable, "Unsupported opcode: %s", CodeName[op]); #else - return abort(AbortReason::Disable, "Unsupported opcode: %d", - int(uint8_t(op))); + return abort(AbortReason::Disable, "Unsupported opcode: %d", op); #endif } @@ -6197,7 +6199,7 @@ AbortReasonOr IonBuilder::jsop_call(uint32_t argc, bool constructing, if (observed->empty()) { if (BytecodeFlowsToBitop(pc)) { observed->addType(TypeSet::Int32Type(), alloc_->lifoAlloc()); - } else if (JSOp(*GetNextPc(pc)) == JSOP_POS) { + } else if (*GetNextPc(pc) == JSOP_POS) { // Note: this is lame, overspecialized on the code patterns used // by asm.js and should be replaced by a more general mechanism. // See bug 870847. @@ -7279,7 +7281,7 @@ AbortReasonOr IonBuilder::jsop_newobject() { } AbortReasonOr IonBuilder::jsop_initelem() { - MOZ_ASSERT(JSOp(*pc) == JSOP_INITELEM || JSOp(*pc) == JSOP_INITHIDDENELEM); + MOZ_ASSERT(*pc == JSOP_INITELEM || *pc == JSOP_INITHIDDENELEM); MDefinition* value = current->pop(); MDefinition* id = current->pop(); @@ -7287,7 +7289,7 @@ AbortReasonOr IonBuilder::jsop_initelem() { bool emitted = false; - if (!forceInlineCaches() && JSOp(*pc) == JSOP_INITELEM) { + if (!forceInlineCaches() && *pc == JSOP_INITELEM) { MOZ_TRY(initOrSetElemTryDense(&emitted, obj, id, value, /* writeHole = */ true)); if (emitted) { @@ -7321,8 +7323,7 @@ AbortReasonOr IonBuilder::jsop_initelem_inc() { AbortReasonOr IonBuilder::initArrayElement(MDefinition* obj, MDefinition* id, MDefinition* value) { - MOZ_ASSERT(JSOp(*pc) == JSOP_INITELEM_ARRAY || - JSOp(*pc) == JSOP_INITELEM_INC); + MOZ_ASSERT(*pc == JSOP_INITELEM_ARRAY || *pc == JSOP_INITELEM_INC); bool emitted = false; @@ -7356,8 +7357,7 @@ AbortReasonOr IonBuilder::initArrayElemTryFastPath(bool* emitted, MDefinition* id, MDefinition* value) { MOZ_ASSERT(*emitted == false); - MOZ_ASSERT(JSOp(*pc) == JSOP_INITELEM_ARRAY || - JSOp(*pc) == JSOP_INITELEM_INC); + MOZ_ASSERT(*pc == JSOP_INITELEM_ARRAY || *pc == JSOP_INITELEM_INC); // Make sure that arrays have the type being written to them by the // intializer, and that arrays are marked as non-packed when writing holes @@ -7979,7 +7979,7 @@ static bool ObjectHasExtraOwnProperty(CompileRealm* realm, } void IonBuilder::insertRecompileCheck(jsbytecode* pc) { - MOZ_ASSERT(pc == script()->code() || JSOp(*pc) == JSOP_LOOPHEAD); + MOZ_ASSERT(pc == script()->code() || *pc == JSOP_LOOPHEAD); // No need for recompile checks if this is the highest optimization level or // if we're performing an analysis instead of compilation. @@ -7994,7 +7994,7 @@ void IonBuilder::insertRecompileCheck(jsbytecode* pc) { // works. MRecompileCheck::RecompileCheckType type; - if (JSOp(*pc) == JSOP_LOOPHEAD) { + if (*pc == JSOP_LOOPHEAD) { type = MRecompileCheck::RecompileCheckType::OptimizationLevelOSR; } else if (this != outermostBuilder()) { type = MRecompileCheck::RecompileCheckType::OptimizationLevelInlined; @@ -11212,7 +11212,7 @@ MDefinition* IonBuilder::maybeUnboxForPropertyAccess(MDefinition* def) { // If we have better type information to unbox the first copy going into // the CALLPROP operation, we can replace the duplicated copy on the // stack as well. - if (JSOp(*pc) == JSOP_CALLPROP || JSOp(*pc) == JSOP_CALLELEM) { + if (*pc == JSOP_CALLPROP || *pc == JSOP_CALLELEM) { uint32_t idx = current->stackDepth() - 1; MOZ_ASSERT(current->getSlot(idx) == def); current->setSlot(idx, unbox); @@ -11381,7 +11381,7 @@ AbortReasonOr IonBuilder::improveThisTypesForCall() { // at this point we can remove null and undefined from obj's TypeSet, to // improve type information for the call that will follow. - MOZ_ASSERT(JSOp(*pc) == JSOP_CALLPROP || JSOp(*pc) == JSOP_CALLELEM); + MOZ_ASSERT(*pc == JSOP_CALLPROP || *pc == JSOP_CALLELEM); // Ensure |this| has types {object, null/undefined}. For simplicity don't // optimize if the callee is a Phi (this can happen in rare cases after @@ -12225,7 +12225,7 @@ AbortReasonOr IonBuilder::getPropAddCache(MDefinition* obj, } load->setResultType(rvalType); - if (JSOp(*pc) != JSOP_CALLPROP || !IsNullOrUndefined(obj->type())) { + if (*pc != JSOP_CALLPROP || !IsNullOrUndefined(obj->type())) { // Due to inlining, it's possible the observed TypeSet is non-empty, // even though we know |obj| is null/undefined and the MCallGetProperty // will throw. Don't push a TypeBarrier in this case, to avoid diff --git a/js/src/jit/IonBuilder.h b/js/src/jit/IonBuilder.h index c6e5ef002904..b997608a00ef 100644 --- a/js/src/jit/IonBuilder.h +++ b/js/src/jit/IonBuilder.h @@ -121,9 +121,9 @@ class PendingEdge { private: MBasicBlock* block_; Kind kind_; - JSOp testOp_ = JSOP_UNDEFINED; + JSOp testOp_ = JSOP_LIMIT; - PendingEdge(MBasicBlock* block, Kind kind, JSOp testOp = JSOP_UNDEFINED) + PendingEdge(MBasicBlock* block, Kind kind, JSOp testOp = JSOP_LIMIT) : block_(block), kind_(kind), testOp_(testOp) {} public: diff --git a/js/src/jit/IonIC.cpp b/js/src/jit/IonIC.cpp index 6ca53ac4d977..b2477bb6414a 100644 --- a/js/src/jit/IonIC.cpp +++ b/js/src/jit/IonIC.cpp @@ -322,7 +322,7 @@ bool IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript, jsbytecode* pc = ic->pc(); if (ic->kind() == CacheKind::SetElem) { - if (JSOp(*pc) == JSOP_INITELEM_INC || JSOp(*pc) == JSOP_INITELEM_ARRAY) { + if (*pc == JSOP_INITELEM_INC || *pc == JSOP_INITELEM_ARRAY) { if (!InitArrayElemOperation(cx, pc, obj, idVal.toInt32(), rhs)) { return false; } @@ -339,7 +339,7 @@ bool IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript, } else { MOZ_ASSERT(ic->kind() == CacheKind::SetProp); - if (JSOp(*pc) == JSOP_INITGLEXICAL) { + if (*pc == JSOP_INITGLEXICAL) { RootedScript script(cx, ic->script()); MOZ_ASSERT(!script->hasNonSyntacticScope()); InitGlobalLexicalOperation(cx, &cx->global()->lexicalEnvironment(), @@ -421,7 +421,7 @@ bool IonGetNameIC::update(JSContext* cx, HandleScript outerScript, return false; } - if (JSOp(*GetNextPc(pc)) == JSOP_TYPEOF) { + if (*GetNextPc(pc) == JSOP_TYPEOF) { if (!FetchName(cx, obj, holder, name, prop, res)) { return false; } diff --git a/js/src/jit/IonOptimizationLevels.cpp b/js/src/jit/IonOptimizationLevels.cpp index 0af811874461..a6565145fb67 100644 --- a/js/src/jit/IonOptimizationLevels.cpp +++ b/js/src/jit/IonOptimizationLevels.cpp @@ -122,10 +122,10 @@ uint32_t OptimizationInfo::compilerWarmUpThreshold(JSScript* script, uint32_t OptimizationInfo::recompileWarmUpThreshold(JSScript* script, jsbytecode* pc) const { - MOZ_ASSERT(pc == script->code() || JSOp(*pc) == JSOP_LOOPHEAD); + MOZ_ASSERT(pc == script->code() || *pc == JSOP_LOOPHEAD); uint32_t threshold = compilerWarmUpThreshold(script, pc); - if (JSOp(*pc) != JSOP_LOOPHEAD || JitOptions.eagerIonCompilation()) { + if (*pc != JSOP_LOOPHEAD || JitOptions.eagerIonCompilation()) { return threshold; } diff --git a/js/src/jit/JSJitFrameIter.cpp b/js/src/jit/JSJitFrameIter.cpp index 3524e70f1b24..9b1cc11b37b4 100644 --- a/js/src/jit/JSJitFrameIter.cpp +++ b/js/src/jit/JSJitFrameIter.cpp @@ -317,7 +317,7 @@ void JSJitFrameIter::dumpBaseline() const { fprintf(stderr, " script = %p, pc = %p (offset %u)\n", (void*)script, pc, uint32_t(script->pcToOffset(pc))); - fprintf(stderr, " current op: %s\n", CodeName(JSOp(*pc))); + fprintf(stderr, " current op: %s\n", CodeName[*pc]); fprintf(stderr, " actual args: %d\n", numActualArgs()); diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp index 47be600b72e2..7d471195b2ef 100644 --- a/js/src/jit/JitFrames.cpp +++ b/js/src/jit/JitFrames.cpp @@ -2252,7 +2252,7 @@ void InlineFrameIterator::dump() const { script()->lineno()); fprintf(stderr, " script = %p, pc = %p\n", (void*)script(), pc()); - fprintf(stderr, " current op: %s\n", CodeName(JSOp(*pc()))); + fprintf(stderr, " current op: %s\n", CodeName[*pc()]); if (!more()) { numActualArgs(); diff --git a/js/src/jit/JitScript.cpp b/js/src/jit/JitScript.cpp index 45232dee887a..cd09a6895a71 100644 --- a/js/src/jit/JitScript.cpp +++ b/js/src/jit/JitScript.cpp @@ -702,7 +702,7 @@ void jit::JitSpewBaselineICStats(JSScript* script, const char* dumpReason) { unsigned int line = PCToLineNumber(script, pc, &column); spew->beginObject(); - spew->property("op", CodeName(JSOp(*pc))); + spew->property("op", CodeName[*pc]); spew->property("pc", pcOffset); spew->property("line", line); spew->property("column", column); diff --git a/js/src/jit/JitcodeMap.cpp b/js/src/jit/JitcodeMap.cpp index b1b3a0529eb8..2bffc456063a 100644 --- a/js/src/jit/JitcodeMap.cpp +++ b/js/src/jit/JitcodeMap.cpp @@ -1293,7 +1293,7 @@ bool JitcodeRegionEntry::WriteRun(CompactBufferWriter& writer, jsbytecode* pc = entry[i].tree->script()->offsetToPC(curBc); #ifdef JS_JITSPEW JSOp op = JSOp(*pc); - JitSpewCont(JitSpew_Profiling, "%s ", CodeName(op)); + JitSpewCont(JitSpew_Profiling, "%s ", CodeName[op]); #endif curBc += GetBytecodeLength(pc); } diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index 985dcefceec7..4d839088d47c 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -1264,7 +1264,7 @@ void MControlInstruction::printOpcode(GenericPrinter& out) const { void MCompare::printOpcode(GenericPrinter& out) const { MDefinition::printOpcode(out); - out.printf(" %s", CodeName(jsop())); + out.printf(" %s", CodeName[jsop()]); } void MConstantElements::printOpcode(GenericPrinter& out) const { diff --git a/js/src/jit/Snapshots.cpp b/js/src/jit/Snapshots.cpp index d2c8befc323f..e7bdcc6f2548 100644 --- a/js/src/jit/Snapshots.cpp +++ b/js/src/jit/Snapshots.cpp @@ -466,7 +466,7 @@ void SnapshotReader::spewBailingFrom() const { if (JitSpewEnabled(JitSpew_IonBailouts)) { JitSpewHeader(JitSpew_IonBailouts); Fprinter& out = JitSpewPrinter(); - out.printf(" bailing from bytecode: %s, MIR: ", CodeName(JSOp(pcOpcode_))); + out.printf(" bailing from bytecode: %s, MIR: ", CodeName[pcOpcode_]); MDefinition::PrintOpcodeName(out, MDefinition::Opcode(mirOpcode_)); out.printf(" [%u], LIR: ", mirId_); LInstruction::printName(out, LInstruction::Opcode(lirOpcode_)); diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp index fb2c7b451d23..6284d9a05daf 100644 --- a/js/src/jit/VMFunctions.cpp +++ b/js/src/jit/VMFunctions.cpp @@ -899,7 +899,7 @@ JSObject* CreateGenerator(JSContext* cx, BaselineFrame* frame) { bool NormalSuspend(JSContext* cx, HandleObject obj, BaselineFrame* frame, uint32_t frameSize, jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_YIELD || JSOp(*pc) == JSOP_AWAIT); + MOZ_ASSERT(*pc == JSOP_YIELD || *pc == JSOP_AWAIT); uint32_t numValueSlots = frame->numValueSlots(frameSize); @@ -929,7 +929,7 @@ bool NormalSuspend(JSContext* cx, HandleObject obj, BaselineFrame* frame, } bool FinalSuspend(JSContext* cx, HandleObject obj, jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_FINALYIELDRVAL); + MOZ_ASSERT(*pc == JSOP_FINALYIELDRVAL); AbstractGeneratorObject::finalSuspend(obj); return true; } @@ -1067,7 +1067,7 @@ bool HandleDebugTrap(JSContext* cx, BaselineFrame* frame, uint8_t* retAddr) { DebugAPI::hasBreakpointsAt(script, pc)); } - if (JSOp(*pc) == JSOP_AFTERYIELD) { + if (*pc == JSOP_AFTERYIELD) { // JSOP_AFTERYIELD will set the frame's debuggee flag and call the // onEnterFrame handler, but if we set a breakpoint there we have to do // it now. diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/CodeGenerator-shared.cpp index aaf72fb5228f..9a51ec0c5ab9 100644 --- a/js/src/jit/shared/CodeGenerator-shared.cpp +++ b/js/src/jit/shared/CodeGenerator-shared.cpp @@ -315,7 +315,7 @@ void CodeGeneratorShared::dumpNativeToBytecodeEntry(uint32_t idx) { JitSpewStart( JitSpew_Profiling, " %08zx [+%-6d] => %-6ld [%-4d] {%-10s} (%s:%u:%u", ref.nativeOffset.offset(), nativeDelta, (long)(ref.pc - script->code()), - pcDelta, CodeName(JSOp(*ref.pc)), script->filename(), script->lineno(), + pcDelta, CodeName[JSOp(*ref.pc)], script->filename(), script->lineno(), script->column()); for (tree = tree->caller(); tree; tree = tree->caller()) { diff --git a/js/src/jit/shared/LIR-shared.h b/js/src/jit/shared/LIR-shared.h index 5ac2e783d915..4061e921f34e 100644 --- a/js/src/jit/shared/LIR-shared.h +++ b/js/src/jit/shared/LIR-shared.h @@ -1510,7 +1510,7 @@ class LCompare : public LInstructionHelper<1, 2, 0> { const LAllocation* left() { return getOperand(0); } const LAllocation* right() { return getOperand(1); } MCompare* mir() { return mir_->toCompare(); } - const char* extraName() const { return CodeName(jsop_); } + const char* extraName() const { return CodeName[jsop_]; } }; class LCompareI64 : public LInstructionHelper<1, 2 * INT64_PIECES, 0> { @@ -1531,7 +1531,7 @@ class LCompareI64 : public LInstructionHelper<1, 2 * INT64_PIECES, 0> { JSOp jsop() const { return jsop_; } MCompare* mir() { return mir_->toCompare(); } - const char* extraName() const { return CodeName(jsop_); } + const char* extraName() const { return CodeName[jsop_]; } }; class LCompareI64AndBranch @@ -1561,7 +1561,7 @@ class LCompareI64AndBranch MBasicBlock* ifFalse() const { return getSuccessor(1); } MTest* mir() const { return mir_->toTest(); } MCompare* cmpMir() const { return cmpMir_; } - const char* extraName() const { return CodeName(jsop_); } + const char* extraName() const { return CodeName[jsop_]; } }; // Compares two integral values of the same JS type, either integer or object. @@ -1589,7 +1589,7 @@ class LCompareAndBranch : public LControlInstructionHelper<2, 2, 0> { const LAllocation* right() { return getOperand(1); } MTest* mir() const { return mir_->toTest(); } MCompare* cmpMir() const { return cmpMir_; } - const char* extraName() const { return CodeName(jsop_); } + const char* extraName() const { return CodeName[jsop_]; } }; class LCompareD : public LInstructionHelper<1, 2, 0> { @@ -2089,7 +2089,7 @@ class LBitOpI : public LInstructionHelper<1, 2, 0> { if (bitop() == JSOP_URSH && mir_->toUrsh()->bailoutsDisabled()) { return "ursh:BailoutsDisabled"; } - return CodeName(op_); + return CodeName[op_]; } JSOp bitop() const { return op_; } @@ -2106,7 +2106,7 @@ class LBitOpI64 : public LInstructionHelper { explicit LBitOpI64(JSOp op) : LInstructionHelper(classOpcode), op_(op) {} - const char* extraName() const { return CodeName(op_); } + const char* extraName() const { return CodeName[op_]; } JSOp bitop() const { return op_; } }; @@ -2125,7 +2125,7 @@ class LShiftI : public LBinaryMath<0> { MInstruction* mir() { return mir_->toInstruction(); } - const char* extraName() const { return CodeName(op_); } + const char* extraName() const { return CodeName[op_]; } }; class LShiftI64 : public LInstructionHelper { @@ -2143,7 +2143,7 @@ class LShiftI64 : public LInstructionHelper { MInstruction* mir() { return mir_->toInstruction(); } - const char* extraName() const { return CodeName(op_); } + const char* extraName() const { return CodeName[op_]; } }; // Sign extension @@ -2674,7 +2674,7 @@ class LMathD : public LBinaryMath<0> { JSOp jsop() const { return jsop_; } - const char* extraName() const { return CodeName(jsop_); } + const char* extraName() const { return CodeName[jsop_]; } }; // Performs an add, sub, mul, or div on two double values. @@ -2688,7 +2688,7 @@ class LMathF : public LBinaryMath<0> { JSOp jsop() const { return jsop_; } - const char* extraName() const { return CodeName(jsop_); } + const char* extraName() const { return CodeName[jsop_]; } }; class LModD : public LBinaryMath<1> { @@ -2721,7 +2721,7 @@ class LBinaryV : public LCallInstructionHelper { JSOp jsop() const { return jsop_; } - const char* extraName() const { return CodeName(jsop_); } + const char* extraName() const { return CodeName[jsop_]; } static const size_t LhsInput = 0; static const size_t RhsInput = BOX_PIECES; diff --git a/js/src/vm/BytecodeUtil.cpp b/js/src/vm/BytecodeUtil.cpp index 57f0b456e666..d711dcfbf0ac 100644 --- a/js/src/vm/BytecodeUtil.cpp +++ b/js/src/vm/BytecodeUtil.cpp @@ -65,9 +65,8 @@ using js::frontend::IsIdentifier; */ JS_STATIC_ASSERT(sizeof(uint32_t) * CHAR_BIT >= INDEX_LIMIT_LOG2 + 1); -const JSCodeSpec js::CodeSpecTable[] = { -#define MAKE_CODESPEC(op, op_camel, op_snake, name, token, length, nuses, \ - ndefs, format) \ +const JSCodeSpec js::CodeSpec[] = { +#define MAKE_CODESPEC(op, name, token, length, nuses, ndefs, format) \ {length, nuses, ndefs, format}, FOR_EACH_OPCODE(MAKE_CODESPEC) #undef MAKE_CODESPEC @@ -78,7 +77,7 @@ const JSCodeSpec js::CodeSpecTable[] = { * bytecode or null. */ static const char* const CodeToken[] = { -#define TOKEN(op, op_camel, op_snake, name, token, ...) token, +#define TOKEN(op, name, token, ...) token, FOR_EACH_OPCODE(TOKEN) #undef TOKEN }; @@ -87,8 +86,8 @@ static const char* const CodeToken[] = { * Array of JS bytecode names used by PC count JSON, DEBUG-only Disassemble * and JIT debug spew. */ -const char* const js::CodeNameTable[] = { -#define OPNAME(op, op_camel, op_snake, name, ...) name, +const char* const js::CodeName[] = { +#define OPNAME(op, name, ...) name, FOR_EACH_OPCODE(OPNAME) #undef OPNAME }; @@ -838,8 +837,8 @@ bool BytecodeParser::parse() { // Next bytecode to analyze. nextOffset = offset + GetBytecodeLength(pc); - MOZ_ASSERT(*pc < JSOP_LIMIT); - JSOp op = JSOp(*pc); + JSOp op = (JSOp)*pc; + MOZ_ASSERT(op < JSOP_LIMIT); if (!code) { // Haven't found a path by which this bytecode is reachable. @@ -1292,7 +1291,7 @@ static bool DumpJumpOrigins(HandleScript script, jsbytecode* pc, break; } - if (!sp->jsprintf("from %s @ %05u", CodeName(JSOp(*pc)), + if (!sp->jsprintf("from %s @ %05u", CodeName[*pc], unsigned(script->pcToOffset(pc)))) { return false; } @@ -1377,17 +1376,17 @@ static unsigned Disassemble1(JSContext* cx, HandleScript script, jsbytecode* pc, return true; }; - if (*pc >= JSOP_LIMIT) { + JSOp op = (JSOp)*pc; + if (op >= JSOP_LIMIT) { char numBuf1[12], numBuf2[12]; - SprintfLiteral(numBuf1, "%d", int(*pc)); + SprintfLiteral(numBuf1, "%d", op); SprintfLiteral(numBuf2, "%d", JSOP_LIMIT); JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BYTECODE_TOO_BIG, numBuf1, numBuf2); return 0; } - JSOp op = JSOp(*pc); - const JSCodeSpec& cs = CodeSpec(op); - const unsigned len = cs.length; + const JSCodeSpec* cs = &CodeSpec[op]; + const unsigned len = cs->length; if (!sp->jsprintf("%05u:", loc)) { return 0; } @@ -1396,12 +1395,12 @@ static unsigned Disassemble1(JSContext* cx, HandleScript script, jsbytecode* pc, return 0; } } - if (!sp->jsprintf(" %s", CodeName(op))) { + if (!sp->jsprintf(" %s", CodeName[op])) { return 0; } int i; - switch (JOF_TYPE(cs.format)) { + switch (JOF_TYPE(cs->format)) { case JOF_BYTE: break; @@ -1622,7 +1621,7 @@ static unsigned Disassemble1(JSContext* cx, HandleScript script, jsbytecode* pc, default: { char numBuf[12]; - SprintfLiteral(numBuf, "%x", cs.format); + SprintfLiteral(numBuf, "%x", cs->format); JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_UNKNOWN_FORMAT, numBuf); return 0; @@ -1728,12 +1727,12 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) { JSOp op = (JSOp)*pc; - if (const char* token = CodeToken[uint8_t(op)]) { + if (const char* token = CodeToken[op]) { MOZ_ASSERT(defIndex == 0); - MOZ_ASSERT(CodeSpec(op).ndefs == 1); + MOZ_ASSERT(CodeSpec[op].ndefs == 1); // Handle simple cases of binary and unary operators. - switch (CodeSpec(op).nuses) { + switch (CodeSpec[op].nuses) { case 2: { jssrcnote* sn = GetSrcNote(cx, script, pc); if (!sn || SN_TYPE(sn) != SRC_ASSIGNOP) { @@ -2751,7 +2750,7 @@ static bool GetPCCountJSON(JSContext* cx, const ScriptAndCounts& sac, json.property("id", offset); json.property("line", range.frontLineNumber()); - json.property("name", CodeName(op)); + json.property("name", CodeName[op]); { ExpressionDecompiler ed(cx, script, parser); @@ -3035,7 +3034,7 @@ bool js::GetSuccessorBytecodes(JSScript* script, jsbytecode* pc, } } - if (CodeSpec(op).type() == JOF_JUMP) { + if (CodeSpec[op].type() == JOF_JUMP) { if (!successors.append(pc + GET_JUMP_OFFSET(pc))) { return false; } diff --git a/js/src/vm/BytecodeUtil.h b/js/src/vm/BytecodeUtil.h index 155e2d3aa036..32d1e7f83324 100644 --- a/js/src/vm/BytecodeUtil.h +++ b/js/src/vm/BytecodeUtil.h @@ -28,16 +28,13 @@ /* * JS operation bytecodes. */ -enum class JSOp : uint8_t { -#define ENUMERATE_OPCODE(op, camel_case, ...) camel_case, +enum JSOp : uint8_t { +#define ENUMERATE_OPCODE(op, ...) op, FOR_EACH_OPCODE(ENUMERATE_OPCODE) #undef ENUMERATE_OPCODE -}; -#define DEF_OPCODE_ALIAS(op, camel_case, ...) \ - constexpr JSOp op = JSOp::camel_case; -FOR_EACH_OPCODE(DEF_OPCODE_ALIAS) -#undef DEF_OPCODE_ALIAS + JSOP_LIMIT +}; /* * [SMDOC] Bytecode Format flags (JOF_*) @@ -267,12 +264,12 @@ static inline void SET_ICINDEX(jsbytecode* pc, uint32_t icIndex) { } static inline unsigned LoopHeadDepthHint(jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD); + MOZ_ASSERT(*pc == JSOP_LOOPHEAD); return GET_UINT8(pc + 4); } static inline void SetLoopHeadDepthHint(jsbytecode* pc, unsigned loopDepth) { - MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD); + MOZ_ASSERT(*pc == JSOP_LOOPHEAD); uint8_t data = std::min(loopDepth, unsigned(UINT8_MAX)); SET_UINT8(pc + 4, data); } @@ -296,8 +293,7 @@ static inline void SetClassConstructorOperands(jsbytecode* pc, uint32_t atomIndex, uint32_t sourceStart, uint32_t sourceEnd) { - MOZ_ASSERT(JSOp(*pc) == JSOP_CLASSCONSTRUCTOR || - JSOp(*pc) == JSOP_DERIVEDCONSTRUCTOR); + MOZ_ASSERT(*pc == JSOP_CLASSCONSTRUCTOR || *pc == JSOP_DERIVEDCONSTRUCTOR); SET_UINT32(pc, atomIndex); SET_UINT32(pc + 4, sourceStart); SET_UINT32(pc + 8, sourceEnd); @@ -307,8 +303,7 @@ static inline void GetClassConstructorOperands(jsbytecode* pc, uint32_t* atomIndex, uint32_t* sourceStart, uint32_t* sourceEnd) { - MOZ_ASSERT(JSOp(*pc) == JSOP_CLASSCONSTRUCTOR || - JSOp(*pc) == JSOP_DERIVEDCONSTRUCTOR); + MOZ_ASSERT(*pc == JSOP_CLASSCONSTRUCTOR || *pc == JSOP_DERIVEDCONSTRUCTOR); *atomIndex = GET_UINT32(pc); *sourceStart = GET_UINT32(pc + 4); *sourceEnd = GET_UINT32(pc + 8); @@ -360,20 +355,13 @@ struct JSCodeSpec { namespace js { -extern const JSCodeSpec CodeSpecTable[]; - -inline const JSCodeSpec& CodeSpec(JSOp op) { - return CodeSpecTable[uint8_t(op)]; -} - -extern const char* const CodeNameTable[]; - -inline const char* CodeName(JSOp op) { return CodeNameTable[uint8_t(op)]; } +extern const JSCodeSpec CodeSpec[]; +extern const char* const CodeName[]; /* Shorthand for type from opcode. */ static inline uint32_t JOF_OPTYPE(JSOp op) { - return JOF_TYPE(CodeSpec(op).format); + return JOF_TYPE(CodeSpec[op].format); } static inline bool IsJumpOpcode(JSOp op) { return JOF_OPTYPE(op) == JOF_JUMP; } @@ -410,7 +398,7 @@ static inline bool BytecodeIsJumpTarget(JSOp op) { MOZ_ALWAYS_INLINE unsigned StackUses(jsbytecode* pc) { JSOp op = JSOp(*pc); - int nuses = CodeSpec(op).nuses; + int nuses = CodeSpec[op].nuses; if (nuses >= 0) { return nuses; } @@ -433,7 +421,7 @@ MOZ_ALWAYS_INLINE unsigned StackUses(jsbytecode* pc) { } MOZ_ALWAYS_INLINE unsigned StackDefs(jsbytecode* pc) { - int ndefs = CodeSpec(JSOp(*pc)).ndefs; + int ndefs = CodeSpec[*pc].ndefs; MOZ_ASSERT(ndefs >= 0); return ndefs; } @@ -484,9 +472,9 @@ UniqueChars DecompileValueGenerator(JSContext* cx, int spindex, HandleValue v, JSString* DecompileArgument(JSContext* cx, int formalIndex, HandleValue v); static inline unsigned GetOpLength(JSOp op) { - MOZ_ASSERT(uint8_t(op) < JSOP_LIMIT); - MOZ_ASSERT(CodeSpec(op).length > 0); - return CodeSpec(op).length; + MOZ_ASSERT(op < JSOP_LIMIT); + MOZ_ASSERT(CodeSpec[op].length > 0); + return CodeSpec[op].length; } static inline unsigned GetBytecodeLength(jsbytecode* pc) { @@ -502,29 +490,29 @@ static inline bool BytecodeIsPopped(jsbytecode* pc) { static inline bool BytecodeFlowsToBitop(jsbytecode* pc) { // Look for simple bytecode for integer conversions like (x | 0) or (x & -1). jsbytecode* next = pc + GetBytecodeLength(pc); - if (JSOp(*next) == JSOP_BITOR || JSOp(*next) == JSOP_BITAND) { + if (*next == JSOP_BITOR || *next == JSOP_BITAND) { return true; } - if (JSOp(*next) == JSOP_INT8 && GET_INT8(next) == -1) { + if (*next == JSOP_INT8 && GET_INT8(next) == -1) { next += GetBytecodeLength(next); - if (JSOp(*next) == JSOP_BITAND) { + if (*next == JSOP_BITAND) { return true; } return false; } - if (JSOp(*next) == JSOP_ONE) { + if (*next == JSOP_ONE) { next += GetBytecodeLength(next); - if (JSOp(*next) == JSOP_NEG) { + if (*next == JSOP_NEG) { next += GetBytecodeLength(next); - if (JSOp(*next) == JSOP_BITAND) { + if (*next == JSOP_BITAND) { return true; } } return false; } - if (JSOp(*next) == JSOP_ZERO) { + if (*next == JSOP_ZERO) { next += GetBytecodeLength(next); - if (JSOp(*next) == JSOP_BITOR) { + if (*next == JSOP_BITOR) { return true; } return false; @@ -557,14 +545,14 @@ inline bool IsLocalOp(JSOp op) { return JOF_OPTYPE(op) == JOF_LOCAL; } inline bool IsAliasedVarOp(JSOp op) { return JOF_OPTYPE(op) == JOF_ENVCOORD; } -inline bool IsGlobalOp(JSOp op) { return CodeSpec(op).format & JOF_GNAME; } +inline bool IsGlobalOp(JSOp op) { return CodeSpec[op].format & JOF_GNAME; } inline bool IsPropertySetOp(JSOp op) { - return CodeSpec(op).format & JOF_PROPSET; + return CodeSpec[op].format & JOF_PROPSET; } inline bool IsPropertyInitOp(JSOp op) { - return CodeSpec(op).format & JOF_PROPINIT; + return CodeSpec[op].format & JOF_PROPINIT; } inline bool IsLooseEqualityOp(JSOp op) { @@ -584,16 +572,16 @@ inline bool IsRelationalOp(JSOp op) { } inline bool IsCheckStrictOp(JSOp op) { - return CodeSpec(op).format & JOF_CHECKSTRICT; + return CodeSpec[op].format & JOF_CHECKSTRICT; } -inline bool IsDetecting(JSOp op) { return CodeSpec(op).format & JOF_DETECTING; } +inline bool IsDetecting(JSOp op) { return CodeSpec[op].format & JOF_DETECTING; } -inline bool IsNameOp(JSOp op) { return CodeSpec(op).format & JOF_NAME; } +inline bool IsNameOp(JSOp op) { return CodeSpec[op].format & JOF_NAME; } #ifdef DEBUG inline bool IsCheckSloppyOp(JSOp op) { - return CodeSpec(op).format & JOF_CHECKSLOPPY; + return CodeSpec[op].format & JOF_CHECKSLOPPY; } #endif @@ -638,10 +626,10 @@ inline bool IsSetElemOp(JSOp op) { inline bool IsSetElemPC(const jsbytecode* pc) { return IsSetElemOp(JSOp(*pc)); } inline bool IsElemPC(const jsbytecode* pc) { - return CodeSpec(JSOp(*pc)).format & JOF_ELEM; + return CodeSpec[*pc].format & JOF_ELEM; } -inline bool IsInvokeOp(JSOp op) { return CodeSpec(op).format & JOF_INVOKE; } +inline bool IsInvokeOp(JSOp op) { return CodeSpec[op].format & JOF_INVOKE; } inline bool IsInvokePC(jsbytecode* pc) { return IsInvokeOp(JSOp(*pc)); } @@ -651,13 +639,13 @@ inline bool IsStrictEvalPC(jsbytecode* pc) { } inline bool IsConstructOp(JSOp op) { - return CodeSpec(op).format & JOF_CONSTRUCT; + return CodeSpec[op].format & JOF_CONSTRUCT; } inline bool IsConstructPC(const jsbytecode* pc) { return IsConstructOp(JSOp(*pc)); } -inline bool IsSpreadOp(JSOp op) { return CodeSpec(op).format & JOF_SPREAD; } +inline bool IsSpreadOp(JSOp op) { return CodeSpec[op].format & JOF_SPREAD; } inline bool IsSpreadPC(const jsbytecode* pc) { return IsSpreadOp(JSOp(*pc)); } @@ -680,10 +668,10 @@ static inline int32_t GetBytecodeInteger(jsbytecode* pc) { } } -inline bool BytecodeOpHasIC(JSOp op) { return CodeSpec(op).format & JOF_IC; } +inline bool BytecodeOpHasIC(JSOp op) { return CodeSpec[op].format & JOF_IC; } inline bool BytecodeOpHasTypeSet(JSOp op) { - return CodeSpec(op).format & JOF_TYPESET; + return CodeSpec[op].format & JOF_TYPESET; } /* diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp index d8b270fc337b..a5cda78c015e 100644 --- a/js/src/vm/EnvironmentObject.cpp +++ b/js/src/vm/EnvironmentObject.cpp @@ -3391,7 +3391,7 @@ static bool GetThisValueForDebuggerEnvironmentIterMaybeOptimizedOut( if (script->functionHasThisBinding()) { for (jsbytecode* it = script->code(); it < script->codeEnd(); it = GetNextPc(it)) { - if (JSOp(*it) == JSOP_FUNCTIONTHIS) { + if (*it == JSOP_FUNCTIONTHIS) { // The next op after JSOP_FUNCTIONTHIS always sets it. executedInitThisOp = pc > GetNextPc(it); break; diff --git a/js/src/vm/GeneratorObject.cpp b/js/src/vm/GeneratorObject.cpp index aa528fa597ff..134801ecfb68 100644 --- a/js/src/vm/GeneratorObject.cpp +++ b/js/src/vm/GeneratorObject.cpp @@ -62,13 +62,13 @@ void AbstractGeneratorObject::trace(JSTracer* trc) { bool AbstractGeneratorObject::suspend(JSContext* cx, HandleObject obj, AbstractFramePtr frame, jsbytecode* pc, Value* vp, unsigned nvalues) { - MOZ_ASSERT(JSOp(*pc) == JSOP_INITIALYIELD || JSOp(*pc) == JSOP_YIELD || - JSOp(*pc) == JSOP_AWAIT); + MOZ_ASSERT(*pc == JSOP_INITIALYIELD || *pc == JSOP_YIELD || + *pc == JSOP_AWAIT); auto genObj = obj.as(); MOZ_ASSERT(!genObj->hasExpressionStack() || genObj->isExpressionStackEmpty()); - MOZ_ASSERT_IF(JSOp(*pc) == JSOP_AWAIT, genObj->callee().isAsync()); - MOZ_ASSERT_IF(JSOp(*pc) == JSOP_YIELD, genObj->callee().isGenerator()); + MOZ_ASSERT_IF(*pc == JSOP_AWAIT, genObj->callee().isAsync()); + MOZ_ASSERT_IF(*pc == JSOP_YIELD, genObj->callee().isGenerator()); ArrayObject* stack = nullptr; if (nvalues > 0) { @@ -358,7 +358,7 @@ bool AbstractGeneratorObject::isAfterYieldOrAwait(JSOp op) { JSScript* script = callee().nonLazyScript(); jsbytecode* code = script->code(); uint32_t nextOffset = script->resumeOffsets()[resumeIndex()]; - if (JSOp(code[nextOffset]) != JSOP_AFTERYIELD) { + if (code[nextOffset] != JSOP_AFTERYIELD) { return false; } @@ -368,11 +368,10 @@ bool AbstractGeneratorObject::isAfterYieldOrAwait(JSOp op) { "JSOP_YIELD and JSOP_AWAIT must have the same length"); uint32_t offset = nextOffset - JSOP_YIELD_LENGTH; - JSOp prevOp = JSOp(code[offset]); - MOZ_ASSERT(prevOp == JSOP_INITIALYIELD || prevOp == JSOP_YIELD || - prevOp == JSOP_AWAIT); + MOZ_ASSERT(code[offset] == JSOP_INITIALYIELD || code[offset] == JSOP_YIELD || + code[offset] == JSOP_AWAIT); - return prevOp == op; + return code[offset] == op; } template <> diff --git a/js/src/vm/GeneratorObject.h b/js/src/vm/GeneratorObject.h index fe309a2bfcee..490b0aaa1eea 100644 --- a/js/src/vm/GeneratorObject.h +++ b/js/src/vm/GeneratorObject.h @@ -125,8 +125,8 @@ class AbstractGeneratorObject : public NativeObject { setFixedSlot(RESUME_INDEX_SLOT, Int32Value(RESUME_INDEX_RUNNING)); } void setResumeIndex(jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_INITIALYIELD || JSOp(*pc) == JSOP_YIELD || - JSOp(*pc) == JSOP_AWAIT); + MOZ_ASSERT(*pc == JSOP_INITIALYIELD || *pc == JSOP_YIELD || + *pc == JSOP_AWAIT); MOZ_ASSERT_IF(JSOp(*pc) == JSOP_INITIALYIELD, getFixedSlot(RESUME_INDEX_SLOT).isUndefined()); @@ -217,7 +217,7 @@ inline GeneratorResumeKind IntToResumeKind(int32_t value) { } inline GeneratorResumeKind ResumeKindFromPC(jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_RESUMEKIND); + MOZ_ASSERT(*pc == JSOP_RESUMEKIND); return IntToResumeKind(GET_UINT8(pc)); } diff --git a/js/src/vm/Interpreter-inl.h b/js/src/vm/Interpreter-inl.h index 4212377ee3ac..26f26523fc78 100644 --- a/js/src/vm/Interpreter-inl.h +++ b/js/src/vm/Interpreter-inl.h @@ -306,16 +306,15 @@ inline void SetAliasedVarOperation(JSContext* cx, JSScript* script, inline bool SetNameOperation(JSContext* cx, JSScript* script, jsbytecode* pc, HandleObject env, HandleValue val) { - MOZ_ASSERT(JSOp(*pc) == JSOP_SETNAME || JSOp(*pc) == JSOP_STRICTSETNAME || - JSOp(*pc) == JSOP_SETGNAME || JSOp(*pc) == JSOP_STRICTSETGNAME); - MOZ_ASSERT_IF( - (JSOp(*pc) == JSOP_SETGNAME || JSOp(*pc) == JSOP_STRICTSETGNAME) && - !script->hasNonSyntacticScope(), - env == cx->global() || env == &cx->global()->lexicalEnvironment() || - env->is()); + MOZ_ASSERT(*pc == JSOP_SETNAME || *pc == JSOP_STRICTSETNAME || + *pc == JSOP_SETGNAME || *pc == JSOP_STRICTSETGNAME); + MOZ_ASSERT_IF((*pc == JSOP_SETGNAME || *pc == JSOP_STRICTSETGNAME) && + !script->hasNonSyntacticScope(), + env == cx->global() || + env == &cx->global()->lexicalEnvironment() || + env->is()); - bool strict = - JSOp(*pc) == JSOP_STRICTSETNAME || JSOp(*pc) == JSOP_STRICTSETGNAME; + bool strict = *pc == JSOP_STRICTSETNAME || *pc == JSOP_STRICTSETGNAME; RootedPropertyName name(cx, script->getName(pc)); // In strict mode, assigning to an undeclared global variable is an @@ -347,7 +346,7 @@ inline void InitGlobalLexicalOperation(JSContext* cx, HandleValue value) { MOZ_ASSERT_IF(!script->hasNonSyntacticScope(), lexicalEnvArg == &cx->global()->lexicalEnvironment()); - MOZ_ASSERT(JSOp(*pc) == JSOP_INITGLEXICAL); + MOZ_ASSERT(*pc == JSOP_INITGLEXICAL); Rooted lexicalEnv(cx, lexicalEnvArg); RootedShape shape(cx, lexicalEnv->lookup(cx, script->getName(pc))); MOZ_ASSERT(shape); @@ -668,7 +667,7 @@ static MOZ_ALWAYS_INLINE bool InitArrayElemOperation(JSContext* cx, static inline ArrayObject* ProcessCallSiteObjOperation(JSContext* cx, HandleScript script, jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_CALLSITEOBJ); + MOZ_ASSERT(*pc == JSOP_CALLSITEOBJ); RootedArrayObject cso(cx, &script->getObject(pc)->as()); diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index 69764c624fca..e76e8b443dce 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -1090,10 +1090,10 @@ jsbytecode* js::UnwindEnvironmentToTryPc(JSScript* script, jsbytecode* pc = script->offsetToPC(tn->start); if (tn->kind == JSTRY_CATCH || tn->kind == JSTRY_FINALLY) { pc -= JSOP_TRY_LENGTH; - MOZ_ASSERT(JSOp(*pc) == JSOP_TRY); + MOZ_ASSERT(*pc == JSOP_TRY); } else if (tn->kind == JSTRY_DESTRUCTURING) { pc -= JSOP_TRY_DESTRUCTURING_LENGTH; - MOZ_ASSERT(JSOp(*pc) == JSOP_TRY_DESTRUCTURING); + MOZ_ASSERT(*pc == JSOP_TRY_DESTRUCTURING); } return pc; } @@ -1340,7 +1340,7 @@ JS_STATIC_ASSERT(JSOP_SETNAME_LENGTH == JSOP_SETPROP_LENGTH); /* See TRY_BRANCH_AFTER_COND. */ JS_STATIC_ASSERT(JSOP_IFNE_LENGTH == JSOP_IFEQ_LENGTH); -JS_STATIC_ASSERT(uint8_t(JSOP_IFNE) == uint8_t(JSOP_IFEQ) + 1); +JS_STATIC_ASSERT(JSOP_IFNE == JSOP_IFEQ + 1); /* * Compute the implicit |this| value used by a call expression with an @@ -2080,7 +2080,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx, // first |await| expression in an async function. MOZ_ASSERT( REGS.stackDepth() == 0 || - (JSOp(*REGS.pc) == JSOP_AWAIT && !REGS.fp()->isResumedGenerator())); + (*REGS.pc == JSOP_AWAIT && !REGS.fp()->isResumedGenerator())); } goto exit; } @@ -2890,7 +2890,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx, FETCH_ELEMENT_ID(-2, id); HandleValue value = REGS.stackHandleAt(-1); if (!SetObjectElementOperation(cx, obj, id, value, receiver, - JSOp(*REGS.pc) == JSOP_STRICTSETELEM)) { + *REGS.pc == JSOP_STRICTSETELEM)) { goto error; } REGS.sp[-3] = value; @@ -3011,9 +3011,9 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx, cx->geckoProfiler().updatePC(cx, script, REGS.pc); } - MaybeConstruct construct = MaybeConstruct( - JSOp(*REGS.pc) == JSOP_NEW || JSOp(*REGS.pc) == JSOP_SUPERCALL); - bool ignoresReturnValue = JSOp(*REGS.pc) == JSOP_CALL_IGNORES_RV; + MaybeConstruct construct = + MaybeConstruct(*REGS.pc == JSOP_NEW || *REGS.pc == JSOP_SUPERCALL); + bool ignoresReturnValue = *REGS.pc == JSOP_CALL_IGNORES_RV; unsigned argStackSlots = GET_ARGC(REGS.pc) + construct; MOZ_ASSERT(REGS.stackDepth() >= 2u + GET_ARGC(REGS.pc)); @@ -3035,7 +3035,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx, goto error; } } else { - if (JSOp(*REGS.pc) == JSOP_CALLITER && args.calleev().isPrimitive()) { + if (*REGS.pc == JSOP_CALLITER && args.calleev().isPrimitive()) { MOZ_ASSERT(args.length() == 0, "thisv must be on top of the stack"); ReportValueError(cx, JSMSG_NOT_ITERABLE, -1, args.thisv(), nullptr); goto error; @@ -3480,7 +3480,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx, * the method JIT, and a GETLOCAL followed by POP is not considered to be * a use of the variable. */ - if (JSOp(REGS.pc[JSOP_GETLOCAL_LENGTH]) != JSOP_POP) { + if (REGS.pc[JSOP_GETLOCAL_LENGTH] != JSOP_POP) { cx->debugOnlyCheck(REGS.sp[-1]); } } @@ -4549,10 +4549,10 @@ bool js::DefVarOperation(JSContext* cx, HandleObject envChain, bool js::DefLexicalOperation(JSContext* cx, HandleObject envChain, HandleScript script, jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_DEFLET || JSOp(*pc) == JSOP_DEFCONST); + MOZ_ASSERT(*pc == JSOP_DEFLET || *pc == JSOP_DEFCONST); unsigned attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT; - if (JSOp(*pc) == JSOP_DEFCONST) { + if (*pc == JSOP_DEFCONST) { attrs |= JSPROP_READONLY; } @@ -4672,7 +4672,7 @@ bool js::DefFunOperation(JSContext* cx, HandleScript script, JSObject* js::SingletonObjectLiteralOperation(JSContext* cx, HandleScript script, jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_OBJECT); + MOZ_ASSERT(*pc == JSOP_OBJECT); RootedObject obj(cx, script->getObject(pc)); if (cx->realm()->creationOptions().cloneSingletons()) { @@ -4690,7 +4690,7 @@ JSObject* js::ImportMetaOperation(JSContext* cx, HandleScript script) { } JSObject* js::BuiltinProtoOperation(JSContext* cx, jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_BUILTINPROTO); + MOZ_ASSERT(*pc == JSOP_BUILTINPROTO); MOZ_ASSERT(GET_UINT8(pc) < JSProto_LIMIT); JSProtoKey key = static_cast(GET_UINT8(pc)); @@ -5092,8 +5092,8 @@ JSObject* js::NewObjectOperation(JSContext* cx, HandleScript script, NewObjectKind newKind /* = GenericObject */) { MOZ_ASSERT(newKind != SingletonObject); bool withTemplate = - (JSOp(*pc) == JSOP_NEWOBJECT || JSOp(*pc) == JSOP_NEWOBJECT_WITHGROUP); - bool withTemplateGroup = (JSOp(*pc) == JSOP_NEWOBJECT_WITHGROUP); + (*pc == JSOP_NEWOBJECT || *pc == JSOP_NEWOBJECT_WITHGROUP); + bool withTemplateGroup = (*pc == JSOP_NEWOBJECT_WITHGROUP); RootedObjectGroup group(cx); RootedPlainObject baseObject(cx); @@ -5140,7 +5140,7 @@ JSObject* js::NewObjectOperation(JSContext* cx, HandleScript script, if (withTemplate) { obj = CopyInitializerObject(cx, baseObject, newKind); } else { - MOZ_ASSERT(JSOp(*pc) == JSOP_NEWINIT); + MOZ_ASSERT(*pc == JSOP_NEWINIT); obj = NewBuiltinClassInstance(cx, newKind); } @@ -5204,7 +5204,7 @@ JSObject* js::CreateThisWithTemplate(JSContext* cx, JSObject* js::NewArrayOperation(JSContext* cx, HandleScript script, jsbytecode* pc, uint32_t length, NewObjectKind newKind /* = GenericObject */) { - MOZ_ASSERT(JSOp(*pc) == JSOP_NEWARRAY); + MOZ_ASSERT(*pc == JSOP_NEWARRAY); MOZ_ASSERT(newKind != SingletonObject); RootedObjectGroup group(cx); @@ -5262,7 +5262,7 @@ JSObject* js::NewArrayOperationWithTemplate(JSContext* cx, ArrayObject* js::NewArrayCopyOnWriteOperation(JSContext* cx, HandleScript script, jsbytecode* pc) { - MOZ_ASSERT(JSOp(*pc) == JSOP_NEWARRAY_COPYONWRITE); + MOZ_ASSERT(*pc == JSOP_NEWARRAY_COPYONWRITE); RootedArrayObject baseobj( cx, ObjectGroup::getOrFixupCopyOnWriteObject(cx, script, pc)); diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp index fe69e091b063..00fd16884730 100644 --- a/js/src/vm/JSObject.cpp +++ b/js/src/vm/JSObject.cpp @@ -3842,7 +3842,7 @@ JS_FRIEND_API void js::DumpInterpreterFrame(JSContext* cx, if (jsbytecode* pc = i.pc()) { out.printf(" pc = %p\n", pc); - out.printf(" current op: %s\n", CodeName(JSOp(*pc))); + out.printf(" current op: %s\n", CodeName[*pc]); MaybeDumpScope(i.script()->lookupScope(pc), out); } if (i.isFunctionFrame()) { diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp index d3651f048eec..9853661f5f56 100644 --- a/js/src/vm/JSScript.cpp +++ b/js/src/vm/JSScript.cpp @@ -4854,7 +4854,7 @@ void js::DescribeScriptedCallerForDirectEval(JSContext* cx, HandleScript script, (JSOp(*pc) == JSOP_SPREADEVAL || JSOp(*pc) == JSOP_STRICTSPREADEVAL); jsbytecode* nextpc = pc + (isSpread ? JSOP_SPREADEVAL_LENGTH : JSOP_EVAL_LENGTH); - MOZ_ASSERT(JSOp(*nextpc) == JSOP_LINENO); + MOZ_ASSERT(*nextpc == JSOP_LINENO); *file = script->filename(); *linenop = GET_UINT32(nextpc); @@ -5446,11 +5446,11 @@ void js::SetFrameArgumentsObject(JSContext* cx, AbstractFramePtr frame, * is assigned to. */ jsbytecode* pc = script->code(); - while (JSOp(*pc) != JSOP_ARGUMENTS) { + while (*pc != JSOP_ARGUMENTS) { pc += GetBytecodeLength(pc); } pc += JSOP_ARGUMENTS_LENGTH; - MOZ_ASSERT(JSOp(*pc) == JSOP_SETALIASEDVAR); + MOZ_ASSERT(*pc == JSOP_SETALIASEDVAR); // Note that here and below, it is insufficient to only check for // JS_OPTIMIZED_ARGUMENTS, as Ion could have optimized out the diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index 8b41202ca1bd..9dd3c13e1de8 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -2724,7 +2724,7 @@ class JSScript : public js::BaseScript { jsbytecode* lastPC() const { jsbytecode* pc = codeEnd() - js::JSOP_RETRVAL_LENGTH; - MOZ_ASSERT(JSOp(*pc) == JSOP_RETRVAL); + MOZ_ASSERT(*pc == JSOP_RETRVAL); return pc; } @@ -3099,7 +3099,7 @@ class JSScript : public js::BaseScript { uint32_t tableSwitchCaseOffset(jsbytecode* pc, uint32_t caseIndex) const { MOZ_ASSERT(containsPC(pc)); - MOZ_ASSERT(JSOp(*pc) == JSOP_TABLESWITCH); + MOZ_ASSERT(*pc == JSOP_TABLESWITCH); uint32_t firstResumeIndex = GET_RESUMEINDEX(pc + 3 * JUMP_OFFSET_LEN); return resumeOffsets()[firstResumeIndex + caseIndex]; } diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp index 8b39c5c6ee04..b90df54d4438 100644 --- a/js/src/vm/NativeObject.cpp +++ b/js/src/vm/NativeObject.cpp @@ -2453,7 +2453,7 @@ static bool GetNonexistentProperty(JSContext* cx, HandleId id, return true; } - if (JSOp(*pc) != JSOP_GETPROP && JSOp(*pc) != JSOP_GETELEM) { + if (*pc != JSOP_GETPROP && *pc != JSOP_GETELEM) { return true; } diff --git a/js/src/vm/Opcodes.h b/js/src/vm/Opcodes.h index 46e289037cab..5c828aa3be43 100644 --- a/js/src/vm/Opcodes.h +++ b/js/src/vm/Opcodes.h @@ -12,7 +12,6 @@ #include -// clang-format off /* * [SMDOC] Bytecode Definitions * @@ -20,16 +19,13 @@ * * To use this header, define a macro of the form: * - * #define MACRO(op, op_camel, op_snake, name, token, length, \ - * nuses, ndefs, format) ... + * #define MACRO(op, name, token, length, nuses, ndefs, format) ... * * Then `FOR_EACH_OPCODE(MACRO)` invokes `MACRO` for every opcode. * * Field Description * ----- ----------- - * op Bytecode name (including JSOP_ prefix) - * op_camel UpperCamelCase form of opcode id - * op_snake snake_case form of opcode id + * op Bytecode name, which is the JSOp enumerator name * name C string containing name for disassembler * token Pretty-printer string, or null if ugly * length Number of bytes including any immediate operands @@ -205,7 +201,6 @@ * Many instructions have their own additional rules. These are documented on * the various opcodes below (look for the word "must"). */ -// clang-format on // clang-format off /* @@ -260,7 +255,7 @@ * Operands: * Stack: => undefined */ \ - MACRO(JSOP_UNDEFINED, Undefined, undefined, js_undefined_str, "", 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_UNDEFINED, js_undefined_str, "", 1, 0, 1, JOF_BYTE) \ /* * Push `null`. * @@ -268,7 +263,7 @@ * Operands: * Stack: => null */ \ - MACRO(JSOP_NULL, Null, null, js_null_str, js_null_str, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_NULL, js_null_str, js_null_str, 1, 0, 1, JOF_BYTE) \ /* * Push a boolean constant. * @@ -276,8 +271,8 @@ * Operands: * Stack: => true/false */ \ - MACRO(JSOP_FALSE, False, false_, js_false_str, js_false_str, 1, 0, 1, JOF_BYTE) \ - MACRO(JSOP_TRUE, True, true_, js_true_str, js_true_str, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_FALSE, js_false_str, js_false_str, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_TRUE, js_true_str, js_true_str, 1, 0, 1, JOF_BYTE) \ /* * Push the `int32_t` immediate operand as an `Int32Value`. * @@ -288,7 +283,7 @@ * Operands: int32_t val * Stack: => val */ \ - MACRO(JSOP_INT32, Int32, int32, "int32", NULL, 5, 0, 1, JOF_INT32) \ + MACRO(JSOP_INT32, "int32", NULL, 5, 0, 1, JOF_INT32) \ /* * Push the number `0`. * @@ -296,7 +291,7 @@ * Operands: * Stack: => 0 */ \ - MACRO(JSOP_ZERO, Zero, zero, "zero", "0", 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_ZERO, "zero", "0", 1, 0, 1, JOF_BYTE) \ /* * Push the number `1`. * @@ -304,7 +299,7 @@ * Operands: * Stack: => 1 */ \ - MACRO(JSOP_ONE, One, one, "one", "1", 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_ONE, "one", "1", 1, 0, 1, JOF_BYTE) \ /* * Push the `int8_t` immediate operand as an `Int32Value`. * @@ -312,7 +307,7 @@ * Operands: int8_t val * Stack: => val */ \ - MACRO(JSOP_INT8, Int8, int8, "int8", NULL, 2, 0, 1, JOF_INT8) \ + MACRO(JSOP_INT8, "int8", NULL, 2, 0, 1, JOF_INT8) \ /* * Push the `uint16_t` immediate operand as an `Int32Value`. * @@ -320,7 +315,7 @@ * Operands: uint16_t val * Stack: => val */ \ - MACRO(JSOP_UINT16, Uint16, uint16, "uint16", NULL, 3, 0, 1, JOF_UINT16) \ + MACRO(JSOP_UINT16, "uint16", NULL, 3, 0, 1, JOF_UINT16) \ /* * Push the `uint24_t` immediate operand as an `Int32Value`. * @@ -328,7 +323,7 @@ * Operands: uint24_t val * Stack: => val */ \ - MACRO(JSOP_UINT24, Uint24, uint24, "uint24", NULL, 4, 0, 1, JOF_UINT24) \ + MACRO(JSOP_UINT24, "uint24", NULL, 4, 0, 1, JOF_UINT24) \ /* * Push the 64-bit floating-point immediate operand as a `DoubleValue`. * @@ -339,7 +334,7 @@ * Operands: double val * Stack: => val */ \ - MACRO(JSOP_DOUBLE, Double, double_, "double", NULL, 9, 0, 1, JOF_DOUBLE) \ + MACRO(JSOP_DOUBLE, "double", NULL, 9, 0, 1, JOF_DOUBLE) \ /* * Push the BigInt constant `script->getBigInt(bigIntIndex)`. * @@ -347,7 +342,7 @@ * Operands: uint32_t bigIntIndex * Stack: => bigint */ \ - MACRO(JSOP_BIGINT, BigInt, big_int, "bigint", NULL, 5, 0, 1, JOF_BIGINT) \ + MACRO(JSOP_BIGINT, "bigint", NULL, 5, 0, 1, JOF_BIGINT) \ /* * Push the string constant `script->getAtom(atomIndex)`. * @@ -355,7 +350,7 @@ * Operands: uint32_t atomIndex * Stack: => string */ \ - MACRO(JSOP_STRING, String, string, "string", NULL, 5, 0, 1, JOF_ATOM) \ + MACRO(JSOP_STRING, "string", NULL, 5, 0, 1, JOF_ATOM) \ /* * Push a well-known symbol. * @@ -365,7 +360,7 @@ * Operands: uint8_t symbol (the JS::SymbolCode of the symbol to use) * Stack: => symbol */ \ - MACRO(JSOP_SYMBOL, Symbol, symbol, "symbol", NULL, 2, 0, 1, JOF_UINT8) \ + MACRO(JSOP_SYMBOL, "symbol", NULL, 2, 0, 1, JOF_UINT8) \ /* * Pop the top value on the stack, discard it, and push `undefined`. * @@ -378,7 +373,7 @@ * Operands: * Stack: val => undefined */ \ - MACRO(JSOP_VOID, Void, void_, js_void_str, NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_VOID, js_void_str, NULL, 1, 1, 1, JOF_BYTE) \ /* * [The `typeof` operator][1]. * @@ -407,8 +402,8 @@ * Operands: * Stack: val => (typeof val) */ \ - MACRO(JSOP_TYPEOF, Typeof, typeof_, js_typeof_str, NULL, 1, 1, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ - MACRO(JSOP_TYPEOFEXPR, TypeofExpr, typeof_expr, "typeofexpr", NULL, 1, 1, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_TYPEOF, js_typeof_str, NULL, 1, 1, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_TYPEOFEXPR, "typeofexpr", NULL, 1, 1, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ /* * [The unary `+` operator][1]. * @@ -426,7 +421,7 @@ * Operands: * Stack: val => (+val) */ \ - MACRO(JSOP_POS, Pos, pos, "pos", "+ ", 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_POS, "pos", "+ ", 1, 1, 1, JOF_BYTE) \ /* * [The unary `-` operator][1]. * @@ -441,7 +436,7 @@ * Operands: * Stack: val => (-val) */ \ - MACRO(JSOP_NEG, Neg, neg, "neg", "- ", 1, 1, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_NEG, "neg", "- ", 1, 1, 1, JOF_BYTE|JOF_IC) \ /* * [The bitwise NOT operator][1] (`~`). * @@ -456,7 +451,7 @@ * Operands: * Stack: val => (~val) */ \ - MACRO(JSOP_BITNOT, BitNot, bit_not, "bitnot", "~", 1, 1, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_BITNOT, "bitnot", "~", 1, 1, 1, JOF_BYTE|JOF_IC) \ /* * [The logical NOT operator][1] (`!`). * @@ -472,7 +467,7 @@ * Operands: * Stack: val => (!val) */ \ - MACRO(JSOP_NOT, Not, not_, "not", "!", 1, 1, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_NOT, "not", "!", 1, 1, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ /* * [Binary bitwise operations][1] (`|`, `^`, `&`). * @@ -487,9 +482,9 @@ * Operands: * Stack: lval, rval => (lval OP rval) */ \ - MACRO(JSOP_BITOR, BitOr, bit_or, "bitor", "|", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_BITXOR, BitXor, bit_xor, "bitxor", "^", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_BITAND, BitAnd, bit_and, "bitand", "&", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_BITOR, "bitor", "|", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_BITXOR, "bitxor", "^", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_BITAND, "bitand", "&", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * Loose equality operators (`==` and `!=`). * @@ -506,8 +501,8 @@ * Operands: * Stack: lval, rval => (lval OP rval) */ \ - MACRO(JSOP_EQ, Eq, eq, "eq", "==", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ - MACRO(JSOP_NE, Ne, ne, "ne", "!=", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_EQ, "eq", "==", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_NE, "ne", "!=", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ /* * Strict equality operators (`===` and `!==`). * @@ -524,8 +519,8 @@ * Operands: * Stack: lval, rval => (lval OP rval) */ \ - MACRO(JSOP_STRICTEQ, StrictEq, strict_eq, "stricteq", "===", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ - MACRO(JSOP_STRICTNE, StrictNe, strict_ne, "strictne", "!==", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_STRICTEQ, "stricteq", "===", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_STRICTNE, "strictne", "!==", 1, 2, 1, JOF_BYTE|JOF_DETECTING|JOF_IC) \ /* * Relative operators (`<`, `>`, `<=`, `>=`). * @@ -542,10 +537,10 @@ * Operands: * Stack: lval, rval => (lval OP rval) */ \ - MACRO(JSOP_LT, Lt, lt, "lt", "<", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_GT, Gt, gt, "gt", ">", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_LE, Le, le, "le", "<=", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_GE, Ge, ge, "ge", ">=", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_LT, "lt", "<", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_GT, "gt", ">", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_LE, "le", "<=", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_GE, "ge", ">=", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * [The `instanceof` operator][1]. * @@ -560,7 +555,7 @@ * Operands: * Stack: value, target => (value instanceof target) */ \ - MACRO(JSOP_INSTANCEOF, Instanceof, instanceof, js_instanceof_str, js_instanceof_str, 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_INSTANCEOF, js_instanceof_str, js_instanceof_str, 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * [The `in` operator][1]. * @@ -577,7 +572,7 @@ * Operands: * Stack: id, obj => (id in obj) */ \ - MACRO(JSOP_IN, In, in_, js_in_str, js_in_str, 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_IN, js_in_str, js_in_str, 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * [Bitwise shift operators][1] (`<<`, `>>`, `>>>`). * @@ -594,9 +589,9 @@ * Operands: * Stack: lval, rval => (lval OP rval) */ \ - MACRO(JSOP_LSH, Lsh, lsh, "lsh", "<<", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_RSH, Rsh, rsh, "rsh", ">>", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_URSH, Ursh, ursh, "ursh", ">>>", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_LSH, "lsh", "<<", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_RSH, "rsh", ">>", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_URSH, "ursh", ">>>", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * [The binary `+` operator][1]. * @@ -613,7 +608,7 @@ * Operands: * Stack: lval, rval => (lval + rval) */ \ - MACRO(JSOP_ADD, Add, add, "add", "+", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_ADD, "add", "+", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * [The binary `-` operator][1]. * @@ -630,7 +625,7 @@ * Operands: * Stack: lval, rval => (lval - rval) */ \ - MACRO(JSOP_SUB, Sub, sub, "sub", "-", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_SUB, "sub", "-", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * Add or subtract 1. * @@ -646,8 +641,8 @@ * Operands: * Stack: val => (val +/- 1) */ \ - MACRO(JSOP_INC, Inc, inc, "inc", NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_DEC, Dec, dec, "dec", NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_INC, "inc", NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_DEC, "dec", NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ /* * [The multiplicative operators][1] (`*`, `/`, `%`). * @@ -664,9 +659,9 @@ * Operands: * Stack: lval, rval => (lval OP rval) */ \ - MACRO(JSOP_MUL, Mul, mul, "mul", "*", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_DIV, Div, div, "div", "/", 1, 2, 1, JOF_BYTE|JOF_IC) \ - MACRO(JSOP_MOD, Mod, mod, "mod", "%", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_MUL, "mul", "*", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_DIV, "div", "/", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_MOD, "mod", "%", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * [The exponentiation operator][1] (`**`). * @@ -684,7 +679,7 @@ * Operands: * Stack: lval, rval => (lval ** rval) */ \ - MACRO(JSOP_POW, Pow, pow, "pow", "**", 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_POW, "pow", "**", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * Convert a value to a property key. * @@ -708,7 +703,7 @@ * Operands: * Stack: propertyNameValue => propertyKey */ \ - MACRO(JSOP_TOID, ToId, to_id, "toid", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_TOID, "toid", NULL, 1, 1, 1, JOF_BYTE) \ /* * Convert a value to a numeric value (a Number or BigInt). * @@ -729,7 +724,7 @@ * Operands: * Stack: val => ToNumeric(val) */ \ - MACRO(JSOP_TONUMERIC, ToNumeric, to_numeric, "tonumeric", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_TONUMERIC, "tonumeric", NULL, 1, 1, 1, JOF_BYTE) \ /* * Convert a value to a string. * @@ -746,7 +741,7 @@ * Type: Conversions * Stack: val => ToString(val) */ \ - MACRO(JSOP_TOSTRING, ToString, to_string, "tostring", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_TOSTRING, "tostring", NULL, 1, 1, 1, JOF_BYTE) \ /* * Push the global `this` value. Not to be confused with the `globalThis` * property on the global. @@ -759,7 +754,7 @@ * Operands: * Stack: => this */ \ - MACRO(JSOP_GLOBALTHIS, GlobalThis, global_this, "globalthis", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_GLOBALTHIS, "globalthis", NULL, 1, 0, 1, JOF_BYTE) \ /* * Push the value of `new.target`. * @@ -778,7 +773,7 @@ * Operands: * Stack: => new.target */ \ - MACRO(JSOP_NEWTARGET, NewTarget, new_target, "newtarget", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_NEWTARGET, "newtarget", NULL, 1, 0, 1, JOF_BYTE) \ /* * Dynamic import of the module specified by the string value on the top of * the stack. @@ -792,7 +787,7 @@ * Operands: * Stack: moduleId => promise */ \ - MACRO(JSOP_DYNAMIC_IMPORT, DynamicImport, dynamic_import, "dynamic-import", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_DYNAMIC_IMPORT, "dynamic-import", NULL, 1, 1, 1, JOF_BYTE) \ /* * Push the `import.meta` object. * @@ -803,7 +798,7 @@ * Operands: * Stack: => import.meta */ \ - MACRO(JSOP_IMPORTMETA, ImportMeta, import_meta, "importmeta", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_IMPORTMETA, "importmeta", NULL, 1, 0, 1, JOF_BYTE) \ /* * Create and push a new object with no properties. * @@ -815,7 +810,7 @@ * Operands: uint32_t _unused * Stack: => obj */ \ - MACRO(JSOP_NEWINIT, NewInit, new_init, "newinit", NULL, 5, 0, 1, JOF_UINT32|JOF_IC) \ + MACRO(JSOP_NEWINIT, "newinit", NULL, 5, 0, 1, JOF_UINT32|JOF_IC) \ /* * Create and push a new object of a predetermined shape. * @@ -834,8 +829,8 @@ * Operands: uint32_t baseobjIndex * Stack: => obj */ \ - MACRO(JSOP_NEWOBJECT, NewObject, new_object, "newobject", NULL, 5, 0, 1, JOF_OBJECT|JOF_IC) \ - MACRO(JSOP_NEWOBJECT_WITHGROUP, NewObjectWithGroup, new_object_with_group, "newobjectwithgroup", NULL, 5, 0, 1, JOF_OBJECT|JOF_IC) \ + MACRO(JSOP_NEWOBJECT, "newobject", NULL, 5, 0, 1, JOF_OBJECT|JOF_IC) \ + MACRO(JSOP_NEWOBJECT_WITHGROUP, "newobjectwithgroup", NULL, 5, 0, 1, JOF_OBJECT|JOF_IC) \ /* * Push a preconstructed object. * @@ -856,7 +851,7 @@ * Operands: uint32_t objectIndex * Stack: => obj */ \ - MACRO(JSOP_OBJECT, Object, object, "object", NULL, 5, 0, 1, JOF_OBJECT) \ + MACRO(JSOP_OBJECT, "object", NULL, 5, 0, 1, JOF_OBJECT) \ /* * Create and push a new ordinary object with the provided [[Prototype]]. * @@ -867,7 +862,7 @@ * Operands: * Stack: proto => obj */ \ - MACRO(JSOP_OBJWITHPROTO, ObjWithProto, obj_with_proto, "objwithproto", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_OBJWITHPROTO, "objwithproto", NULL, 1, 1, 1, JOF_BYTE) \ /* * Define a data property on an object. * @@ -885,7 +880,7 @@ * Operands: uint32_t nameIndex * Stack: obj, val => obj */ \ - MACRO(JSOP_INITPROP, InitProp, init_prop, "initprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_INITPROP, "initprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ /* * Like `JSOP_INITPROP`, but define a non-enumerable property. * @@ -901,7 +896,7 @@ * Operands: uint32_t nameIndex * Stack: obj, val => obj */ \ - MACRO(JSOP_INITHIDDENPROP, InitHiddenProp, init_hidden_prop, "inithiddenprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_INITHIDDENPROP, "inithiddenprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ /* * Like `JSOP_INITPROP`, but define a non-enumerable, non-writable, * non-configurable property. @@ -918,7 +913,7 @@ * Operands: uint32_t nameIndex * Stack: obj, val => obj */ \ - MACRO(JSOP_INITLOCKEDPROP, InitLockedProp, init_locked_prop, "initlockedprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_INITLOCKEDPROP, "initlockedprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ /* * Define a data property on `obj` with property key `id` and value `val`. * @@ -936,8 +931,8 @@ * Operands: * Stack: obj, id, val => obj */ \ - MACRO(JSOP_INITELEM, InitElem, init_elem, "initelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ - MACRO(JSOP_INITHIDDENELEM, InitHiddenElem, init_hidden_elem, "inithiddenelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_INITELEM, "initelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_INITHIDDENELEM, "inithiddenelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ /* * Define an accessor property on `obj` with the given `getter`. * `nameIndex` gives the property name. @@ -950,8 +945,8 @@ * Operands: uint32_t nameIndex * Stack: obj, getter => obj */ \ - MACRO(JSOP_INITPROP_GETTER, InitPropGetter, init_prop_getter, "initprop_getter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ - MACRO(JSOP_INITHIDDENPROP_GETTER, InitHiddenPropGetter, init_hidden_prop_getter, "inithiddenprop_getter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITPROP_GETTER, "initprop_getter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITHIDDENPROP_GETTER, "inithiddenprop_getter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ /* * Define an accessor property on `obj` with property key `id` and the given `getter`. * @@ -965,8 +960,8 @@ * Operands: * Stack: obj, id, getter => obj */ \ - MACRO(JSOP_INITELEM_GETTER, InitElemGetter, init_elem_getter, "initelem_getter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ - MACRO(JSOP_INITHIDDENELEM_GETTER, InitHiddenElemGetter, init_hidden_elem_getter, "inithiddenelem_getter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITELEM_GETTER, "initelem_getter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITHIDDENELEM_GETTER, "inithiddenelem_getter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ /* * Define an accessor property on `obj` with the given `setter`. * @@ -980,8 +975,8 @@ * Operands: uint32_t nameIndex * Stack: obj, setter => obj */ \ - MACRO(JSOP_INITPROP_SETTER, InitPropSetter, init_prop_setter, "initprop_setter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ - MACRO(JSOP_INITHIDDENPROP_SETTER, InitHiddenPropSetter, init_hidden_prop_setter, "inithiddenprop_setter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITPROP_SETTER, "initprop_setter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITHIDDENPROP_SETTER, "inithiddenprop_setter", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPINIT|JOF_DETECTING) \ /* * Define an accesssor property on `obj` with property key `id` and the * given `setter`. @@ -997,8 +992,8 @@ * Operands: * Stack: obj, id, setter => obj */ \ - MACRO(JSOP_INITELEM_SETTER, InitElemSetter, init_elem_setter, "initelem_setter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ - MACRO(JSOP_INITHIDDENELEM_SETTER, InitHiddenElemSetter, init_hidden_elem_setter, "inithiddenelem_setter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITELEM_SETTER, "initelem_setter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITHIDDENELEM_SETTER, "inithiddenelem_setter", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING) \ /* * Get the value of the property `obj.name`. This can call getters and * proxy traps. @@ -1016,8 +1011,8 @@ * Operands: uint32_t nameIndex * Stack: obj => obj[name] */ \ - MACRO(JSOP_GETPROP, GetProp, get_prop, "getprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ - MACRO(JSOP_CALLPROP, CallProp, call_prop, "callprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETPROP, "getprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_CALLPROP, "callprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ /* * Get the value of the property `obj[key]`. * @@ -1034,8 +1029,8 @@ * Operands: * Stack: obj, key => obj[key] */ \ - MACRO(JSOP_GETELEM, GetElem, get_elem, "getelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_TYPESET|JOF_IC) \ - MACRO(JSOP_CALLELEM, CallElem, call_elem, "callelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETELEM, "getelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_CALLELEM, "callelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_TYPESET|JOF_IC) \ /* * Push the value of `obj.length`. * @@ -1047,7 +1042,7 @@ * Operands: uint32_t nameIndex * Stack: obj => obj.length */ \ - MACRO(JSOP_LENGTH, Length, length, "length", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_LENGTH, "length", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ /* * Non-strict assignment to a property, `obj.name = val`. * @@ -1064,7 +1059,7 @@ * Operands: uint32_t nameIndex * Stack: obj, val => val */ \ - MACRO(JSOP_SETPROP, SetProp, set_prop, "setprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY|JOF_IC) \ + MACRO(JSOP_SETPROP, "setprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY|JOF_IC) \ /* * Like `JSOP_SETPROP`, but for strict mode code. Throw a TypeError if * `obj[key]` exists but is non-writable, if it's an accessor property with @@ -1075,7 +1070,7 @@ * Operands: uint32_t nameIndex * Stack: obj, val => val */ \ - MACRO(JSOP_STRICTSETPROP, StrictSetProp, strict_set_prop, "strict-setprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT|JOF_IC) \ + MACRO(JSOP_STRICTSETPROP, "strict-setprop", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT|JOF_IC) \ /* * Non-strict assignment to a property, `obj[key] = val`. * @@ -1088,7 +1083,7 @@ * Operands: * Stack: obj, key, val => val */ \ - MACRO(JSOP_SETELEM, SetElem, set_elem, "setelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY|JOF_IC) \ + MACRO(JSOP_SETELEM, "setelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY|JOF_IC) \ /* * Like `JSOP_SETELEM`, but for strict mode code. Throw a TypeError if * `obj[key]` exists but is non-writable, if it's an accessor property with @@ -1099,7 +1094,7 @@ * Operands: * Stack: obj, key, val => val */ \ - MACRO(JSOP_STRICTSETELEM, StrictSetElem, strict_set_elem, "strict-setelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT|JOF_IC) \ + MACRO(JSOP_STRICTSETELEM, "strict-setelem", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT|JOF_IC) \ /* * Delete a property from `obj`. Push true on success, false if the * property existed but could not be deleted. This implements `delete @@ -1116,7 +1111,7 @@ * Operands: uint32_t nameIndex * Stack: obj => succeeded */ \ - MACRO(JSOP_DELPROP, DelProp, del_prop, "delprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_CHECKSLOPPY) \ + MACRO(JSOP_DELPROP, "delprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_CHECKSLOPPY) \ /* * Like `JSOP_DELPROP`, but for strict mode code. Push `true` on success, * else throw a TypeError. @@ -1126,7 +1121,7 @@ * Operands: uint32_t nameIndex * Stack: obj => succeeded */ \ - MACRO(JSOP_STRICTDELPROP, StrictDelProp, strict_del_prop, "strict-delprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_CHECKSTRICT) \ + MACRO(JSOP_STRICTDELPROP, "strict-delprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|JOF_CHECKSTRICT) \ /* * Delete the property `obj[key]` and push `true` on success, `false` * if the property existed but could not be deleted. @@ -1142,7 +1137,7 @@ * Operands: * Stack: obj, key => succeeded */ \ - MACRO(JSOP_DELELEM, DelElem, del_elem, "delelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_CHECKSLOPPY) \ + MACRO(JSOP_DELELEM, "delelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_CHECKSLOPPY) \ /* * Like `JSOP_DELELEM, but for strict mode code. Push `true` on success, * else throw a TypeError. @@ -1152,7 +1147,7 @@ * Operands: * Stack: obj, key => succeeded */ \ - MACRO(JSOP_STRICTDELELEM, StrictDelElem, strict_del_elem, "strict-delelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_CHECKSTRICT) \ + MACRO(JSOP_STRICTDELELEM, "strict-delelem", NULL, 1, 2, 1, JOF_BYTE|JOF_ELEM|JOF_CHECKSTRICT) \ /* * Push true if `obj` has an own property `id`. * @@ -1168,7 +1163,7 @@ * Operands: * Stack: id, obj => (obj.hasOwnProperty(id)) */ \ - MACRO(JSOP_HASOWN, HasOwn, has_own, "hasown", NULL, 1, 2, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_HASOWN, "hasown", NULL, 1, 2, 1, JOF_BYTE|JOF_IC) \ /* * Push the SuperBase of the method `callee`. The SuperBase is * `callee.[[HomeObject]].[[GetPrototypeOf]]()`, the object where `super` @@ -1187,7 +1182,7 @@ * Operands: * Stack: callee => superBase */ \ - MACRO(JSOP_SUPERBASE, SuperBase, super_base, "superbase", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_SUPERBASE, "superbase", NULL, 1, 1, 1, JOF_BYTE) \ /* * Get the value of `receiver.name`, starting the property search at `obj`. * In spec terms, `obj.[[Get]](name, receiver)`. @@ -1204,7 +1199,7 @@ * Operands: uint32_t nameIndex * Stack: receiver, obj => super.name */ \ - MACRO(JSOP_GETPROP_SUPER, GetPropSuper, get_prop_super, "getprop-super", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETPROP_SUPER, "getprop-super", NULL, 5, 2, 1, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_IC) \ /* * Get the value of `receiver[key]`, starting the property search at `obj`. * In spec terms, `obj.[[Get]](key, receiver)`. @@ -1222,7 +1217,7 @@ * Operands: * Stack: receiver, key, obj => super[key] */ \ - MACRO(JSOP_GETELEM_SUPER, GetElemSuper, get_elem_super, "getelem-super", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETELEM_SUPER, "getelem-super", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_TYPESET|JOF_IC) \ /* * Assign `val` to `receiver.name`, starting the search for an existing * property at `obj`. In spec terms, `obj.[[Set]](name, val, receiver)`. @@ -1239,7 +1234,7 @@ * Operands: uint32_t nameIndex * Stack: receiver, obj, val => val */ \ - MACRO(JSOP_SETPROP_SUPER, SetPropSuper, set_prop_super, "setprop-super", NULL, 5, 3, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY) \ + MACRO(JSOP_SETPROP_SUPER, "setprop-super", NULL, 5, 3, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY) \ /* * Like `JSOP_SETPROP_SUPER`, but for strict mode code. * @@ -1248,7 +1243,7 @@ * Operands: uint32_t nameIndex * Stack: receiver, obj, val => val */ \ - MACRO(JSOP_STRICTSETPROP_SUPER, StrictSetPropSuper, strict_set_prop_super, "strictsetprop-super", NULL, 5, 3, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT) \ + MACRO(JSOP_STRICTSETPROP_SUPER, "strictsetprop-super", NULL, 5, 3, 1, JOF_ATOM|JOF_PROP|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT) \ /* * Assign `val` to `receiver[key]`, strating the search for an existing * property at `obj`. In spec terms, `obj.[[Set]](key, val, receiver)`. @@ -1265,7 +1260,7 @@ * Operands: * Stack: receiver, key, obj, val => val */ \ - MACRO(JSOP_SETELEM_SUPER, SetElemSuper, set_elem_super, "setelem-super", NULL, 1, 4, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY) \ + MACRO(JSOP_SETELEM_SUPER, "setelem-super", NULL, 1, 4, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY) \ /* * Like `JSOP_SETELEM_SUPER`, but for strict mode code. * @@ -1274,7 +1269,7 @@ * Operands: * Stack: receiver, key, obj, val => val */ \ - MACRO(JSOP_STRICTSETELEM_SUPER, StrictSetElemSuper, strict_set_elem_super, "strict-setelem-super", NULL, 1, 4, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT) \ + MACRO(JSOP_STRICTSETELEM_SUPER, "strict-setelem-super", NULL, 1, 4, 1, JOF_BYTE|JOF_ELEM|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT) \ /* * Set up a for-in loop by pushing a `PropertyIteratorObject` over the * enumerable properties of `val`. @@ -1314,7 +1309,7 @@ * Operands: * Stack: val => iter */ \ - MACRO(JSOP_ITER, Iter, iter, "iter", NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ + MACRO(JSOP_ITER, "iter", NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ /* * Get the next property name for a for-in loop. * @@ -1329,7 +1324,7 @@ * Operands: * Stack: iter => iter, name */ \ - MACRO(JSOP_MOREITER, MoreIter, more_iter, "moreiter", NULL, 1, 1, 2, JOF_BYTE) \ + MACRO(JSOP_MOREITER, "moreiter", NULL, 1, 1, 2, JOF_BYTE) \ /* * Test whether the value on top of the stack is * `MagicValue(JS_NO_ITER_VALUE)` and push the boolean result. @@ -1339,7 +1334,7 @@ * Operands: * Stack: val => val, done */ \ - MACRO(JSOP_ISNOITER, IsNoIter, is_no_iter, "isnoiter", NULL, 1, 1, 2, JOF_BYTE) \ + MACRO(JSOP_ISNOITER, "isnoiter", NULL, 1, 1, 2, JOF_BYTE) \ /* * No-op instruction to hint to IonBuilder that the value on top of the * stack is the (likely string) key in a for-in loop. @@ -1349,7 +1344,7 @@ * Operands: * Stack: val => val */ \ - MACRO(JSOP_ITERNEXT, IterNext, iter_next, "iternext", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_ITERNEXT, "iternext", NULL, 1, 1, 1, JOF_BYTE) \ /* * Exit a for-in loop, closing the iterator. * @@ -1360,7 +1355,7 @@ * Operands: * Stack: iter, iterval => */ \ - MACRO(JSOP_ENDITER, EndIter, end_iter, "enditer", NULL, 1, 2, 0, JOF_BYTE) \ + MACRO(JSOP_ENDITER, "enditer", NULL, 1, 2, 0, JOF_BYTE) \ /* * Check that the top value on the stack is an object, and throw a * TypeError if not. `kind` is used only to generate an appropriate error @@ -1378,7 +1373,7 @@ * Operands: uint8_t kind * Stack: result => result */ \ - MACRO(JSOP_CHECKISOBJ, CheckIsObj, check_is_obj, "checkisobj", NULL, 2, 1, 1, JOF_UINT8) \ + MACRO(JSOP_CHECKISOBJ, "checkisobj", NULL, 2, 1, 1, JOF_UINT8) \ /* * Check that the top value on the stack is callable, and throw a TypeError * if not. The operand `kind` is used only to generate an appropriate error @@ -1389,7 +1384,7 @@ * Operands: uint8_t kind * Stack: obj => obj */ \ - MACRO(JSOP_CHECKISCALLABLE, CheckIsCallable, check_is_callable, "checkiscallable", NULL, 2, 1, 1, JOF_UINT8) \ + MACRO(JSOP_CHECKISCALLABLE, "checkiscallable", NULL, 2, 1, 1, JOF_UINT8) \ /* * Throw a TypeError if `val` is `null` or `undefined`. * @@ -1407,7 +1402,7 @@ * Operands: * Stack: val => val */ \ - MACRO(JSOP_CHECKOBJCOERCIBLE, CheckObjCoercible, check_obj_coercible, "checkobjcoercible", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_CHECKOBJCOERCIBLE, "checkobjcoercible", NULL, 1, 1, 1, JOF_BYTE) \ /* * Create and push an async iterator wrapping the sync iterator `iter`. * `next` should be `iter`'s `.next` method. @@ -1425,7 +1420,7 @@ * Operands: * Stack: iter, next => asynciter */ \ - MACRO(JSOP_TOASYNCITER, ToAsyncIter, to_async_iter, "toasynciter", NULL, 1, 2, 1, JOF_BYTE) \ + MACRO(JSOP_TOASYNCITER, "toasynciter", NULL, 1, 2, 1, JOF_BYTE) \ /* * Set the prototype of `obj`. * @@ -1440,7 +1435,7 @@ * Operands: * Stack: obj, protoVal => obj */ \ - MACRO(JSOP_MUTATEPROTO, MutateProto, mutate_proto, "mutateproto", NULL, 1, 2, 1, JOF_BYTE) \ + MACRO(JSOP_MUTATEPROTO, "mutateproto", NULL, 1, 2, 1, JOF_BYTE) \ /* * Create and push a new Array object with the given `length`, * preallocating enough memory to hold that many elements. @@ -1450,7 +1445,7 @@ * Operands: uint32_t length * Stack: => array */ \ - MACRO(JSOP_NEWARRAY, NewArray, new_array, "newarray", NULL, 5, 0, 1, JOF_UINT32|JOF_IC) \ + MACRO(JSOP_NEWARRAY, "newarray", NULL, 5, 0, 1, JOF_UINT32|JOF_IC) \ /* * Initialize an array element `array[index]` with value `val`. * @@ -1471,7 +1466,7 @@ * Operands: uint32_t index * Stack: array, val => array */ \ - MACRO(JSOP_INITELEM_ARRAY, InitElemArray, init_elem_array, "initelem_array", NULL, 5, 2, 1, JOF_UINT32|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_INITELEM_ARRAY, "initelem_array", NULL, 5, 2, 1, JOF_UINT32|JOF_ELEM|JOF_PROPINIT|JOF_DETECTING|JOF_IC) \ /* * Initialize an array element `array[index++]` with value `val`. * @@ -1502,7 +1497,7 @@ * Operands: * Stack: array, index, val => array, (index + 1) */ \ - MACRO(JSOP_INITELEM_INC, InitElemInc, init_elem_inc, "initelem_inc", NULL, 1, 3, 2, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_IC) \ + MACRO(JSOP_INITELEM_INC, "initelem_inc", NULL, 1, 3, 2, JOF_BYTE|JOF_ELEM|JOF_PROPINIT|JOF_IC) \ /* * Push `MagicValue(JS_ELEMENTS_HOLE)`, representing an *Elision* in an * array literal (like the missing property 0 in the array `[, 1]`). @@ -1515,7 +1510,7 @@ * Operands: * Stack: => hole */ \ - MACRO(JSOP_HOLE, Hole, hole, "hole", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_HOLE, "hole", NULL, 1, 0, 1, JOF_BYTE) \ /* * Create and push a new array that shares the elements of a template * object. @@ -1532,7 +1527,7 @@ * Operands: uint32_t objectIndex * Stack: => array */ \ - MACRO(JSOP_NEWARRAY_COPYONWRITE, NewArrayCopyOnWrite, new_array_copy_on_write, "newarray_copyonwrite", NULL, 5, 0, 1, JOF_OBJECT) \ + MACRO(JSOP_NEWARRAY_COPYONWRITE, "newarray_copyonwrite", NULL, 5, 0, 1, JOF_OBJECT) \ /* * Clone and push a new RegExp object. * @@ -1545,7 +1540,7 @@ * Operands: uint32_t regexpIndex * Stack: => regexp */ \ - MACRO(JSOP_REGEXP, RegExp, reg_exp, "regexp", NULL, 5, 0, 1, JOF_REGEXP) \ + MACRO(JSOP_REGEXP, "regexp", NULL, 5, 0, 1, JOF_REGEXP) \ /* * Push a function object. * @@ -1569,7 +1564,7 @@ * Operands: uint32_t funcIndex * Stack: => fn */ \ - MACRO(JSOP_LAMBDA, Lambda, lambda, "lambda", NULL, 5, 0, 1, JOF_OBJECT) \ + MACRO(JSOP_LAMBDA, "lambda", NULL, 5, 0, 1, JOF_OBJECT) \ /* * Push a new arrow function. * @@ -1585,7 +1580,7 @@ * Operands: uint32_t funcIndex * Stack: newTarget => arrowFn */ \ - MACRO(JSOP_LAMBDA_ARROW, LambdaArrow, lambda_arrow, "lambda_arrow", NULL, 5, 1, 1, JOF_OBJECT) \ + MACRO(JSOP_LAMBDA_ARROW, "lambda_arrow", NULL, 5, 1, 1, JOF_OBJECT) \ /* * Set the name of a function. * @@ -1602,7 +1597,7 @@ * Operands: uint8_t prefixKind * Stack: fun, name => fun */ \ - MACRO(JSOP_SETFUNNAME, SetFunName, set_fun_name, "setfunname", NULL, 2, 2, 1, JOF_UINT8) \ + MACRO(JSOP_SETFUNNAME, "setfunname", NULL, 2, 2, 1, JOF_UINT8) \ /* * Initialize the home object for functions with super bindings. * @@ -1611,7 +1606,7 @@ * Operands: * Stack: fun, homeObject => fun */ \ - MACRO(JSOP_INITHOMEOBJECT, InitHomeObject, init_home_object, "inithomeobject", NULL, 1, 2, 1, JOF_BYTE) \ + MACRO(JSOP_INITHOMEOBJECT, "inithomeobject", NULL, 1, 2, 1, JOF_BYTE) \ /* * Throw a TypeError if `baseClass` isn't either `null` or a constructor. * @@ -1624,7 +1619,7 @@ * Operands: * Stack: baseClass => baseClass */ \ - MACRO(JSOP_CHECKCLASSHERITAGE, CheckClassHeritage, check_class_heritage, "checkclassheritage", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_CHECKCLASSHERITAGE, "checkclassheritage", NULL, 1, 1, 1, JOF_BYTE) \ /* * Like `JSOP_LAMBDA`, but using `proto` as the new function's * `[[Prototype]]` (or `%FunctionPrototype%` if `proto` is `null`). @@ -1644,7 +1639,7 @@ * Operands: uint32_t funcIndex * Stack: proto => obj */ \ - MACRO(JSOP_FUNWITHPROTO, FunWithProto, fun_with_proto, "funwithproto", NULL, 5, 1, 1, JOF_OBJECT) \ + MACRO(JSOP_FUNWITHPROTO, "funwithproto", NULL, 5, 1, 1, JOF_OBJECT) \ /* * Create and push a default constructor for a base class. * @@ -1663,7 +1658,7 @@ * Operands: uint32_t nameIndex, uint32_t sourceStart, uint32_t sourceEnd * Stack: => constructor */ \ - MACRO(JSOP_CLASSCONSTRUCTOR, ClassConstructor, class_constructor, "classconstructor", NULL, 13, 0, 1, JOF_CLASS_CTOR) \ + MACRO(JSOP_CLASSCONSTRUCTOR, "classconstructor", NULL, 13, 0, 1, JOF_CLASS_CTOR) \ /* * Create and push a default constructor for a derived class. * @@ -1683,7 +1678,7 @@ * Operands: uint32_t nameIndex, uint32_t sourceStart, uint32_t sourceEnd * Stack: proto => constructor */ \ - MACRO(JSOP_DERIVEDCONSTRUCTOR, DerivedConstructor, derived_constructor, "derivedconstructor", NULL, 13, 1, 1, JOF_CLASS_CTOR) \ + MACRO(JSOP_DERIVEDCONSTRUCTOR, "derivedconstructor", NULL, 13, 1, 1, JOF_CLASS_CTOR) \ /* * Pushes the current global's builtin prototype for a given proto key. * @@ -1692,7 +1687,7 @@ * Operands: uint8_t kind * Stack: => %BuiltinPrototype% */ \ - MACRO(JSOP_BUILTINPROTO, BuiltinProto, builtin_proto, "builtinproto", NULL, 2, 0, 1, JOF_UINT8) \ + MACRO(JSOP_BUILTINPROTO, "builtinproto", NULL, 2, 0, 1, JOF_UINT8) \ /* * Invoke `callee` with `this` and `args`, and push the return value. Throw * a TypeError if `callee` isn't a function. @@ -1721,11 +1716,11 @@ * Operands: uint16_t argc * Stack: callee, this, args[0], ..., args[argc-1] => rval */ \ - MACRO(JSOP_CALL, Call, call, "call", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ - MACRO(JSOP_CALLITER, CallIter, call_iter, "calliter", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ - MACRO(JSOP_FUNAPPLY, FunApply, fun_apply, "funapply", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ - MACRO(JSOP_FUNCALL, FunCall, fun_call, "funcall", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ - MACRO(JSOP_CALL_IGNORES_RV, CallIgnoresRv, call_ignores_rv, "call-ignores-rv", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_CALL, "call", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_CALLITER, "calliter", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_FUNAPPLY, "funapply", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_FUNCALL, "funcall", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_CALL_IGNORES_RV, "call-ignores-rv", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_IC) \ /* * Like `JSOP_CALL`, but the arguments are provided in an array rather than * a span of stack slots. Used to implement spread-call syntax: @@ -1741,7 +1736,7 @@ * Operands: * Stack: callee, this, args => rval */ \ - MACRO(JSOP_SPREADCALL, SpreadCall, spread_call, "spreadcall", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_SPREADCALL, "spreadcall", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_TYPESET|JOF_IC) \ /* * Push true if `arr` is an array object that can be passed directly as the * `args` argument to `JSOP_SPREADCALL`. @@ -1758,7 +1753,7 @@ * Operands: * Stack: arr => arr, optimized */ \ - MACRO(JSOP_OPTIMIZE_SPREADCALL, OptimizeSpreadCall, optimize_spread_call, "optimize-spreadcall", NULL, 1, 1, 2, JOF_BYTE) \ + MACRO(JSOP_OPTIMIZE_SPREADCALL, "optimize-spreadcall", NULL, 1, 1, 2, JOF_BYTE) \ /* * Perform a direct eval in the current environment if `callee` is the * builtin `eval` function, otherwise follow same behaviour as `JSOP_CALL`. @@ -1784,7 +1779,7 @@ * Operands: uint16_t argc * Stack: callee, this, args[0], ..., args[argc-1] => rval */ \ - MACRO(JSOP_EVAL, Eval, eval, "eval", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_CHECKSLOPPY|JOF_IC) \ + MACRO(JSOP_EVAL, "eval", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_CHECKSLOPPY|JOF_IC) \ /* * Spread-call variant of `JSOP_EVAL`. * @@ -1795,7 +1790,7 @@ * Operands: * Stack: callee, this, args => rval */ \ - MACRO(JSOP_SPREADEVAL, SpreadEval, spread_eval, "spreadeval", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_TYPESET|JOF_CHECKSLOPPY|JOF_IC) \ + MACRO(JSOP_SPREADEVAL, "spreadeval", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_TYPESET|JOF_CHECKSLOPPY|JOF_IC) \ /* * Like `JSOP_EVAL`, but for strict mode code. * @@ -1804,7 +1799,7 @@ * Operands: uint16_t argc * Stack: evalFn, this, args[0], ..., args[argc-1] => rval */ \ - MACRO(JSOP_STRICTEVAL, StrictEval, strict_eval, "strict-eval", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_CHECKSTRICT|JOF_IC) \ + MACRO(JSOP_STRICTEVAL, "strict-eval", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_TYPESET|JOF_CHECKSTRICT|JOF_IC) \ /* * Spread-call variant of `JSOP_STRICTEVAL`. * @@ -1815,7 +1810,7 @@ * Operands: * Stack: callee, this, args => rval */ \ - MACRO(JSOP_STRICTSPREADEVAL, StrictSpreadEval, strict_spread_eval, "strict-spreadeval", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_TYPESET|JOF_CHECKSTRICT|JOF_IC) \ + MACRO(JSOP_STRICTSPREADEVAL, "strict-spreadeval", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_TYPESET|JOF_CHECKSTRICT|JOF_IC) \ /* * Push the implicit `this` value for an unqualified function call, like * `foo()`. `nameIndex` gives the name of the function we're calling. @@ -1840,7 +1835,7 @@ * Operands: uint32_t nameIndex * Stack: => this */ \ - MACRO(JSOP_IMPLICITTHIS, ImplicitThis, implicit_this, "implicitthis", "", 5, 0, 1, JOF_ATOM) \ + MACRO(JSOP_IMPLICITTHIS, "implicitthis", "", 5, 0, 1, JOF_ATOM) \ /* * Like `JSOP_IMPLICITTHIS`, but the name must not be bound in any local * environments. @@ -1860,7 +1855,7 @@ * Operands: uint32_t nameIndex * Stack: => this */ \ - MACRO(JSOP_GIMPLICITTHIS, GImplicitThis, g_implicit_this, "gimplicitthis", "", 5, 0, 1, JOF_ATOM) \ + MACRO(JSOP_GIMPLICITTHIS, "gimplicitthis", "", 5, 0, 1, JOF_ATOM) \ /* * Push the call site object for a tagged template call. * @@ -1880,7 +1875,7 @@ * Operands: uint32_t objectIndex * Stack: => callSiteObj */ \ - MACRO(JSOP_CALLSITEOBJ, CallSiteObj, call_site_obj, "callsiteobj", NULL, 5, 0, 1, JOF_OBJECT) \ + MACRO(JSOP_CALLSITEOBJ, "callsiteobj", NULL, 5, 0, 1, JOF_OBJECT) \ /* * Push `MagicValue(JS_IS_CONSTRUCTING)`. * @@ -1892,7 +1887,7 @@ * Operands: * Stack: => JS_IS_CONSTRUCTING */ \ - MACRO(JSOP_IS_CONSTRUCTING, IsConstructing, is_constructing, "is-constructing", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_IS_CONSTRUCTING, "is-constructing", NULL, 1, 0, 1, JOF_BYTE) \ /* * Invoke `callee` as a constructor with `args` and `newTarget`, and push * the return value. Throw a TypeError if `callee` isn't a constructor. @@ -1912,8 +1907,8 @@ * Operands: uint16_t argc * Stack: callee, isConstructing, args[0], ..., args[argc-1], newTarget => rval */ \ - MACRO(JSOP_NEW, New, new_, "new", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CONSTRUCT|JOF_TYPESET|JOF_IC|JOF_IC) \ - MACRO(JSOP_SUPERCALL, SuperCall, super_call, "supercall", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CONSTRUCT|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_NEW, "new", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CONSTRUCT|JOF_TYPESET|JOF_IC|JOF_IC) \ + MACRO(JSOP_SUPERCALL, "supercall", NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CONSTRUCT|JOF_TYPESET|JOF_IC) \ /* * Spread-call variant of `JSOP_NEW`. * @@ -1931,8 +1926,8 @@ * Operands: * Stack: callee, isConstructing, args, newTarget => rval */ \ - MACRO(JSOP_SPREADNEW, SpreadNew, spread_new, "spreadnew", NULL, 1, 4, 1, JOF_BYTE|JOF_INVOKE|JOF_CONSTRUCT|JOF_SPREAD|JOF_TYPESET|JOF_IC) \ - MACRO(JSOP_SPREADSUPERCALL, SpreadSuperCall, spread_super_call, "spreadsupercall", NULL, 1, 4, 1, JOF_BYTE|JOF_INVOKE|JOF_CONSTRUCT|JOF_SPREAD|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_SPREADNEW, "spreadnew", NULL, 1, 4, 1, JOF_BYTE|JOF_INVOKE|JOF_CONSTRUCT|JOF_SPREAD|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_SPREADSUPERCALL, "spreadsupercall", NULL, 1, 4, 1, JOF_BYTE|JOF_INVOKE|JOF_CONSTRUCT|JOF_SPREAD|JOF_TYPESET|JOF_IC) \ /* * Push the prototype of `callee` in preparation for calling `super()`. * Throw a TypeError if that value is not a constructor. @@ -1948,7 +1943,7 @@ * Operands: * Stack: callee => superFun */ \ - MACRO(JSOP_SUPERFUN, SuperFun, super_fun, "superfun", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_SUPERFUN, "superfun", NULL, 1, 1, 1, JOF_BYTE) \ /* * Throw a ReferenceError if `thisval` is not * `MagicValue(JS_UNINITIALIZED_LEXICAL)`. Used in derived class @@ -1963,7 +1958,7 @@ * Operands: * Stack: thisval => thisval */ \ - MACRO(JSOP_CHECKTHISREINIT, CheckThisReinit, check_this_reinit, "checkthisreinit", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_CHECKTHISREINIT, "checkthisreinit", NULL, 1, 1, 1, JOF_BYTE) \ /* * Initializes generator frame, creates a generator and pushes it on the * stack. @@ -1973,7 +1968,7 @@ * Operands: * Stack: => generator */ \ - MACRO(JSOP_GENERATOR, Generator, generator, "generator", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_GENERATOR, "generator", NULL, 1, 0, 1, JOF_BYTE) \ /* * Pops the generator from the top of the stack, suspends it and stops * execution. @@ -1986,7 +1981,7 @@ * Operands: uint24_t resumeIndex * Stack: gen => rval, gen, resumeKind */ \ - MACRO(JSOP_INITIALYIELD, InitialYield, initial_yield, "initialyield", NULL, 4, 1, 3, JOF_RESUMEINDEX) \ + MACRO(JSOP_INITIALYIELD, "initialyield", NULL, 4, 1, 3, JOF_RESUMEINDEX) \ /* * Bytecode emitted after 'yield' expressions. This is useful for the * Debugger and `AbstractGeneratorObject::isAfterYieldOrAwait`. It's @@ -1999,7 +1994,7 @@ * Operands: uint32_t icIndex * Stack: => */ \ - MACRO(JSOP_AFTERYIELD, AfterYield, after_yield, "afteryield", NULL, 5, 0, 0, JOF_ICINDEX) \ + MACRO(JSOP_AFTERYIELD, "afteryield", NULL, 5, 0, 0, JOF_ICINDEX) \ /* * Pops the generator and suspends and closes it. Yields the value in the * frame's return value slot. @@ -2009,7 +2004,7 @@ * Operands: * Stack: gen => */ \ - MACRO(JSOP_FINALYIELDRVAL, FinalYieldRval, final_yield_rval, "finalyieldrval", NULL, 1, 1, 0, JOF_BYTE) \ + MACRO(JSOP_FINALYIELDRVAL, "finalyieldrval", NULL, 1, 1, 0, JOF_BYTE) \ /* * Pops the generator and the return value 'rval1', stops execution and * returns 'rval1'. @@ -2022,7 +2017,7 @@ * Operands: uint24_t resumeIndex * Stack: rval1, gen => rval2, gen, resumeKind */ \ - MACRO(JSOP_YIELD, Yield, yield, "yield", NULL, 4, 2, 3, JOF_RESUMEINDEX) \ + MACRO(JSOP_YIELD, "yield", NULL, 4, 2, 3, JOF_RESUMEINDEX) \ /* * Pushes a boolean indicating whether the top of the stack is * `MagicValue(JS_GENERATOR_CLOSING)`. @@ -2032,7 +2027,7 @@ * Operands: * Stack: val => val, res */ \ - MACRO(JSOP_ISGENCLOSING, IsGenClosing, is_gen_closing, "isgenclosing", NULL, 1, 1, 2, JOF_BYTE) \ + MACRO(JSOP_ISGENCLOSING, "isgenclosing", NULL, 1, 1, 2, JOF_BYTE) \ /* * Pops the top two values 'value' and 'gen' from the stack, then starts * "awaiting" for 'value' to be resolved, which will then resume the @@ -2044,7 +2039,7 @@ * Operands: * Stack: value, gen => promise */ \ - MACRO(JSOP_ASYNCAWAIT, AsyncAwait, async_await, "async-await", NULL, 1, 2, 1, JOF_BYTE) \ + MACRO(JSOP_ASYNCAWAIT, "async-await", NULL, 1, 2, 1, JOF_BYTE) \ /* * Pops the top two values 'valueOrReason' and 'gen' from the stack, then * pushes the promise resolved with 'valueOrReason'. `gen` must be the @@ -2056,7 +2051,7 @@ * Operands: uint8_t fulfillOrReject * Stack: valueOrReason, gen => promise */ \ - MACRO(JSOP_ASYNCRESOLVE, AsyncResolve, async_resolve, "async-resolve", NULL, 2, 2, 1, JOF_UINT8) \ + MACRO(JSOP_ASYNCRESOLVE, "async-resolve", NULL, 2, 2, 1, JOF_UINT8) \ /* * Pops the generator and the return value 'promise', stops execution and * returns 'promise'. @@ -2069,7 +2064,7 @@ * Operands: uint24_t resumeIndex * Stack: promise, gen => resolved, gen, resumeKind */ \ - MACRO(JSOP_AWAIT, Await, await, "await", NULL, 4, 2, 3, JOF_RESUMEINDEX) \ + MACRO(JSOP_AWAIT, "await", NULL, 4, 2, 3, JOF_RESUMEINDEX) \ /* * Pops the top of stack value as 'value', checks if the await for 'value' * can be skipped. If the await operation can be skipped and the resolution @@ -2082,7 +2077,7 @@ * Operands: * Stack: value => value_or_resolved, canskip */ \ - MACRO(JSOP_TRYSKIPAWAIT, TrySkipAwait, try_skip_await, "tryskipawait", NULL, 1, 1, 2, JOF_BYTE) \ + MACRO(JSOP_TRYSKIPAWAIT, "tryskipawait", NULL, 1, 1, 2, JOF_BYTE) \ /* * Pushes one of the GeneratorResumeKind values as Int32Value. * @@ -2091,7 +2086,7 @@ * Operands: GeneratorResumeKind resumeKind (encoded as uint8_t) * Stack: => resumeKind */ \ - MACRO(JSOP_RESUMEKIND, ResumeKind, resume_kind, "resumekind", NULL, 2, 0, 1, JOF_UINT8) \ + MACRO(JSOP_RESUMEKIND, "resumekind", NULL, 2, 0, 1, JOF_UINT8) \ /* * Pops the generator and resumeKind values. resumeKind is the * GeneratorResumeKind stored as int32. If resumeKind is Next, continue @@ -2103,7 +2098,7 @@ * Operands: * Stack: rval, gen, resumeKind => rval */ \ - MACRO(JSOP_CHECK_RESUMEKIND, CheckResumeKind, check_resume_kind, "check-resumekind", NULL, 1, 3, 1, JOF_BYTE) \ + MACRO(JSOP_CHECK_RESUMEKIND, "check-resumekind", NULL, 1, 3, 1, JOF_BYTE) \ /* * Pops the generator, argument and resumeKind from the stack, pushes a new * generator frame and resumes execution of it. Pushes the return value @@ -2114,7 +2109,7 @@ * Operands: * Stack: gen, val, resumeKind => rval */ \ - MACRO(JSOP_RESUME, Resume, resume, "resume", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE) \ + MACRO(JSOP_RESUME, "resume", NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE) \ /* * No-op instruction marking the target of a jump instruction. * @@ -2128,7 +2123,7 @@ * Operands: uint32_t icIndex * Stack: => */ \ - MACRO(JSOP_JUMPTARGET, JumpTarget, jump_target, "jumptarget", NULL, 5, 0, 0, JOF_ICINDEX) \ + MACRO(JSOP_JUMPTARGET, "jumptarget", NULL, 5, 0, 0, JOF_ICINDEX) \ /* * Marks the target of the backwards jump for some loop. * @@ -2146,7 +2141,7 @@ * Operands: uint32_t icIndex, uint8_t depthHint * Stack: => */ \ - MACRO(JSOP_LOOPHEAD, LoopHead, loop_head, "loophead", NULL, 6, 0, 0, JOF_LOOPHEAD) \ + MACRO(JSOP_LOOPHEAD, "loophead", NULL, 6, 0, 0, JOF_LOOPHEAD) \ /* * Jump to a 32-bit offset from the current bytecode. * @@ -2157,7 +2152,7 @@ * Operands: int32_t offset * Stack: => */ \ - MACRO(JSOP_GOTO, Goto, goto_, "goto", NULL, 5, 0, 0, JOF_JUMP) \ + MACRO(JSOP_GOTO, "goto", NULL, 5, 0, 0, JOF_JUMP) \ /* * If ToBoolean(`cond`) is false, jumps to a 32-bit offset from the current * instruction. @@ -2167,7 +2162,7 @@ * Operands: int32_t forwardOffset * Stack: cond => */ \ - MACRO(JSOP_IFEQ, IfEq, if_eq, "ifeq", NULL, 5, 1, 0, JOF_JUMP|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_IFEQ, "ifeq", NULL, 5, 1, 0, JOF_JUMP|JOF_DETECTING|JOF_IC) \ /* * If ToBoolean(`cond`) is true, jump to a 32-bit offset from the current * instruction. @@ -2180,7 +2175,7 @@ * Operands: int32_t offset * Stack: cond => */ \ - MACRO(JSOP_IFNE, IfNe, if_ne, "ifne", NULL, 5, 1, 0, JOF_JUMP|JOF_IC) \ + MACRO(JSOP_IFNE, "ifne", NULL, 5, 1, 0, JOF_JUMP|JOF_IC) \ /* * Short-circuit for logical AND. * @@ -2192,7 +2187,7 @@ * Operands: int32_t forwardOffset * Stack: cond => cond */ \ - MACRO(JSOP_AND, And, and_, "and", NULL, 5, 1, 1, JOF_JUMP|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_AND, "and", NULL, 5, 1, 1, JOF_JUMP|JOF_DETECTING|JOF_IC) \ /* * Short-circuit for logical OR. * @@ -2204,7 +2199,7 @@ * Operands: int32_t forwardOffset * Stack: cond => cond */ \ - MACRO(JSOP_OR, Or, or_, "or", NULL, 5, 1, 1, JOF_JUMP|JOF_DETECTING|JOF_IC) \ + MACRO(JSOP_OR, "or", NULL, 5, 1, 1, JOF_JUMP|JOF_DETECTING|JOF_IC) \ /* * Short-circuiting for nullish coalescing. * @@ -2216,7 +2211,7 @@ * Operands: int32_t forwardOffset * Stack: val => val */ \ - MACRO(JSOP_COALESCE, Coalesce, coalesce, "coalesce", NULL, 5, 1, 1, JOF_JUMP|JOF_DETECTING) \ + MACRO(JSOP_COALESCE, "coalesce", NULL, 5, 1, 1, JOF_JUMP|JOF_DETECTING) \ /* * Like `JSOP_IFNE` ("jump if true"), but if the branch is taken, * pop and discard an additional stack value. @@ -2254,7 +2249,7 @@ * Operands: int32_t forwardOffset * Stack: val, cond => val (if !cond) */ \ - MACRO(JSOP_CASE, Case, case_, "case", NULL, 5, 2, 1, JOF_JUMP) \ + MACRO(JSOP_CASE, "case", NULL, 5, 2, 1, JOF_JUMP) \ /* * Like `JSOP_GOTO`, but pop and discard an additional stack value. * @@ -2267,7 +2262,7 @@ * Operands: int32_t forwardOffset * Stack: lval => */ \ - MACRO(JSOP_DEFAULT, Default, default_, "default", NULL, 5, 1, 0, JOF_JUMP) \ + MACRO(JSOP_DEFAULT, "default", NULL, 5, 1, 0, JOF_JUMP) \ /* * Optimized switch-statement dispatch, used when all `case` labels are * small integer constants. @@ -2288,7 +2283,7 @@ * uint24_t firstResumeIndex * Stack: i => */ \ - MACRO(JSOP_TABLESWITCH, TableSwitch, table_switch, "tableswitch", NULL, 16, 1, 0, JOF_TABLESWITCH|JOF_DETECTING) \ + MACRO(JSOP_TABLESWITCH, "tableswitch", NULL, 16, 1, 0, JOF_TABLESWITCH|JOF_DETECTING) \ /* * Return `rval`. * @@ -2300,7 +2295,7 @@ * Operands: * Stack: rval => */ \ - MACRO(JSOP_RETURN, Return, return_, "return", NULL, 1, 1, 0, JOF_BYTE) \ + MACRO(JSOP_RETURN, "return", NULL, 1, 1, 0, JOF_BYTE) \ /* * Push the current stack frame's `returnValue`. If no `JSOP_SETRVAL` * instruction has been executed in this stack frame, this is `undefined`. @@ -2314,7 +2309,7 @@ * Operands: * Stack: => rval */ \ - MACRO(JSOP_GETRVAL, GetRval, get_rval, "getrval", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_GETRVAL, "getrval", NULL, 1, 0, 1, JOF_BYTE) \ /* * Store `rval` in the current stack frame's `returnValue` slot. * @@ -2323,7 +2318,7 @@ * Operands: * Stack: rval => */ \ - MACRO(JSOP_SETRVAL, SetRval, set_rval, "setrval", NULL, 1, 1, 0, JOF_BYTE) \ + MACRO(JSOP_SETRVAL, "setrval", NULL, 1, 1, 0, JOF_BYTE) \ /* * Stop execution and return the current stack frame's `returnValue`. If no * `JSOP_SETRVAL` instruction has been executed in this stack frame, this @@ -2340,7 +2335,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_RETRVAL, RetRval, ret_rval, "retrval", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_RETRVAL, "retrval", NULL, 1, 0, 0, JOF_BYTE) \ /* * Check the return value in a derived class constructor. * @@ -2365,7 +2360,7 @@ * Operands: * Stack: thisval => */ \ - MACRO(JSOP_CHECKRETURN, CheckReturn, check_return, "checkreturn", NULL, 1, 1, 0, JOF_BYTE) \ + MACRO(JSOP_CHECKRETURN, "checkreturn", NULL, 1, 1, 0, JOF_BYTE) \ /* * Throw `exc`. (ノಠ益ಠ)ノ彡┴──┴ * @@ -2387,7 +2382,7 @@ * Operands: * Stack: exc => */ \ - MACRO(JSOP_THROW, Throw, throw_, js_throw_str, NULL, 1, 1, 0, JOF_BYTE) \ + MACRO(JSOP_THROW, js_throw_str, NULL, 1, 1, 0, JOF_BYTE) \ /* * Create and throw an Error object. * @@ -2404,7 +2399,7 @@ * Operands: uint16_t msgNumber * Stack: => */ \ - MACRO(JSOP_THROWMSG, ThrowMsg, throw_msg, "throwmsg", NULL, 3, 0, 0, JOF_UINT16) \ + MACRO(JSOP_THROWMSG, "throwmsg", NULL, 3, 0, 0, JOF_UINT16) \ /* * Throw a TypeError for invalid assignment to a `const`. The environment * coordinate is used to get the variable name for the error message. @@ -2414,7 +2409,7 @@ * Operands: uint8_t hops, uint24_t slot * Stack: v => v */ \ - MACRO(JSOP_THROWSETALIASEDCONST, ThrowSetAliasedConst, throw_set_aliased_const, "throwsetaliasedconst", NULL, 5, 1, 1, JOF_ENVCOORD|JOF_NAME|JOF_DETECTING) \ + MACRO(JSOP_THROWSETALIASEDCONST, "throwsetaliasedconst", NULL, 5, 1, 1, JOF_ENVCOORD|JOF_NAME|JOF_DETECTING) \ /* * Throw a TypeError for invalid assignment to the callee binding in a named * lambda, which is always a `const` binding. This is a different bytecode @@ -2427,7 +2422,7 @@ * Operands: * Stack: v => v */ \ - MACRO(JSOP_THROWSETCALLEE, ThrowSetCallee, throw_set_callee, "throwsetcallee", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_THROWSETCALLEE, "throwsetcallee", NULL, 1, 1, 1, JOF_BYTE) \ /* * Throws a runtime TypeError for invalid assignment to an optimized * `const` binding. `localno` is used to get the variable name for the @@ -2438,7 +2433,7 @@ * Operands: uint24_t localno * Stack: v => v */ \ - MACRO(JSOP_THROWSETCONST, ThrowSetConst, throw_set_const, "throwsetconst", NULL, 4, 1, 1, JOF_LOCAL|JOF_NAME|JOF_DETECTING) \ + MACRO(JSOP_THROWSETCONST, "throwsetconst", NULL, 4, 1, 1, JOF_LOCAL|JOF_NAME|JOF_DETECTING) \ /* * No-op instruction that marks the top of the bytecode for a * *TryStatement*. @@ -2455,7 +2450,7 @@ * Operands: int32_t jumpAtEndOffset * Stack: => */ \ - MACRO(JSOP_TRY, Try, try_, "try", NULL, 5, 0, 0, JOF_CODE_OFFSET) \ + MACRO(JSOP_TRY, "try", NULL, 5, 0, 0, JOF_CODE_OFFSET) \ /* * No-op instruction used by the exception unwinder to determine the * correct environment to unwind to when performing IteratorClose due to @@ -2466,7 +2461,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_TRY_DESTRUCTURING, TryDestructuring, try_destructuring, "try-destructuring", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_TRY_DESTRUCTURING, "try-destructuring", NULL, 1, 0, 0, JOF_BYTE) \ /* * Push and clear the pending exception. ┬──┬◡ノ(° -°ノ) * @@ -2482,7 +2477,7 @@ * Operands: * Stack: => exception */ \ - MACRO(JSOP_EXCEPTION, Exception, exception, "exception", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_EXCEPTION, "exception", NULL, 1, 0, 1, JOF_BYTE) \ /* * Push `resumeIndex`. * @@ -2493,7 +2488,7 @@ * Operands: uint24_t resumeIndex * Stack: => resumeIndex */ \ - MACRO(JSOP_RESUMEINDEX, ResumeIndex, resume_index, "resume-index", NULL, 4, 0, 1, JOF_RESUMEINDEX) \ + MACRO(JSOP_RESUMEINDEX, "resume-index", NULL, 4, 0, 1, JOF_RESUMEINDEX) \ /* * Jump to the start of a `finally` block. * @@ -2545,7 +2540,7 @@ * Operands: int32_t forwardOffset * Stack: false, resumeIndex => */ \ - MACRO(JSOP_GOSUB, Gosub, gosub, "gosub", NULL, 5, 2, 0, JOF_JUMP) \ + MACRO(JSOP_GOSUB, "gosub", NULL, 5, 2, 0, JOF_JUMP) \ /* * No-op instruction that marks the start of a `finally` block. This has a * def count of 2, but the values are already on the stack (they're @@ -2558,7 +2553,7 @@ * Operands: * Stack: => false, resumeIndex */ \ - MACRO(JSOP_FINALLY, Finally, finally, "finally", NULL, 1, 0, 2, JOF_BYTE) \ + MACRO(JSOP_FINALLY, "finally", NULL, 1, 0, 2, JOF_BYTE) \ /* * Jump back to the next instruction, or rethrow an exception, at the end * of a `finally` block. See `JSOP_GOSUB` for the explanation. @@ -2574,7 +2569,7 @@ * Operands: * Stack: throwing, v => */ \ - MACRO(JSOP_RETSUB, Retsub, retsub, "retsub", NULL, 1, 2, 0, JOF_BYTE) \ + MACRO(JSOP_RETSUB, "retsub", NULL, 1, 2, 0, JOF_BYTE) \ /* * Push `MagicValue(JS_UNINITIALIZED_LEXICAL)`, a magic value used to mark * a binding as uninitialized. @@ -2586,7 +2581,7 @@ * Operands: * Stack: => uninitialized */ \ - MACRO(JSOP_UNINITIALIZED, Uninitialized, uninitialized, "uninitialized", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_UNINITIALIZED, "uninitialized", NULL, 1, 0, 1, JOF_BYTE) \ /* * Initialize an optimized local lexical binding; or mark it as * uninitialized. @@ -2608,7 +2603,7 @@ * Operands: uint24_t localno * Stack: v => v */ \ - MACRO(JSOP_INITLEXICAL, InitLexical, init_lexical, "initlexical", NULL, 4, 1, 1, JOF_LOCAL|JOF_NAME|JOF_DETECTING) \ + MACRO(JSOP_INITLEXICAL, "initlexical", NULL, 4, 1, 1, JOF_LOCAL|JOF_NAME|JOF_DETECTING) \ /* * Initialize a global lexical binding; or mark it as uninitialized. * @@ -2619,7 +2614,7 @@ * Operands: uint32_t nameIndex * Stack: val => val */ \ - MACRO(JSOP_INITGLEXICAL, InitGLexical, init_g_lexical, "initglexical", NULL, 5, 1, 1, JOF_ATOM|JOF_NAME|JOF_PROPINIT|JOF_GNAME|JOF_IC) \ + MACRO(JSOP_INITGLEXICAL, "initglexical", NULL, 5, 1, 1, JOF_ATOM|JOF_NAME|JOF_PROPINIT|JOF_GNAME|JOF_IC) \ /* * Initialize an aliased lexical binding; or mark it as uninitialized. * @@ -2637,7 +2632,7 @@ * Operands: uint8_t hops, uint24_t slot * Stack: v => v */ \ - MACRO(JSOP_INITALIASEDLEXICAL, InitAliasedLexical, init_aliased_lexical, "initaliasedlexical", NULL, 5, 1, 1, JOF_ENVCOORD|JOF_NAME|JOF_PROPINIT|JOF_DETECTING) \ + MACRO(JSOP_INITALIASEDLEXICAL, "initaliasedlexical", NULL, 5, 1, 1, JOF_ENVCOORD|JOF_NAME|JOF_PROPINIT|JOF_DETECTING) \ /* * Throw a ReferenceError if the optimized local `localno` is * uninitialized. @@ -2658,7 +2653,7 @@ * Operands: uint24_t localno * Stack: => */ \ - MACRO(JSOP_CHECKLEXICAL, CheckLexical, check_lexical, "checklexical", NULL, 4, 0, 0, JOF_LOCAL|JOF_NAME) \ + MACRO(JSOP_CHECKLEXICAL, "checklexical", NULL, 4, 0, 0, JOF_LOCAL|JOF_NAME) \ /* * Like `JSOP_CHECKLEXICAL` but for aliased bindings. * @@ -2671,7 +2666,7 @@ * Operands: uint8_t hops, uint24_t slot * Stack: => */ \ - MACRO(JSOP_CHECKALIASEDLEXICAL, CheckAliasedLexical, check_aliased_lexical, "checkaliasedlexical", NULL, 5, 0, 0, JOF_ENVCOORD|JOF_NAME) \ + MACRO(JSOP_CHECKALIASEDLEXICAL, "checkaliasedlexical", NULL, 5, 0, 0, JOF_ENVCOORD|JOF_NAME) \ /* * Throw a ReferenceError if the value on top of the stack is * `MagicValue(JS_UNINITIALIZED_LEXICAL)`. Used in derived class @@ -2687,7 +2682,7 @@ * Operands: * Stack: this => this */ \ - MACRO(JSOP_CHECKTHIS, CheckThis, check_this, "checkthis", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_CHECKTHIS, "checkthis", NULL, 1, 1, 1, JOF_BYTE) \ /* * Push the global environment onto the stack, unless the script has a * non-syntactic global scope. In that case, this acts like JSOP_BINDNAME. @@ -2699,7 +2694,7 @@ * Operands: uint32_t nameIndex * Stack: => global */ \ - MACRO(JSOP_BINDGNAME, BindGName, bind_g_name, "bindgname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_GNAME|JOF_IC) \ + MACRO(JSOP_BINDGNAME, "bindgname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_GNAME|JOF_IC) \ /* * Look up a name on the environment chain and push the environment which * contains a binding for that name. If no such binding exists, push the @@ -2710,7 +2705,7 @@ * Operands: uint32_t nameIndex * Stack: => env */ \ - MACRO(JSOP_BINDNAME, BindName, bind_name, "bindname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_IC) \ + MACRO(JSOP_BINDNAME, "bindname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_IC) \ /* * Find a binding on the environment chain and push its value. * @@ -2732,7 +2727,7 @@ * Operands: uint32_t nameIndex * Stack: => val */ \ - MACRO(JSOP_GETNAME, GetName, get_name, "getname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETNAME, "getname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ /* * Find a global binding and push its value. * @@ -2756,7 +2751,7 @@ * Operands: uint32_t nameIndex * Stack: => val */ \ - MACRO(JSOP_GETGNAME, GetGName, get_g_name, "getgname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_GNAME|JOF_IC) \ + MACRO(JSOP_GETGNAME, "getgname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_GNAME|JOF_IC) \ /* * Push the value of an argument that is stored in the stack frame * or in an `ArgumentsObject`. @@ -2766,7 +2761,7 @@ * Operands: uint16_t argno * Stack: => arguments[argno] */ \ - MACRO(JSOP_GETARG, GetArg, get_arg, "getarg", NULL, 3, 0, 1, JOF_QARG|JOF_NAME) \ + MACRO(JSOP_GETARG, "getarg", NULL, 3, 0, 1, JOF_QARG|JOF_NAME) \ /* * Push the value of an optimized local variable. * @@ -2778,7 +2773,7 @@ * Operands: uint24_t localno * Stack: => val */ \ - MACRO(JSOP_GETLOCAL, GetLocal, get_local, "getlocal", NULL, 4, 0, 1, JOF_LOCAL|JOF_NAME) \ + MACRO(JSOP_GETLOCAL, "getlocal", NULL, 4, 0, 1, JOF_LOCAL|JOF_NAME) \ /* * Push the value of an aliased binding. * @@ -2805,7 +2800,7 @@ * Operands: uint8_t hops, uint24_t slot * Stack: => aliasedVar */ \ - MACRO(JSOP_GETALIASEDVAR, GetAliasedVar, get_aliased_var, "getaliasedvar", NULL, 5, 0, 1, JOF_ENVCOORD|JOF_NAME|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETALIASEDVAR, "getaliasedvar", NULL, 5, 0, 1, JOF_ENVCOORD|JOF_NAME|JOF_TYPESET|JOF_IC) \ /* * Get the value of a module import by name and pushes it onto the stack. * @@ -2814,7 +2809,7 @@ * Operands: uint32_t nameIndex * Stack: => val */ \ - MACRO(JSOP_GETIMPORT, GetImport, get_import, "getimport", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETIMPORT, "getimport", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ /* * Get the value of a binding from the environment `env`. If the name is * not bound in `env`, throw a ReferenceError. @@ -2839,7 +2834,7 @@ * Operands: uint32_t nameIndex * Stack: env => v */ \ - MACRO(JSOP_GETBOUNDNAME, GetBoundName, get_bound_name, "getboundname", NULL, 5, 1, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETBOUNDNAME, "getboundname", NULL, 5, 1, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ /* * Push the value of an intrinsic onto the stack. * @@ -2852,7 +2847,7 @@ * Operands: uint32_t nameIndex * Stack: => intrinsic[name] */ \ - MACRO(JSOP_GETINTRINSIC, GetIntrinsic, get_intrinsic, "getintrinsic", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_GETINTRINSIC, "getintrinsic", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_IC) \ /* * Pushes the currently executing function onto the stack. * @@ -2872,7 +2867,7 @@ * Operands: * Stack: => callee */ \ - MACRO(JSOP_CALLEE, Callee, callee, "callee", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_CALLEE, "callee", NULL, 1, 0, 1, JOF_BYTE) \ /* * Load the callee stored in a CallObject on the environment chain. The * numHops operand is the number of environment objects to skip on the @@ -2883,7 +2878,7 @@ * Operands: uint8_t numHops * Stack: => callee */ \ - MACRO(JSOP_ENVCALLEE, EnvCallee, env_callee, "envcallee", NULL, 2, 0, 1, JOF_UINT8) \ + MACRO(JSOP_ENVCALLEE, "envcallee", NULL, 2, 0, 1, JOF_UINT8) \ /* * Assign `val` to the binding in `env` with the name given by `nameIndex`. * Throw a ReferenceError if the binding is an uninitialized lexical. @@ -2911,7 +2906,7 @@ * Operands: uint32_t nameIndex * Stack: env, val => val */ \ - MACRO(JSOP_SETNAME, SetName, set_name, "setname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY|JOF_IC) \ + MACRO(JSOP_SETNAME, "setname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSLOPPY|JOF_IC) \ /* * Like `JSOP_SETNAME`, but throw a TypeError if there is no binding for * the specified name in `env`, or if the binding is immutable (a `const` @@ -2926,7 +2921,7 @@ * Operands: uint32_t nameIndex * Stack: env, val => val */ \ - MACRO(JSOP_STRICTSETNAME, StrictSetName, strict_set_name, "strict-setname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT|JOF_IC) \ + MACRO(JSOP_STRICTSETNAME, "strict-setname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_CHECKSTRICT|JOF_IC) \ /* * Like `JSOP_SETNAME`, but for assigning to globals. `env` must be an * environment pushed by `JSOP_BINDGNAME`. @@ -2936,7 +2931,7 @@ * Operands: uint32_t nameIndex * Stack: env, val => val */ \ - MACRO(JSOP_SETGNAME, SetGName, set_g_name, "setgname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_GNAME|JOF_CHECKSLOPPY|JOF_IC) \ + MACRO(JSOP_SETGNAME, "setgname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_GNAME|JOF_CHECKSLOPPY|JOF_IC) \ /* * Like `JSOP_STRICTSETGNAME`, but for assigning to globals. `env` must be * an environment pushed by `JSOP_BINDGNAME`. @@ -2946,7 +2941,7 @@ * Operands: uint32_t nameIndex * Stack: env, val => val */ \ - MACRO(JSOP_STRICTSETGNAME, StrictSetGName, strict_set_g_name, "strict-setgname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_GNAME|JOF_CHECKSTRICT|JOF_IC) \ + MACRO(JSOP_STRICTSETGNAME, "strict-setgname", NULL, 5, 2, 1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_GNAME|JOF_CHECKSTRICT|JOF_IC) \ /* * Assign `val` to an argument binding that's stored in the stack frame or * in an `ArgumentsObject`. @@ -2956,7 +2951,7 @@ * Operands: uint16_t argno * Stack: val => val */ \ - MACRO(JSOP_SETARG, SetArg, set_arg, "setarg", NULL, 3, 1, 1, JOF_QARG|JOF_NAME) \ + MACRO(JSOP_SETARG, "setarg", NULL, 3, 1, 1, JOF_QARG|JOF_NAME) \ /* * Assign to an optimized local binding. * @@ -2965,7 +2960,7 @@ * Operands: uint24_t localno * Stack: v => v */ \ - MACRO(JSOP_SETLOCAL, SetLocal, set_local, "setlocal", NULL, 4, 1, 1, JOF_LOCAL|JOF_NAME|JOF_DETECTING) \ + MACRO(JSOP_SETLOCAL, "setlocal", NULL, 4, 1, 1, JOF_LOCAL|JOF_NAME|JOF_DETECTING) \ /* * Assign to an aliased binding. * @@ -2980,7 +2975,7 @@ * Operands: uint8_t hops, uint24_t slot * Stack: val => val */ \ - MACRO(JSOP_SETALIASEDVAR, SetAliasedVar, set_aliased_var, "setaliasedvar", NULL, 5, 1, 1, JOF_ENVCOORD|JOF_NAME|JOF_PROPSET|JOF_DETECTING) \ + MACRO(JSOP_SETALIASEDVAR, "setaliasedvar", NULL, 5, 1, 1, JOF_ENVCOORD|JOF_NAME|JOF_PROPSET|JOF_DETECTING) \ /* * Assign to an intrinsic. * @@ -2994,7 +2989,7 @@ * Operands: uint32_t nameIndex * Stack: val => val */ \ - MACRO(JSOP_SETINTRINSIC, SetIntrinsic, set_intrinsic, "setintrinsic", NULL, 5, 1, 1, JOF_ATOM|JOF_NAME|JOF_DETECTING) \ + MACRO(JSOP_SETINTRINSIC, "setintrinsic", NULL, 5, 1, 1, JOF_ATOM|JOF_NAME|JOF_DETECTING) \ /* * Push a lexical environment onto the environment chain. * @@ -3037,7 +3032,7 @@ * Operands: uint32_t lexicalScopeIndex * Stack: => */ \ - MACRO(JSOP_PUSHLEXICALENV, PushLexicalEnv, push_lexical_env, "pushlexicalenv", NULL, 5, 0, 0, JOF_SCOPE) \ + MACRO(JSOP_PUSHLEXICALENV, "pushlexicalenv", NULL, 5, 0, 0, JOF_SCOPE) \ /* * Pop a lexical environment from the environment chain. * @@ -3048,7 +3043,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_POPLEXICALENV, PopLexicalEnv, pop_lexical_env, "poplexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_POPLEXICALENV, "poplexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ /* * No-op instruction that indicates leaving an optimized lexical scope. * @@ -3067,7 +3062,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_DEBUGLEAVELEXICALENV, DebugLeaveLexicalEnv, debug_leave_lexical_env, "debugleavelexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_DEBUGLEAVELEXICALENV, "debugleavelexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ /* * Recreate the current block on the environment chain with a fresh block * with uninitialized bindings. This implements the behavior of inducing a @@ -3079,7 +3074,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_RECREATELEXICALENV, RecreateLexicalEnv, recreate_lexical_env, "recreatelexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_RECREATELEXICALENV, "recreatelexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ /* * Replace the current block on the environment chain with a fresh block * that copies all the bindings in the block. This implements the behavior @@ -3092,7 +3087,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_FRESHENLEXICALENV, FreshenLexicalEnv, freshen_lexical_env, "freshenlexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_FRESHENLEXICALENV, "freshenlexicalenv", NULL, 1, 0, 0, JOF_BYTE) \ /* * Push a var environment onto the environment chain. * @@ -3129,7 +3124,7 @@ * Operands: uint32_t scopeIndex * Stack: => */ \ - MACRO(JSOP_PUSHVARENV, PushVarEnv, push_var_env, "pushvarenv", NULL, 5, 0, 0, JOF_SCOPE) \ + MACRO(JSOP_PUSHVARENV, "pushvarenv", NULL, 5, 0, 0, JOF_SCOPE) \ /* * Pop a `VarEnvironmentObject` from the environment chain. * @@ -3140,7 +3135,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_POPVARENV, PopVarEnv, pop_var_env, "popvarenv", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_POPVARENV, "popvarenv", NULL, 1, 0, 0, JOF_BYTE) \ /* * Push a `WithEnvironmentObject` wrapping ToObject(`val`) to the * environment chain. @@ -3163,7 +3158,7 @@ * Operands: uint32_t staticWithIndex * Stack: val => */ \ - MACRO(JSOP_ENTERWITH, EnterWith, enter_with, "enterwith", NULL, 5, 1, 0, JOF_SCOPE) \ + MACRO(JSOP_ENTERWITH, "enterwith", NULL, 5, 1, 0, JOF_SCOPE) \ /* * Pop a `WithEnvironmentObject` from the environment chain. * @@ -3178,7 +3173,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_LEAVEWITH, LeaveWith, leave_with, "leavewith", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_LEAVEWITH, "leavewith", NULL, 1, 0, 0, JOF_BYTE) \ /* * Push the current VariableEnvironment (the environment on the environment * chain designated to receive new variables). @@ -3195,7 +3190,7 @@ * Operands: * Stack: => env */ \ - MACRO(JSOP_BINDVAR, BindVar, bind_var, "bindvar", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_BINDVAR, "bindvar", NULL, 1, 0, 1, JOF_BYTE) \ /* * Create a new binding on the current VariableEnvironment (the environment * on the environment chain designated to receive new variables). @@ -3219,7 +3214,7 @@ * Operands: uint32_t nameIndex * Stack: => */ \ - MACRO(JSOP_DEFVAR, DefVar, def_var, "defvar", NULL, 5, 0, 0, JOF_ATOM) \ + MACRO(JSOP_DEFVAR, "defvar", NULL, 5, 0, 0, JOF_ATOM) \ /* * Create a new binding for the given function on the current scope. * @@ -3239,7 +3234,7 @@ * Operands: * Stack: fun => */ \ - MACRO(JSOP_DEFFUN, DefFun, def_fun, "deffun", NULL, 1, 1, 0, JOF_BYTE) \ + MACRO(JSOP_DEFFUN, "deffun", NULL, 1, 1, 0, JOF_BYTE) \ /* * Create a new mutable binding in the global lexical environment. Throw a * SyntaxError if a binding with the same name already exists on that @@ -3251,7 +3246,7 @@ * Operands: uint32_t nameIndex * Stack: => */ \ - MACRO(JSOP_DEFLET, DefLet, def_let, "deflet", NULL, 5, 0, 0, JOF_ATOM) \ + MACRO(JSOP_DEFLET, "deflet", NULL, 5, 0, 0, JOF_ATOM) \ /* * Create a new constant binding in the global lexical environment. * @@ -3264,7 +3259,7 @@ * Operands: uint32_t nameIndex * Stack: => */ \ - MACRO(JSOP_DEFCONST, DefConst, def_const, "defconst", NULL, 5, 0, 0, JOF_ATOM) \ + MACRO(JSOP_DEFCONST, "defconst", NULL, 5, 0, 0, JOF_ATOM) \ /* * Look up a variable on the environment chain and delete it. Push `true` * on success (if a binding was deleted, or if no such binding existed in @@ -3282,7 +3277,7 @@ * Operands: uint32_t nameIndex * Stack: => succeeded */ \ - MACRO(JSOP_DELNAME, DelName, del_name, "delname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_CHECKSLOPPY) \ + MACRO(JSOP_DELNAME, "delname", NULL, 5, 0, 1, JOF_ATOM|JOF_NAME|JOF_CHECKSLOPPY) \ /* * Create and push the `arguments` object for the current function activation. * @@ -3327,7 +3322,7 @@ * Operands: * Stack: => arguments */ \ - MACRO(JSOP_ARGUMENTS, Arguments, arguments, "arguments", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_ARGUMENTS, "arguments", NULL, 1, 0, 1, JOF_BYTE) \ /* * Create and push the rest parameter array for current function call. * @@ -3338,7 +3333,7 @@ * Operands: * Stack: => rest */ \ - MACRO(JSOP_REST, Rest, rest, "rest", NULL, 1, 0, 1, JOF_BYTE|JOF_TYPESET|JOF_IC) \ + MACRO(JSOP_REST, "rest", NULL, 1, 0, 1, JOF_BYTE|JOF_TYPESET|JOF_IC) \ /* * Determines the `this` value for current function frame and pushes it * onto the stack. @@ -3357,7 +3352,7 @@ * Operands: * Stack: => this */ \ - MACRO(JSOP_FUNCTIONTHIS, FunctionThis, function_this, "functionthis", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_FUNCTIONTHIS, "functionthis", NULL, 1, 0, 1, JOF_BYTE) \ /* * Pop the top value from the stack and discard it. * @@ -3365,7 +3360,7 @@ * Operands: * Stack: v => */ \ - MACRO(JSOP_POP, Pop, pop, "pop", NULL, 1, 1, 0, JOF_BYTE) \ + MACRO(JSOP_POP, "pop", NULL, 1, 1, 0, JOF_BYTE) \ /* * Pop the top `n` values from the stack. `n` must be <= the current stack * depth. @@ -3374,7 +3369,7 @@ * Operands: uint16_t n * Stack: v[n-1], ..., v[1], v[0] => */ \ - MACRO(JSOP_POPN, PopN, pop_n, "popn", NULL, 3, -1, 0, JOF_UINT16) \ + MACRO(JSOP_POPN, "popn", NULL, 3, -1, 0, JOF_UINT16) \ /* * Push a copy of the top value on the stack. * @@ -3382,7 +3377,7 @@ * Operands: * Stack: v => v, v */ \ - MACRO(JSOP_DUP, Dup, dup, "dup", NULL, 1, 1, 2, JOF_BYTE) \ + MACRO(JSOP_DUP, "dup", NULL, 1, 1, 2, JOF_BYTE) \ /* * Duplicate the top two values on the stack. * @@ -3390,7 +3385,7 @@ * Operands: * Stack: v1, v2 => v1, v2, v1, v2 */ \ - MACRO(JSOP_DUP2, Dup2, dup2, "dup2", NULL, 1, 2, 4, JOF_BYTE) \ + MACRO(JSOP_DUP2, "dup2", NULL, 1, 2, 4, JOF_BYTE) \ /* * Push a copy of the nth value from the top of the stack. * @@ -3401,7 +3396,7 @@ * Stack: v[n], v[n-1], ..., v[1], v[0] => * v[n], v[n-1], ..., v[1], v[0], v[n] */ \ - MACRO(JSOP_DUPAT, DupAt, dup_at, "dupat", NULL, 4, 0, 1, JOF_UINT24) \ + MACRO(JSOP_DUPAT, "dupat", NULL, 4, 0, 1, JOF_UINT24) \ /* * Swap the top two values on the stack. * @@ -3409,7 +3404,7 @@ * Operands: * Stack: v1, v2 => v2, v1 */ \ - MACRO(JSOP_SWAP, Swap, swap, "swap", NULL, 1, 2, 2, JOF_BYTE) \ + MACRO(JSOP_SWAP, "swap", NULL, 1, 2, 2, JOF_BYTE) \ /* * Pick the nth element from the stack and move it to the top of the stack. * @@ -3417,7 +3412,7 @@ * Operands: uint8_t n * Stack: v[n], v[n-1], ..., v[1], v[0] => v[n-1], ..., v[1], v[0], v[n] */ \ - MACRO(JSOP_PICK, Pick, pick, "pick", NULL, 2, 0, 0, JOF_UINT8) \ + MACRO(JSOP_PICK, "pick", NULL, 2, 0, 0, JOF_UINT8) \ /* * Move the top of the stack value under the `n`th element of the stack. * `n` must not be 0. @@ -3426,7 +3421,7 @@ * Operands: uint8_t n * Stack: v[n], v[n-1], ..., v[1], v[0] => v[0], v[n], v[n-1], ..., v[1] */ \ - MACRO(JSOP_UNPICK, Unpick, unpick, "unpick", NULL, 2, 0, 0, JOF_UINT8) \ + MACRO(JSOP_UNPICK, "unpick", NULL, 2, 0, 0, JOF_UINT8) \ /* * Do nothing. This is used when we need distinct bytecode locations for * various mechanisms. @@ -3435,7 +3430,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_NOP, Nop, nop, "nop", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_NOP, "nop", NULL, 1, 0, 0, JOF_BYTE) \ /* * No-op instruction used to speed up pc-to-line mapping. * @@ -3443,7 +3438,7 @@ * Operands: uint32_t lineno * Stack: => */ \ - MACRO(JSOP_LINENO, Lineno, lineno, "lineno", NULL, 5, 0, 0, JOF_UINT32) \ + MACRO(JSOP_LINENO, "lineno", NULL, 5, 0, 0, JOF_UINT32) \ /* * No-op instruction used by the decompiler to produce nicer error messages * about destructuring code. @@ -3452,7 +3447,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_NOP_DESTRUCTURING, NopDestructuring, nop_destructuring, "nop-destructuring", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_NOP_DESTRUCTURING, "nop-destructuring", NULL, 1, 0, 0, JOF_BYTE) \ /* * No-op instruction only emitted in some self-hosted functions. Not * handled by the JITs or Baseline Interpreter so the script always runs in @@ -3462,7 +3457,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_FORCEINTERPRETER, ForceInterpreter, force_interpreter, "forceinterpreter", NULL, 1, 0, 0, JOF_BYTE) \ + MACRO(JSOP_FORCEINTERPRETER, "forceinterpreter", NULL, 1, 0, 0, JOF_BYTE) \ /* * Examine the top stack value, asserting that it's either a self-hosted * function or a self-hosted intrinsic. This does nothing in a non-debug @@ -3472,7 +3467,7 @@ * Operands: * Stack: checkVal => checkVal */ \ - MACRO(JSOP_DEBUGCHECKSELFHOSTED, DebugCheckSelfHosted, debug_check_self_hosted, "debug-checkselfhosted", NULL, 1, 1, 1, JOF_BYTE) \ + MACRO(JSOP_DEBUGCHECKSELFHOSTED, "debug-checkselfhosted", NULL, 1, 1, 1, JOF_BYTE) \ /* * Push a boolean indicating if instrumentation is active. * @@ -3480,7 +3475,7 @@ * Operands: * Stack: => val */ \ - MACRO(JSOP_INSTRUMENTATION_ACTIVE, InstrumentationActive, instrumentation_active, "instrumentationActive", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_INSTRUMENTATION_ACTIVE, "instrumentationActive", NULL, 1, 0, 1, JOF_BYTE) \ /* * Push the instrumentation callback for the current realm. * @@ -3488,7 +3483,7 @@ * Operands: * Stack: => val */ \ - MACRO(JSOP_INSTRUMENTATION_CALLBACK, InstrumentationCallback, instrumentation_callback, "instrumentationCallback", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_INSTRUMENTATION_CALLBACK, "instrumentationCallback", NULL, 1, 0, 1, JOF_BYTE) \ /* * Push the current script's instrumentation ID. * @@ -3496,7 +3491,7 @@ * Operands: * Stack: => val */ \ - MACRO(JSOP_INSTRUMENTATION_SCRIPT_ID, InstrumentationScriptId, instrumentation_script_id, "instrumentationScriptId", NULL, 1, 0, 1, JOF_BYTE) \ + MACRO(JSOP_INSTRUMENTATION_SCRIPT_ID, "instrumentationScriptId", NULL, 1, 0, 1, JOF_BYTE) \ /* * Break in the debugger, if one is attached. Otherwise this is a no-op. * @@ -3511,7 +3506,7 @@ * Operands: * Stack: => */ \ - MACRO(JSOP_DEBUGGER, Debugger, debugger, "debugger", NULL, 1, 0, 0, JOF_BYTE) + MACRO(JSOP_DEBUGGER, "debugger", NULL, 1, 0, 0, JOF_BYTE) // clang-format on @@ -3546,21 +3541,19 @@ namespace js { // clang-format off #define PLUS_ONE(...) \ + 1 -constexpr int JSOP_LIMIT = 0 FOR_EACH_OPCODE(PLUS_ONE); -#undef PLUS_ONE - #define TRAILING_VALUE_AND_VALUE_PLUS_ONE(val) \ val) && (val + 1 == -static_assert((JSOP_LIMIT == +static_assert((0 FOR_EACH_OPCODE(PLUS_ONE) == FOR_EACH_TRAILING_UNUSED_OPCODE(TRAILING_VALUE_AND_VALUE_PLUS_ONE) 256), "trailing unused opcode values monotonically increase " "from JSOP_LIMIT to 255"); #undef TRAILING_VALUE_AND_VALUE_PLUS_ONE +#undef PLUS_ONE // clang-format on // Define JSOP_*_LENGTH constants for all ops. -#define DEFINE_LENGTH_CONSTANT(op, op_camel, op_snake, name, image, len, ...) \ +#define DEFINE_LENGTH_CONSTANT(op, name, image, len, ...) \ constexpr size_t op##_LENGTH = len; FOR_EACH_OPCODE(DEFINE_LENGTH_CONSTANT) #undef DEFINE_LENGTH_CONSTANT diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp index 7d8bcaa310ca..29efc85684a0 100644 --- a/js/src/vm/TypeInference.cpp +++ b/js/src/vm/TypeInference.cpp @@ -3419,9 +3419,9 @@ void JitScript::MonitorMagicValueBytecodeType(JSContext* cx, JSScript* script, // GETALIASEDVAR can return the magic TDZ value. MOZ_ASSERT(rval.whyMagic() == JS_UNINITIALIZED_LEXICAL); MOZ_ASSERT(script->function() || script->isForEval()); - MOZ_ASSERT(JSOp(*GetNextPc(pc)) == JSOP_CHECKTHIS || - JSOp(*GetNextPc(pc)) == JSOP_CHECKTHISREINIT || - JSOp(*GetNextPc(pc)) == JSOP_CHECKRETURN); + MOZ_ASSERT(*GetNextPc(pc) == JSOP_CHECKTHIS || + *GetNextPc(pc) == JSOP_CHECKTHISREINIT || + *GetNextPc(pc) == JSOP_CHECKRETURN); MonitorBytecodeType(cx, script, pc, TypeSet::UnknownType()); } diff --git a/js/src/vm/jsopcode.py b/js/src/vm/jsopcode.py index 98846be31792..df1485547214 100644 --- a/js/src/vm/jsopcode.py +++ b/js/src/vm/jsopcode.py @@ -96,16 +96,13 @@ class CommentInfo: self.stack_defs = '' # Holds the information stored in the macro with the following format: -# MACRO({name}, {op_camel}, {op_snake}, {display_name}, {image}, {length}, {nuses}, {ndefs}, -# {flags}) +# MACRO({name}, {display_name}, {image}, {length}, {nuses}, {ndefs}, {flags}) # and the information from CommentInfo. class OpcodeInfo: def __init__(self, value, comment_info): self.name = '' - self.op_camel = '' - self.op_snake = '' self.value = value self.display_name = '' self.image = '' @@ -172,20 +169,11 @@ def get_tag_value(line): return re.sub(tag_pat, '', line) -# Identifiers to avoid because they're reserved words in either Rust or C++. -RUST_OR_CPP_KEYWORDS = { - 'and', 'case', 'default', 'double', 'false', 'goto', 'in', 'new', 'not', 'or', 'return', - 'throw', 'true', 'try', 'typeof', 'void', -} - - def get_opcodes(dir): iter_pat = re.compile(r"/\*(.*?)\*/" # either a documentation comment... r"|" r"MACRO\(" # or a MACRO(...) call r"(?P[^,]+),\s*" - r"(?P[^,]+),\s*" - r"(?P[^,]+),\s*" r"(?P[^,]+,)\s*" r"(?P[^,]+),\s*" r"(?P[0-9\-]+),\s*" @@ -272,8 +260,6 @@ def get_opcodes(dir): next_opcode_value += 1 opcode.name = name - opcode.op_camel = m.group('op_camel') - opcode.op_snake = m.group('op_snake') opcode.display_name = parse_name(m.group('display_name')) opcode.image = parse_name(m.group('image')) opcode.length = m.group('length') @@ -281,14 +267,6 @@ def get_opcodes(dir): opcode.ndefs = m.group('ndefs') opcode.flags = m.group('flags').split('|') - expected_snake = re.sub(r'(?