зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1608509 - Part 7: Automatically replace JSOP_UPPER with JSOp::CamelCase. r=jandem.
Differential Revision: https://phabricator.services.mozilla.com/D59808 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ca8d817442
Коммит
5097f5bced
|
@ -1966,24 +1966,24 @@ static ComparatorMatchResult MatchNumericComparator(JSContext* cx,
|
|||
jsbytecode* pc = script->code();
|
||||
|
||||
uint16_t arg0, arg1;
|
||||
if (JSOp(*pc) != JSOP_GETARG) {
|
||||
if (JSOp(*pc) != JSOp::GetArg) {
|
||||
return Match_None;
|
||||
}
|
||||
arg0 = GET_ARGNO(pc);
|
||||
pc += JSOpLength_GetArg;
|
||||
|
||||
if (JSOp(*pc) != JSOP_GETARG) {
|
||||
if (JSOp(*pc) != JSOp::GetArg) {
|
||||
return Match_None;
|
||||
}
|
||||
arg1 = GET_ARGNO(pc);
|
||||
pc += JSOpLength_GetArg;
|
||||
|
||||
if (JSOp(*pc) != JSOP_SUB) {
|
||||
if (JSOp(*pc) != JSOp::Sub) {
|
||||
return Match_None;
|
||||
}
|
||||
pc += JSOpLength_Sub;
|
||||
|
||||
if (JSOp(*pc) != JSOP_RETURN) {
|
||||
if (JSOp(*pc) != JSOp::Return) {
|
||||
return Match_None;
|
||||
}
|
||||
|
||||
|
|
|
@ -457,10 +457,10 @@ bool js::DirectEval(JSContext* cx, HandleValue v, MutableHandleValue vp) {
|
|||
ScriptFrameIter iter(cx);
|
||||
AbstractFramePtr caller = iter.abstractFramePtr();
|
||||
|
||||
MOZ_ASSERT(JSOp(*iter.pc()) == JSOP_EVAL ||
|
||||
JSOp(*iter.pc()) == JSOP_STRICTEVAL ||
|
||||
JSOp(*iter.pc()) == JSOP_SPREADEVAL ||
|
||||
JSOp(*iter.pc()) == JSOP_STRICTSPREADEVAL);
|
||||
MOZ_ASSERT(JSOp(*iter.pc()) == JSOp::Eval ||
|
||||
JSOp(*iter.pc()) == JSOp::StrictEval ||
|
||||
JSOp(*iter.pc()) == JSOp::SpreadEval ||
|
||||
JSOp(*iter.pc()) == JSOp::StrictSpreadEval);
|
||||
MOZ_ASSERT(caller.realm() == caller.script()->realm());
|
||||
|
||||
RootedObject envChain(cx, caller.environmentChain());
|
||||
|
|
|
@ -1775,7 +1775,7 @@ bool js::intrinsic_GetElemBaseForLambda(JSContext* cx, unsigned argc,
|
|||
* Rule out the (unlikely) possibility of a function with environment
|
||||
* objects since it would make our environment walk off.
|
||||
*/
|
||||
if (JSOp(*pc) != JSOP_GETALIASEDVAR || fun->needsSomeEnvironmentObject()) {
|
||||
if (JSOp(*pc) != JSOp::GetAliasedVar || fun->needsSomeEnvironmentObject()) {
|
||||
return true;
|
||||
}
|
||||
EnvironmentCoordinate ec(pc);
|
||||
|
@ -1787,19 +1787,19 @@ bool js::intrinsic_GetElemBaseForLambda(JSContext* cx, unsigned argc,
|
|||
pc += JSOpLength_GetAliasedVar;
|
||||
|
||||
/* Look for 'a' to be the lambda's first argument. */
|
||||
if (JSOp(*pc) != JSOP_GETARG || GET_ARGNO(pc) != 0) {
|
||||
if (JSOp(*pc) != JSOp::GetArg || GET_ARGNO(pc) != 0) {
|
||||
return true;
|
||||
}
|
||||
pc += JSOpLength_GetArg;
|
||||
|
||||
/* 'b[a]' */
|
||||
if (JSOp(*pc) != JSOP_GETELEM) {
|
||||
if (JSOp(*pc) != JSOp::GetElem) {
|
||||
return true;
|
||||
}
|
||||
pc += JSOpLength_GetElem;
|
||||
|
||||
/* 'return b[a]' */
|
||||
if (JSOp(*pc) != JSOP_RETURN) {
|
||||
if (JSOp(*pc) != JSOp::Return) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1806,15 +1806,15 @@ Completion Completion::fromJSFramePop(JSContext* cx, AbstractFramePtr frame,
|
|||
Rooted<AbstractGeneratorObject*> generatorObj(
|
||||
cx, GetGeneratorObjectForFrame(cx, frame));
|
||||
switch (JSOp(*pc)) {
|
||||
case JSOP_INITIALYIELD:
|
||||
case JSOp::InitialYield:
|
||||
MOZ_ASSERT(!generatorObj->isClosed());
|
||||
return Completion(InitialYield(generatorObj));
|
||||
|
||||
case JSOP_YIELD:
|
||||
case JSOp::Yield:
|
||||
MOZ_ASSERT(!generatorObj->isClosed());
|
||||
return Completion(Yield(generatorObj, frame.returnValue()));
|
||||
|
||||
case JSOP_AWAIT:
|
||||
case JSOp::Await:
|
||||
MOZ_ASSERT(!generatorObj->isClosed());
|
||||
return Completion(Await(generatorObj, frame.returnValue()));
|
||||
|
||||
|
@ -2119,7 +2119,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() && JSOp(*iter.pc()) == JSOp::AfterYield) {
|
||||
auto* genObj = GetGeneratorObjectForFrame(cx, iter.abstractFramePtr());
|
||||
MOZ_ASSERT(genObj->isRunning());
|
||||
}
|
||||
|
|
|
@ -1146,7 +1146,7 @@ class FlowGraphSummary {
|
|||
|
||||
size_t prevLineno = script->lineno();
|
||||
size_t prevColumn = 0;
|
||||
JSOp prevOp = JSOP_NOP;
|
||||
JSOp prevOp = JSOp::Nop;
|
||||
for (BytecodeRangeWithPosition r(cx, script); !r.empty(); r.popFront()) {
|
||||
size_t lineno = prevLineno;
|
||||
size_t column = prevColumn;
|
||||
|
@ -1173,7 +1173,7 @@ class FlowGraphSummary {
|
|||
|
||||
if (IsJumpOpcode(op)) {
|
||||
addEdge(lineno, column, r.frontOffset() + GET_JUMP_OFFSET(r.frontPC()));
|
||||
} else if (op == JSOP_TABLESWITCH) {
|
||||
} else if (op == JSOp::TableSwitch) {
|
||||
jsbytecode* const switchPC = r.frontPC();
|
||||
jsbytecode* pc = switchPC;
|
||||
size_t offset = r.frontOffset();
|
||||
|
@ -1191,7 +1191,7 @@ class FlowGraphSummary {
|
|||
size_t target = script->tableSwitchCaseOffset(switchPC, i);
|
||||
addEdge(lineno, column, target);
|
||||
}
|
||||
} else if (op == JSOP_TRY) {
|
||||
} else if (op == JSOp::Try) {
|
||||
// As there is no literal incoming edge into the catch block, we
|
||||
// make a fake one by copying the JSOp::Try location, as-if this
|
||||
// was an incoming edge of the catch block. This is needed
|
||||
|
@ -1466,250 +1466,250 @@ bool DebuggerScript::CallData::getSuccessorOrPredecessorOffsets() {
|
|||
// natives which could have side effects.
|
||||
static bool BytecodeIsEffectful(JSOp op) {
|
||||
switch (op) {
|
||||
case JSOP_SETPROP:
|
||||
case JSOP_STRICTSETPROP:
|
||||
case JSOP_SETPROP_SUPER:
|
||||
case JSOP_STRICTSETPROP_SUPER:
|
||||
case JSOP_SETELEM:
|
||||
case JSOP_STRICTSETELEM:
|
||||
case JSOP_SETELEM_SUPER:
|
||||
case JSOP_STRICTSETELEM_SUPER:
|
||||
case JSOP_SETNAME:
|
||||
case JSOP_STRICTSETNAME:
|
||||
case JSOP_SETGNAME:
|
||||
case JSOP_STRICTSETGNAME:
|
||||
case JSOP_DELPROP:
|
||||
case JSOP_STRICTDELPROP:
|
||||
case JSOP_DELELEM:
|
||||
case JSOP_STRICTDELELEM:
|
||||
case JSOP_DELNAME:
|
||||
case JSOP_SETALIASEDVAR:
|
||||
case JSOP_INITHOMEOBJECT:
|
||||
case JSOP_INITALIASEDLEXICAL:
|
||||
case JSOP_SETINTRINSIC:
|
||||
case JSOP_INITGLEXICAL:
|
||||
case JSOP_DEFVAR:
|
||||
case JSOP_DEFLET:
|
||||
case JSOP_DEFCONST:
|
||||
case JSOP_DEFFUN:
|
||||
case JSOP_SETFUNNAME:
|
||||
case JSOP_MUTATEPROTO:
|
||||
case JSOP_DYNAMIC_IMPORT:
|
||||
case JSOp::SetProp:
|
||||
case JSOp::StrictSetProp:
|
||||
case JSOp::SetPropSuper:
|
||||
case JSOp::StrictSetPropSuper:
|
||||
case JSOp::SetElem:
|
||||
case JSOp::StrictSetElem:
|
||||
case JSOp::SetElemSuper:
|
||||
case JSOp::StrictSetElemSuper:
|
||||
case JSOp::SetName:
|
||||
case JSOp::StrictSetName:
|
||||
case JSOp::SetGName:
|
||||
case JSOp::StrictSetGName:
|
||||
case JSOp::DelProp:
|
||||
case JSOp::StrictDelProp:
|
||||
case JSOp::DelElem:
|
||||
case JSOp::StrictDelElem:
|
||||
case JSOp::DelName:
|
||||
case JSOp::SetAliasedVar:
|
||||
case JSOp::InitHomeObject:
|
||||
case JSOp::InitAliasedLexical:
|
||||
case JSOp::SetIntrinsic:
|
||||
case JSOp::InitGLexical:
|
||||
case JSOp::DefVar:
|
||||
case JSOp::DefLet:
|
||||
case JSOp::DefConst:
|
||||
case JSOp::DefFun:
|
||||
case JSOp::SetFunName:
|
||||
case JSOp::MutateProto:
|
||||
case JSOp::DynamicImport:
|
||||
// Treat async functions as effectful so that microtask checkpoints
|
||||
// won't run.
|
||||
case JSOP_INITIALYIELD:
|
||||
case JSOP_YIELD:
|
||||
case JSOp::InitialYield:
|
||||
case JSOp::Yield:
|
||||
return true;
|
||||
|
||||
case JSOP_NOP:
|
||||
case JSOP_NOP_DESTRUCTURING:
|
||||
case JSOP_TRY_DESTRUCTURING:
|
||||
case JSOP_LINENO:
|
||||
case JSOP_JUMPTARGET:
|
||||
case JSOP_UNDEFINED:
|
||||
case JSOP_IFNE:
|
||||
case JSOP_IFEQ:
|
||||
case JSOP_RETURN:
|
||||
case JSOP_RETRVAL:
|
||||
case JSOP_AND:
|
||||
case JSOP_OR:
|
||||
case JSOP_COALESCE:
|
||||
case JSOP_TRY:
|
||||
case JSOP_THROW:
|
||||
case JSOP_GOTO:
|
||||
case JSOP_TABLESWITCH:
|
||||
case JSOP_CASE:
|
||||
case JSOP_DEFAULT:
|
||||
case JSOP_BITNOT:
|
||||
case JSOP_BITAND:
|
||||
case JSOP_BITOR:
|
||||
case JSOP_BITXOR:
|
||||
case JSOP_LSH:
|
||||
case JSOP_RSH:
|
||||
case JSOP_URSH:
|
||||
case JSOP_ADD:
|
||||
case JSOP_SUB:
|
||||
case JSOP_MUL:
|
||||
case JSOP_DIV:
|
||||
case JSOP_MOD:
|
||||
case JSOP_POW:
|
||||
case JSOP_POS:
|
||||
case JSOP_TONUMERIC:
|
||||
case JSOP_NEG:
|
||||
case JSOP_INC:
|
||||
case JSOP_DEC:
|
||||
case JSOP_TOSTRING:
|
||||
case JSOP_EQ:
|
||||
case JSOP_NE:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOP_STRICTNE:
|
||||
case JSOP_LT:
|
||||
case JSOP_LE:
|
||||
case JSOP_GT:
|
||||
case JSOP_GE:
|
||||
case JSOP_DOUBLE:
|
||||
case JSOP_BIGINT:
|
||||
case JSOP_STRING:
|
||||
case JSOP_SYMBOL:
|
||||
case JSOP_ZERO:
|
||||
case JSOP_ONE:
|
||||
case JSOP_NULL:
|
||||
case JSOP_VOID:
|
||||
case JSOP_HOLE:
|
||||
case JSOP_FALSE:
|
||||
case JSOP_TRUE:
|
||||
case JSOP_ARGUMENTS:
|
||||
case JSOP_REST:
|
||||
case JSOP_GETARG:
|
||||
case JSOP_SETARG:
|
||||
case JSOP_GETLOCAL:
|
||||
case JSOP_SETLOCAL:
|
||||
case JSOP_THROWSETCONST:
|
||||
case JSOP_THROWSETALIASEDCONST:
|
||||
case JSOP_THROWSETCALLEE:
|
||||
case JSOP_CHECKLEXICAL:
|
||||
case JSOP_INITLEXICAL:
|
||||
case JSOP_CHECKALIASEDLEXICAL:
|
||||
case JSOP_UNINITIALIZED:
|
||||
case JSOP_POP:
|
||||
case JSOP_POPN:
|
||||
case JSOP_DUPAT:
|
||||
case JSOP_NEWARRAY:
|
||||
case JSOP_NEWARRAY_COPYONWRITE:
|
||||
case JSOP_NEWINIT:
|
||||
case JSOP_NEWOBJECT:
|
||||
case JSOP_NEWOBJECT_WITHGROUP:
|
||||
case JSOP_INITELEM:
|
||||
case JSOP_INITHIDDENELEM:
|
||||
case JSOP_INITELEM_INC:
|
||||
case JSOP_INITELEM_ARRAY:
|
||||
case JSOP_INITPROP:
|
||||
case JSOP_INITLOCKEDPROP:
|
||||
case JSOP_INITHIDDENPROP:
|
||||
case JSOP_INITPROP_GETTER:
|
||||
case JSOP_INITHIDDENPROP_GETTER:
|
||||
case JSOP_INITPROP_SETTER:
|
||||
case JSOP_INITHIDDENPROP_SETTER:
|
||||
case JSOP_INITELEM_GETTER:
|
||||
case JSOP_INITHIDDENELEM_GETTER:
|
||||
case JSOP_INITELEM_SETTER:
|
||||
case JSOP_INITHIDDENELEM_SETTER:
|
||||
case JSOP_FUNCALL:
|
||||
case JSOP_FUNAPPLY:
|
||||
case JSOP_SPREADCALL:
|
||||
case JSOP_CALL:
|
||||
case JSOP_CALL_IGNORES_RV:
|
||||
case JSOP_CALLITER:
|
||||
case JSOP_NEW:
|
||||
case JSOP_EVAL:
|
||||
case JSOP_STRICTEVAL:
|
||||
case JSOP_INT8:
|
||||
case JSOP_UINT16:
|
||||
case JSOP_RESUMEKIND:
|
||||
case JSOP_GETGNAME:
|
||||
case JSOP_GETNAME:
|
||||
case JSOP_GETINTRINSIC:
|
||||
case JSOP_GETIMPORT:
|
||||
case JSOP_BINDGNAME:
|
||||
case JSOP_BINDNAME:
|
||||
case JSOP_BINDVAR:
|
||||
case JSOP_DUP:
|
||||
case JSOP_DUP2:
|
||||
case JSOP_SWAP:
|
||||
case JSOP_PICK:
|
||||
case JSOP_UNPICK:
|
||||
case JSOP_GETALIASEDVAR:
|
||||
case JSOP_UINT24:
|
||||
case JSOP_RESUMEINDEX:
|
||||
case JSOP_INT32:
|
||||
case JSOP_LOOPHEAD:
|
||||
case JSOP_GETELEM:
|
||||
case JSOP_CALLELEM:
|
||||
case JSOP_LENGTH:
|
||||
case JSOP_NOT:
|
||||
case JSOP_FUNCTIONTHIS:
|
||||
case JSOP_GLOBALTHIS:
|
||||
case JSOP_CALLEE:
|
||||
case JSOP_ENVCALLEE:
|
||||
case JSOP_SUPERBASE:
|
||||
case JSOP_GETPROP_SUPER:
|
||||
case JSOP_GETELEM_SUPER:
|
||||
case JSOP_GETPROP:
|
||||
case JSOP_CALLPROP:
|
||||
case JSOP_REGEXP:
|
||||
case JSOP_CALLSITEOBJ:
|
||||
case JSOP_OBJECT:
|
||||
case JSOP_CLASSCONSTRUCTOR:
|
||||
case JSOP_TYPEOF:
|
||||
case JSOP_TYPEOFEXPR:
|
||||
case JSOP_TOASYNCITER:
|
||||
case JSOP_TOID:
|
||||
case JSOP_ITERNEXT:
|
||||
case JSOP_LAMBDA:
|
||||
case JSOP_LAMBDA_ARROW:
|
||||
case JSOP_PUSHLEXICALENV:
|
||||
case JSOP_POPLEXICALENV:
|
||||
case JSOP_FRESHENLEXICALENV:
|
||||
case JSOP_RECREATELEXICALENV:
|
||||
case JSOP_ITER:
|
||||
case JSOP_MOREITER:
|
||||
case JSOP_ISNOITER:
|
||||
case JSOP_ENDITER:
|
||||
case JSOP_IN:
|
||||
case JSOP_HASOWN:
|
||||
case JSOP_SETRVAL:
|
||||
case JSOP_INSTANCEOF:
|
||||
case JSOP_DEBUGLEAVELEXICALENV:
|
||||
case JSOP_DEBUGGER:
|
||||
case JSOP_GIMPLICITTHIS:
|
||||
case JSOP_IMPLICITTHIS:
|
||||
case JSOP_NEWTARGET:
|
||||
case JSOP_CHECKISOBJ:
|
||||
case JSOP_CHECKISCALLABLE:
|
||||
case JSOP_CHECKOBJCOERCIBLE:
|
||||
case JSOP_DEBUGCHECKSELFHOSTED:
|
||||
case JSOP_IS_CONSTRUCTING:
|
||||
case JSOP_OPTIMIZE_SPREADCALL:
|
||||
case JSOP_IMPORTMETA:
|
||||
case JSOP_INSTRUMENTATION_ACTIVE:
|
||||
case JSOP_INSTRUMENTATION_CALLBACK:
|
||||
case JSOP_INSTRUMENTATION_SCRIPT_ID:
|
||||
case JSOP_ENTERWITH:
|
||||
case JSOP_LEAVEWITH:
|
||||
case JSOP_SPREADNEW:
|
||||
case JSOP_SPREADEVAL:
|
||||
case JSOP_STRICTSPREADEVAL:
|
||||
case JSOP_CHECKCLASSHERITAGE:
|
||||
case JSOP_FUNWITHPROTO:
|
||||
case JSOP_OBJWITHPROTO:
|
||||
case JSOP_BUILTINPROTO:
|
||||
case JSOP_DERIVEDCONSTRUCTOR:
|
||||
case JSOP_CHECKTHIS:
|
||||
case JSOP_CHECKRETURN:
|
||||
case JSOP_CHECKTHISREINIT:
|
||||
case JSOP_SUPERFUN:
|
||||
case JSOP_SPREADSUPERCALL:
|
||||
case JSOP_SUPERCALL:
|
||||
case JSOP_PUSHVARENV:
|
||||
case JSOP_POPVARENV:
|
||||
case JSOP_GETBOUNDNAME:
|
||||
case JSOP_EXCEPTION:
|
||||
case JSOP_ISGENCLOSING:
|
||||
case JSOP_FINALYIELDRVAL:
|
||||
case JSOP_RESUME:
|
||||
case JSOP_CHECK_RESUMEKIND:
|
||||
case JSOP_AFTERYIELD:
|
||||
case JSOP_AWAIT:
|
||||
case JSOP_TRYSKIPAWAIT:
|
||||
case JSOP_GENERATOR:
|
||||
case JSOP_ASYNCAWAIT:
|
||||
case JSOP_ASYNCRESOLVE:
|
||||
case JSOP_FINALLY:
|
||||
case JSOP_GETRVAL:
|
||||
case JSOP_GOSUB:
|
||||
case JSOP_RETSUB:
|
||||
case JSOP_THROWMSG:
|
||||
case JSOP_FORCEINTERPRETER:
|
||||
case JSOp::Nop:
|
||||
case JSOp::NopDestructuring:
|
||||
case JSOp::TryDestructuring:
|
||||
case JSOp::Lineno:
|
||||
case JSOp::JumpTarget:
|
||||
case JSOp::Undefined:
|
||||
case JSOp::IfNe:
|
||||
case JSOp::IfEq:
|
||||
case JSOp::Return:
|
||||
case JSOp::RetRval:
|
||||
case JSOp::And:
|
||||
case JSOp::Or:
|
||||
case JSOp::Coalesce:
|
||||
case JSOp::Try:
|
||||
case JSOp::Throw:
|
||||
case JSOp::Goto:
|
||||
case JSOp::TableSwitch:
|
||||
case JSOp::Case:
|
||||
case JSOp::Default:
|
||||
case JSOp::BitNot:
|
||||
case JSOp::BitAnd:
|
||||
case JSOp::BitOr:
|
||||
case JSOp::BitXor:
|
||||
case JSOp::Lsh:
|
||||
case JSOp::Rsh:
|
||||
case JSOp::Ursh:
|
||||
case JSOp::Add:
|
||||
case JSOp::Sub:
|
||||
case JSOp::Mul:
|
||||
case JSOp::Div:
|
||||
case JSOp::Mod:
|
||||
case JSOp::Pow:
|
||||
case JSOp::Pos:
|
||||
case JSOp::ToNumeric:
|
||||
case JSOp::Neg:
|
||||
case JSOp::Inc:
|
||||
case JSOp::Dec:
|
||||
case JSOp::ToString:
|
||||
case JSOp::Eq:
|
||||
case JSOp::Ne:
|
||||
case JSOp::StrictEq:
|
||||
case JSOp::StrictNe:
|
||||
case JSOp::Lt:
|
||||
case JSOp::Le:
|
||||
case JSOp::Gt:
|
||||
case JSOp::Ge:
|
||||
case JSOp::Double:
|
||||
case JSOp::BigInt:
|
||||
case JSOp::String:
|
||||
case JSOp::Symbol:
|
||||
case JSOp::Zero:
|
||||
case JSOp::One:
|
||||
case JSOp::Null:
|
||||
case JSOp::Void:
|
||||
case JSOp::Hole:
|
||||
case JSOp::False:
|
||||
case JSOp::True:
|
||||
case JSOp::Arguments:
|
||||
case JSOp::Rest:
|
||||
case JSOp::GetArg:
|
||||
case JSOp::SetArg:
|
||||
case JSOp::GetLocal:
|
||||
case JSOp::SetLocal:
|
||||
case JSOp::ThrowSetConst:
|
||||
case JSOp::ThrowSetAliasedConst:
|
||||
case JSOp::ThrowSetCallee:
|
||||
case JSOp::CheckLexical:
|
||||
case JSOp::InitLexical:
|
||||
case JSOp::CheckAliasedLexical:
|
||||
case JSOp::Uninitialized:
|
||||
case JSOp::Pop:
|
||||
case JSOp::PopN:
|
||||
case JSOp::DupAt:
|
||||
case JSOp::NewArray:
|
||||
case JSOp::NewArrayCopyOnWrite:
|
||||
case JSOp::NewInit:
|
||||
case JSOp::NewObject:
|
||||
case JSOp::NewObjectWithGroup:
|
||||
case JSOp::InitElem:
|
||||
case JSOp::InitHiddenElem:
|
||||
case JSOp::InitElemInc:
|
||||
case JSOp::InitElemArray:
|
||||
case JSOp::InitProp:
|
||||
case JSOp::InitLockedProp:
|
||||
case JSOp::InitHiddenProp:
|
||||
case JSOp::InitPropGetter:
|
||||
case JSOp::InitHiddenPropGetter:
|
||||
case JSOp::InitPropSetter:
|
||||
case JSOp::InitHiddenPropSetter:
|
||||
case JSOp::InitElemGetter:
|
||||
case JSOp::InitHiddenElemGetter:
|
||||
case JSOp::InitElemSetter:
|
||||
case JSOp::InitHiddenElemSetter:
|
||||
case JSOp::FunCall:
|
||||
case JSOp::FunApply:
|
||||
case JSOp::SpreadCall:
|
||||
case JSOp::Call:
|
||||
case JSOp::CallIgnoresRv:
|
||||
case JSOp::CallIter:
|
||||
case JSOp::New:
|
||||
case JSOp::Eval:
|
||||
case JSOp::StrictEval:
|
||||
case JSOp::Int8:
|
||||
case JSOp::Uint16:
|
||||
case JSOp::ResumeKind:
|
||||
case JSOp::GetGName:
|
||||
case JSOp::GetName:
|
||||
case JSOp::GetIntrinsic:
|
||||
case JSOp::GetImport:
|
||||
case JSOp::BindGName:
|
||||
case JSOp::BindName:
|
||||
case JSOp::BindVar:
|
||||
case JSOp::Dup:
|
||||
case JSOp::Dup2:
|
||||
case JSOp::Swap:
|
||||
case JSOp::Pick:
|
||||
case JSOp::Unpick:
|
||||
case JSOp::GetAliasedVar:
|
||||
case JSOp::Uint24:
|
||||
case JSOp::ResumeIndex:
|
||||
case JSOp::Int32:
|
||||
case JSOp::LoopHead:
|
||||
case JSOp::GetElem:
|
||||
case JSOp::CallElem:
|
||||
case JSOp::Length:
|
||||
case JSOp::Not:
|
||||
case JSOp::FunctionThis:
|
||||
case JSOp::GlobalThis:
|
||||
case JSOp::Callee:
|
||||
case JSOp::EnvCallee:
|
||||
case JSOp::SuperBase:
|
||||
case JSOp::GetPropSuper:
|
||||
case JSOp::GetElemSuper:
|
||||
case JSOp::GetProp:
|
||||
case JSOp::CallProp:
|
||||
case JSOp::RegExp:
|
||||
case JSOp::CallSiteObj:
|
||||
case JSOp::Object:
|
||||
case JSOp::ClassConstructor:
|
||||
case JSOp::Typeof:
|
||||
case JSOp::TypeofExpr:
|
||||
case JSOp::ToAsyncIter:
|
||||
case JSOp::ToId:
|
||||
case JSOp::IterNext:
|
||||
case JSOp::Lambda:
|
||||
case JSOp::LambdaArrow:
|
||||
case JSOp::PushLexicalEnv:
|
||||
case JSOp::PopLexicalEnv:
|
||||
case JSOp::FreshenLexicalEnv:
|
||||
case JSOp::RecreateLexicalEnv:
|
||||
case JSOp::Iter:
|
||||
case JSOp::MoreIter:
|
||||
case JSOp::IsNoIter:
|
||||
case JSOp::EndIter:
|
||||
case JSOp::In:
|
||||
case JSOp::HasOwn:
|
||||
case JSOp::SetRval:
|
||||
case JSOp::Instanceof:
|
||||
case JSOp::DebugLeaveLexicalEnv:
|
||||
case JSOp::Debugger:
|
||||
case JSOp::GImplicitThis:
|
||||
case JSOp::ImplicitThis:
|
||||
case JSOp::NewTarget:
|
||||
case JSOp::CheckIsObj:
|
||||
case JSOp::CheckIsCallable:
|
||||
case JSOp::CheckObjCoercible:
|
||||
case JSOp::DebugCheckSelfHosted:
|
||||
case JSOp::IsConstructing:
|
||||
case JSOp::OptimizeSpreadCall:
|
||||
case JSOp::ImportMeta:
|
||||
case JSOp::InstrumentationActive:
|
||||
case JSOp::InstrumentationCallback:
|
||||
case JSOp::InstrumentationScriptId:
|
||||
case JSOp::EnterWith:
|
||||
case JSOp::LeaveWith:
|
||||
case JSOp::SpreadNew:
|
||||
case JSOp::SpreadEval:
|
||||
case JSOp::StrictSpreadEval:
|
||||
case JSOp::CheckClassHeritage:
|
||||
case JSOp::FunWithProto:
|
||||
case JSOp::ObjWithProto:
|
||||
case JSOp::BuiltinProto:
|
||||
case JSOp::DerivedConstructor:
|
||||
case JSOp::CheckThis:
|
||||
case JSOp::CheckReturn:
|
||||
case JSOp::CheckThisReinit:
|
||||
case JSOp::SuperFun:
|
||||
case JSOp::SpreadSuperCall:
|
||||
case JSOp::SuperCall:
|
||||
case JSOp::PushVarEnv:
|
||||
case JSOp::PopVarEnv:
|
||||
case JSOp::GetBoundName:
|
||||
case JSOp::Exception:
|
||||
case JSOp::IsGenClosing:
|
||||
case JSOp::FinalYieldRval:
|
||||
case JSOp::Resume:
|
||||
case JSOp::CheckResumeKind:
|
||||
case JSOp::AfterYield:
|
||||
case JSOp::Await:
|
||||
case JSOp::TrySkipAwait:
|
||||
case JSOp::Generator:
|
||||
case JSOp::AsyncAwait:
|
||||
case JSOp::AsyncResolve:
|
||||
case JSOp::Finally:
|
||||
case JSOp::GetRval:
|
||||
case JSOp::Gosub:
|
||||
case JSOp::Retsub:
|
||||
case JSOp::ThrowMsg:
|
||||
case JSOp::ForceInterpreter:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -2130,17 +2130,17 @@ JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceCallExpression(
|
|||
parseArguments(FieldContext(
|
||||
BinASTInterfaceAndField::CallExpression__Arguments)));
|
||||
|
||||
auto op = JSOP_CALL;
|
||||
auto op = JSOp::Call;
|
||||
|
||||
// Try to optimize funcall and funapply at the bytecode level
|
||||
if (PropertyName* prop = handler_.maybeDottedProperty(callee)) {
|
||||
if (prop == cx_->names().apply) {
|
||||
op = JSOP_FUNAPPLY;
|
||||
op = JSOp::FunApply;
|
||||
if (pc_->isFunctionBox()) {
|
||||
pc_->functionBox()->usesApply = true;
|
||||
}
|
||||
} else if (prop == cx_->names().call) {
|
||||
op = JSOP_FUNCALL;
|
||||
op = JSOp::FunCall;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2153,7 +2153,7 @@ JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceCallExpression(
|
|||
return raiseMissingDirectEvalInAssertedScope();
|
||||
}
|
||||
|
||||
op = pc_->sc()->strict() ? JSOP_STRICTEVAL : JSOP_EVAL;
|
||||
op = pc_->sc()->strict() ? JSOp::StrictEval : JSOp::Eval;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ bool LoopControl::emitLoopHead(BytecodeEmitter* bce,
|
|||
// JSOp::LoopHead. This avoids JIT issues with prologue code + try notes
|
||||
// or OSR. See bug 1602390 and bug 1602681.
|
||||
if (bce->bytecodeSection().offset().toUint32() == 0) {
|
||||
if (!bce->emit1(JSOP_NOP)) {
|
||||
if (!bce->emit1(JSOp::Nop)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ bool LoopControl::emitLoopHead(BytecodeEmitter* bce,
|
|||
head_ = {bce->bytecodeSection().offset()};
|
||||
|
||||
BytecodeOffset off;
|
||||
if (!bce->emitJumpTargetOp(JSOP_LOOPHEAD, &off)) {
|
||||
if (!bce->emitJumpTargetOp(JSOp::LoopHead, &off)) {
|
||||
return false;
|
||||
}
|
||||
SetLoopHeadDepthHint(bce->bytecodeSection().code(off), loopDepth_);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -797,7 +797,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
|
|||
|
||||
MOZ_MUST_USE bool emitReturnRval() {
|
||||
return emitInstrumentation(InstrumentationKind::Exit) &&
|
||||
emit1(JSOP_RETRVAL);
|
||||
emit1(JSOp::RetRval);
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool emitInstrumentation(InstrumentationKind kind,
|
||||
|
|
|
@ -61,7 +61,7 @@ bool CForEmitter::emitCond(const Maybe<uint32_t>& condPos) {
|
|||
ScopeKind::Lexical);
|
||||
|
||||
if (headLexicalEmitterScopeForLet_->hasEnvironment()) {
|
||||
if (!bce_->emit1(JSOP_FRESHENLEXICALENV)) {
|
||||
if (!bce_->emit1(JSOp::FreshenLexicalEnv)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ bool CForEmitter::emitBody(Cond cond) {
|
|||
cond_ = cond;
|
||||
|
||||
if (cond_ == Cond::Present) {
|
||||
if (!bce_->emitJump(JSOP_IFEQ, &loopInfo_->breaks)) {
|
||||
if (!bce_->emitJump(JSOp::IfEq, &loopInfo_->breaks)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ bool CForEmitter::emitUpdate(Update update, const Maybe<uint32_t>& updatePos) {
|
|||
ScopeKind::Lexical);
|
||||
|
||||
if (headLexicalEmitterScopeForLet_->hasEnvironment()) {
|
||||
if (!bce_->emit1(JSOP_FRESHENLEXICALENV)) {
|
||||
if (!bce_->emit1(JSOp::FreshenLexicalEnv)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ bool CForEmitter::emitEnd(const Maybe<uint32_t>& forPos) {
|
|||
|
||||
// [stack] UPDATE
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ bool CForEmitter::emitEnd(const Maybe<uint32_t>& forPos) {
|
|||
}
|
||||
|
||||
// Emit the loop-closing jump.
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOP_GOTO, JSTRY_LOOP)) {
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOp::Goto, JSTRY_LOOP)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ CallOrNewEmitter::CallOrNewEmitter(BytecodeEmitter* bce, JSOp op,
|
|||
ArgumentsKind argumentsKind,
|
||||
ValueUsage valueUsage)
|
||||
: bce_(bce), op_(op), argumentsKind_(argumentsKind) {
|
||||
if (op_ == JSOP_CALL && valueUsage == ValueUsage::IgnoreValue) {
|
||||
op_ = JSOP_CALL_IGNORES_RV;
|
||||
if (op_ == JSOp::Call && valueUsage == ValueUsage::IgnoreValue) {
|
||||
op_ = JSOp::CallIgnoresRv;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(isCall() || isNew() || isSuperCall());
|
||||
|
@ -105,11 +105,11 @@ bool CallOrNewEmitter::emitSuperCallee() {
|
|||
// [stack] CALLEE
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_SUPERFUN)) {
|
||||
if (!bce_->emit1(JSOp::SuperFun)) {
|
||||
// [stack] CALLEE
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_IS_CONSTRUCTING)) {
|
||||
if (!bce_->emit1(JSOp::IsConstructing)) {
|
||||
// [stack] CALLEE THIS
|
||||
return false;
|
||||
}
|
||||
|
@ -162,12 +162,12 @@ bool CallOrNewEmitter::emitThis() {
|
|||
}
|
||||
if (needsThis) {
|
||||
if (isNew() || isSuperCall()) {
|
||||
if (!bce_->emit1(JSOP_IS_CONSTRUCTING)) {
|
||||
if (!bce_->emit1(JSOp::IsConstructing)) {
|
||||
// [stack] CALLEE THIS
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!bce_->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce_->emit1(JSOp::Undefined)) {
|
||||
// [stack] CALLEE THIS
|
||||
return false;
|
||||
}
|
||||
|
@ -223,11 +223,11 @@ bool CallOrNewEmitter::emitSpreadArgumentsTest() {
|
|||
// [stack] CALLEE THIS ARG0
|
||||
|
||||
ifNotOptimizable_.emplace(bce_);
|
||||
if (!bce_->emit1(JSOP_OPTIMIZE_SPREADCALL)) {
|
||||
if (!bce_->emit1(JSOp::OptimizeSpreadCall)) {
|
||||
// [stack] CALLEE THIS ARG0 OPTIMIZED
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_NOT)) {
|
||||
if (!bce_->emit1(JSOp::Not)) {
|
||||
// [stack] CALLEE THIS ARG0 !OPTIMIZED
|
||||
return false;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ bool CallOrNewEmitter::emitSpreadArgumentsTest() {
|
|||
// [stack] CALLEE THIS ARG0
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] CALLEE THIS
|
||||
return false;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ bool CallOrNewEmitter::emitEnd(uint32_t argc, const Maybe<uint32_t>& beginPos) {
|
|||
}
|
||||
if (isNew() || isSuperCall()) {
|
||||
if (isSuperCall()) {
|
||||
if (!bce_->emit1(JSOP_NEWTARGET)) {
|
||||
if (!bce_->emit1(JSOp::NewTarget)) {
|
||||
// [stack] CALLEE THIS ARG.. NEW.TARGET
|
||||
return false;
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ bool CallOrNewEmitter::emitEnd(uint32_t argc, const Maybe<uint32_t>& beginPos) {
|
|||
|
||||
if (isEval() && beginPos) {
|
||||
uint32_t lineNum = bce_->parser->errorReporter().lineAt(*beginPos);
|
||||
if (!bce_->emitUint32Operand(JSOP_LINENO, lineNum)) {
|
||||
if (!bce_->emitUint32Operand(JSOp::Lineno, lineNum)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,26 +262,26 @@ class MOZ_STACK_CLASS CallOrNewEmitter {
|
|||
|
||||
private:
|
||||
MOZ_MUST_USE bool isCall() const {
|
||||
return op_ == JSOP_CALL || op_ == JSOP_CALL_IGNORES_RV ||
|
||||
op_ == JSOP_SPREADCALL || isEval() || isFunApply() || isFunCall();
|
||||
return op_ == JSOp::Call || op_ == JSOp::CallIgnoresRv ||
|
||||
op_ == JSOp::SpreadCall || isEval() || isFunApply() || isFunCall();
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool isNew() const {
|
||||
return op_ == JSOP_NEW || op_ == JSOP_SPREADNEW;
|
||||
return op_ == JSOp::New || op_ == JSOp::SpreadNew;
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool isSuperCall() const {
|
||||
return op_ == JSOP_SUPERCALL || op_ == JSOP_SPREADSUPERCALL;
|
||||
return op_ == JSOp::SuperCall || op_ == JSOp::SpreadSuperCall;
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool isEval() const {
|
||||
return op_ == JSOP_EVAL || op_ == JSOP_STRICTEVAL ||
|
||||
op_ == JSOP_SPREADEVAL || op_ == JSOP_STRICTSPREADEVAL;
|
||||
return op_ == JSOp::Eval || op_ == JSOp::StrictEval ||
|
||||
op_ == JSOp::SpreadEval || op_ == JSOp::StrictSpreadEval;
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool isFunApply() const { return op_ == JSOP_FUNAPPLY; }
|
||||
MOZ_MUST_USE bool isFunApply() const { return op_ == JSOp::FunApply; }
|
||||
|
||||
MOZ_MUST_USE bool isFunCall() const { return op_ == JSOP_FUNCALL; }
|
||||
MOZ_MUST_USE bool isFunCall() const { return op_ == JSOp::FunCall; }
|
||||
|
||||
MOZ_MUST_USE bool isSpread() const { return JOF_OPTYPE(op_) == JOF_BYTE; }
|
||||
|
||||
|
|
|
@ -29,15 +29,15 @@ bool DefaultEmitter::prepareForDefault() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] VALUE VALUE
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce_->emit1(JSOp::Undefined)) {
|
||||
// [stack] VALUE VALUE UNDEFINED
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_STRICTEQ)) {
|
||||
if (!bce_->emit1(JSOp::StrictEq)) {
|
||||
// [stack] VALUE EQ?
|
||||
return false;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ bool DefaultEmitter::prepareForDefault() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ bool DoWhileEmitter::emitBody(const Maybe<uint32_t>& doPos,
|
|||
}
|
||||
|
||||
// We need a nop here to make it possible to set a breakpoint on `do`.
|
||||
if (!bce_->emit1(JSOP_NOP)) {
|
||||
if (!bce_->emit1(JSOp::Nop)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ bool DoWhileEmitter::emitCond() {
|
|||
bool DoWhileEmitter::emitEnd() {
|
||||
MOZ_ASSERT(state_ == State::Cond);
|
||||
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOP_IFNE, JSTRY_LOOP)) {
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOp::IfNe, JSTRY_LOOP)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ bool ElemOpEmitter::prepareForKey() {
|
|||
MOZ_ASSERT(state_ == State::Obj);
|
||||
|
||||
if (!isSuper() && isIncDec()) {
|
||||
if (!bce_->emit1(JSOP_CHECKOBJCOERCIBLE)) {
|
||||
if (!bce_->emit1(JSOp::CheckObjCoercible)) {
|
||||
// [stack] OBJ
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (isCall()) {
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] # if Super
|
||||
// [stack] THIS THIS
|
||||
// [stack] # otherwise
|
||||
|
@ -54,7 +54,7 @@ bool ElemOpEmitter::emitGet() {
|
|||
MOZ_ASSERT(state_ == State::Key);
|
||||
|
||||
if (isIncDec() || isCompoundAssignment()) {
|
||||
if (!bce_->emit1(JSOP_TOID)) {
|
||||
if (!bce_->emit1(JSOp::ToId)) {
|
||||
// [stack] # if Super
|
||||
// [stack] THIS KEY
|
||||
// [stack] # otherwise
|
||||
|
@ -75,7 +75,7 @@ bool ElemOpEmitter::emitGet() {
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!bce_->emit1(JSOP_DUP2)) {
|
||||
if (!bce_->emit1(JSOp::Dup2)) {
|
||||
// [stack] OBJ KEY OBJ KEY
|
||||
return false;
|
||||
}
|
||||
|
@ -84,11 +84,11 @@ bool ElemOpEmitter::emitGet() {
|
|||
|
||||
JSOp op;
|
||||
if (isSuper()) {
|
||||
op = JSOP_GETELEM_SUPER;
|
||||
op = JSOp::GetElemSuper;
|
||||
} else if (isCall()) {
|
||||
op = JSOP_CALLELEM;
|
||||
op = JSOp::CallElem;
|
||||
} else {
|
||||
op = JSOP_GETELEM;
|
||||
op = JSOp::GetElem;
|
||||
}
|
||||
if (!bce_->emitElemOpBase(op, ShouldInstrument::Yes)) {
|
||||
// [stack] # if Get
|
||||
|
@ -102,7 +102,7 @@ bool ElemOpEmitter::emitGet() {
|
|||
return false;
|
||||
}
|
||||
if (isCall()) {
|
||||
if (!bce_->emit1(JSOP_SWAP)) {
|
||||
if (!bce_->emit1(JSOp::Swap)) {
|
||||
// [stack] ELEM THIS
|
||||
return false;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ bool ElemOpEmitter::emitDelete() {
|
|||
MOZ_ASSERT(isDelete());
|
||||
|
||||
if (isSuper()) {
|
||||
if (!bce_->emit1(JSOP_TOID)) {
|
||||
if (!bce_->emit1(JSOp::ToId)) {
|
||||
// [stack] THIS KEY
|
||||
return false;
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ bool ElemOpEmitter::emitDelete() {
|
|||
}
|
||||
|
||||
// Unconditionally throw when attempting to delete a super-reference.
|
||||
if (!bce_->emitUint16Operand(JSOP_THROWMSG, JSMSG_CANT_DELETE_SUPER)) {
|
||||
if (!bce_->emitUint16Operand(JSOp::ThrowMsg, JSMSG_CANT_DELETE_SUPER)) {
|
||||
// [stack] THIS KEY SUPERBASE
|
||||
return false;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ bool ElemOpEmitter::emitDelete() {
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
JSOp op = bce_->sc->strict() ? JSOP_STRICTDELELEM : JSOP_DELELEM;
|
||||
JSOp op = bce_->sc->strict() ? JSOp::StrictDelElem : JSOp::DelElem;
|
||||
if (!bce_->emitElemOpBase(op)) {
|
||||
// SUCCEEDED
|
||||
return false;
|
||||
|
@ -191,12 +191,12 @@ bool ElemOpEmitter::emitAssignment() {
|
|||
|
||||
MOZ_ASSERT_IF(isPropInit(), !isSuper());
|
||||
|
||||
JSOp setOp =
|
||||
isPropInit()
|
||||
? JSOP_INITELEM
|
||||
: isSuper() ? bce_->sc->strict() ? JSOP_STRICTSETELEM_SUPER
|
||||
: JSOP_SETELEM_SUPER
|
||||
: bce_->sc->strict() ? JSOP_STRICTSETELEM : JSOP_SETELEM;
|
||||
JSOp setOp = isPropInit()
|
||||
? JSOp::InitElem
|
||||
: isSuper() ? bce_->sc->strict() ? JSOp::StrictSetElemSuper
|
||||
: JSOp::SetElemSuper
|
||||
: bce_->sc->strict() ? JSOp::StrictSetElem
|
||||
: JSOp::SetElem;
|
||||
if (!bce_->emitElemOpBase(setOp, ShouldInstrument::Yes)) {
|
||||
// [stack] ELEM
|
||||
return false;
|
||||
|
@ -219,18 +219,18 @@ bool ElemOpEmitter::emitIncDec() {
|
|||
|
||||
MOZ_ASSERT(state_ == State::Get);
|
||||
|
||||
JSOp incOp = isInc() ? JSOP_INC : JSOP_DEC;
|
||||
if (!bce_->emit1(JSOP_TONUMERIC)) {
|
||||
JSOp incOp = isInc() ? JSOp::Inc : JSOp::Dec;
|
||||
if (!bce_->emit1(JSOp::ToNumeric)) {
|
||||
// [stack] ... N
|
||||
return false;
|
||||
}
|
||||
if (isPostIncDec()) {
|
||||
// [stack] OBJ KEY SUPERBASE? N
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] ... N N
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit2(JSOP_UNPICK, 3 + isSuper())) {
|
||||
if (!bce_->emit2(JSOp::Unpick, 3 + isSuper())) {
|
||||
// [stack] N OBJ KEY SUPERBASE? N
|
||||
return false;
|
||||
}
|
||||
|
@ -242,14 +242,14 @@ bool ElemOpEmitter::emitIncDec() {
|
|||
|
||||
JSOp setOp =
|
||||
isSuper()
|
||||
? (bce_->sc->strict() ? JSOP_STRICTSETELEM_SUPER : JSOP_SETELEM_SUPER)
|
||||
: (bce_->sc->strict() ? JSOP_STRICTSETELEM : JSOP_SETELEM);
|
||||
? (bce_->sc->strict() ? JSOp::StrictSetElemSuper : JSOp::SetElemSuper)
|
||||
: (bce_->sc->strict() ? JSOp::StrictSetElem : JSOp::SetElem);
|
||||
if (!bce_->emitElemOpBase(setOp, ShouldInstrument::Yes)) {
|
||||
// [stack] N? N+1
|
||||
return false;
|
||||
}
|
||||
if (isPostIncDec()) {
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] N
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -402,15 +402,15 @@ bool EmitterScope::deadZoneFrameSlotRange(BytecodeEmitter* bce,
|
|||
// throw reference errors. See 13.1.11, 9.2.13, 13.6.3.4, 13.6.4.6,
|
||||
// 13.6.4.8, 13.14.5, 15.1.8, and 15.2.0.15.
|
||||
if (slotStart != slotEnd) {
|
||||
if (!bce->emit1(JSOP_UNINITIALIZED)) {
|
||||
if (!bce->emit1(JSOp::Uninitialized)) {
|
||||
return false;
|
||||
}
|
||||
for (uint32_t slot = slotStart; slot < slotEnd; slot++) {
|
||||
if (!bce->emitLocalOp(JSOP_INITLEXICAL, slot)) {
|
||||
if (!bce->emitLocalOp(JSOp::InitLexical, slot)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!bce->emit1(JSOP_POP)) {
|
||||
if (!bce->emit1(JSOp::Pop)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ bool EmitterScope::enterLexical(BytecodeEmitter* bce, ScopeKind kind,
|
|||
|
||||
if (ScopeKindIsInBody(kind) && hasEnvironment()) {
|
||||
// After interning the VM scope we can get the scope index.
|
||||
if (!bce->emitInternedScopeOp(index(), JSOP_PUSHLEXICALENV)) {
|
||||
if (!bce->emitInternedScopeOp(index(), JSOp::PushLexicalEnv)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -798,7 +798,7 @@ bool EmitterScope::enterFunctionExtraBodyVar(BytecodeEmitter* bce,
|
|||
}
|
||||
|
||||
if (hasEnvironment()) {
|
||||
if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV)) {
|
||||
if (!bce->emitInternedScopeOp(index(), JSOp::PushVarEnv)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -848,7 +848,7 @@ bool EmitterScope::enterParameterExpressionVar(BytecodeEmitter* bce) {
|
|||
}
|
||||
|
||||
MOZ_ASSERT(hasEnvironment());
|
||||
if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV)) {
|
||||
if (!bce->emitInternedScopeOp(index(), JSOp::PushVarEnv)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -873,11 +873,11 @@ class DynamicBindingIter : public BindingIter {
|
|||
JSOp bindingOp() const {
|
||||
switch (kind()) {
|
||||
case BindingKind::Var:
|
||||
return JSOP_DEFVAR;
|
||||
return JSOp::DefVar;
|
||||
case BindingKind::Let:
|
||||
return JSOP_DEFLET;
|
||||
return JSOp::DefLet;
|
||||
case BindingKind::Const:
|
||||
return JSOP_DEFCONST;
|
||||
return JSOp::DefConst;
|
||||
default:
|
||||
MOZ_CRASH("Bad BindingKind");
|
||||
}
|
||||
|
@ -996,7 +996,7 @@ bool EmitterScope::enterEval(BytecodeEmitter* bce, EvalSharedContext* evalsc) {
|
|||
}
|
||||
}
|
||||
if (hasEnvironment()) {
|
||||
if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV)) {
|
||||
if (!bce->emitInternedScopeOp(index(), JSOp::PushVarEnv)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
@ -1009,13 +1009,13 @@ bool EmitterScope::enterEval(BytecodeEmitter* bce, EvalSharedContext* evalsc) {
|
|||
// the frame. For now, handle everything dynamically.
|
||||
if (!hasEnvironment() && evalsc->bindings) {
|
||||
for (DynamicBindingIter bi(evalsc); bi; bi++) {
|
||||
MOZ_ASSERT(bi.bindingOp() == JSOP_DEFVAR);
|
||||
MOZ_ASSERT(bi.bindingOp() == JSOp::DefVar);
|
||||
|
||||
if (bi.isTopLevelFunction()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!bce->emitAtomOp(JSOP_DEFVAR, bi.name())) {
|
||||
if (!bce->emitAtomOp(JSOp::DefVar, bi.name())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ bool EmitterScope::enterWith(BytecodeEmitter* bce) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!bce->emitInternedScopeOp(index(), JSOP_ENTERWITH)) {
|
||||
if (!bce->emitInternedScopeOp(index(), JSOp::EnterWith)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1165,21 +1165,21 @@ bool EmitterScope::leave(BytecodeEmitter* bce, bool nonLocal) {
|
|||
case ScopeKind::SimpleCatch:
|
||||
case ScopeKind::Catch:
|
||||
case ScopeKind::FunctionLexical:
|
||||
if (!bce->emit1(hasEnvironment() ? JSOP_POPLEXICALENV
|
||||
: JSOP_DEBUGLEAVELEXICALENV)) {
|
||||
if (!bce->emit1(hasEnvironment() ? JSOp::PopLexicalEnv
|
||||
: JSOp::DebugLeaveLexicalEnv)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case ScopeKind::With:
|
||||
if (!bce->emit1(JSOP_LEAVEWITH)) {
|
||||
if (!bce->emit1(JSOp::LeaveWith)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case ScopeKind::ParameterExpressionVar:
|
||||
MOZ_ASSERT(hasEnvironment());
|
||||
if (!bce->emit1(JSOP_POPVARENV)) {
|
||||
if (!bce->emit1(JSOp::PopVarEnv)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -41,7 +41,7 @@ bool ExpressionStatementEmitter::emitEnd() {
|
|||
|
||||
// [stack] VAL
|
||||
|
||||
JSOp op = valueUsage_ == ValueUsage::WantValue ? JSOP_SETRVAL : JSOP_POP;
|
||||
JSOp op = valueUsage_ == ValueUsage::WantValue ? JSOp::SetRval : JSOp::Pop;
|
||||
if (!bce_->emit1(op)) {
|
||||
// [stack] # if WantValue
|
||||
// [stack] VAL
|
||||
|
|
|
@ -36,7 +36,7 @@ bool ForInEmitter::emitInitialize() {
|
|||
MOZ_ASSERT(state_ == State::Iterated);
|
||||
tdzCacheForIteratedValue_.reset();
|
||||
|
||||
if (!bce_->emit1(JSOP_ITER)) {
|
||||
if (!bce_->emit1(JSOp::Iter)) {
|
||||
// [stack] ITER
|
||||
return false;
|
||||
}
|
||||
|
@ -48,15 +48,15 @@ bool ForInEmitter::emitInitialize() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_MOREITER)) {
|
||||
if (!bce_->emit1(JSOp::MoreIter)) {
|
||||
// [stack] ITER NEXTITERVAL?
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_ISNOITER)) {
|
||||
if (!bce_->emit1(JSOp::IsNoIter)) {
|
||||
// [stack] ITER NEXTITERVAL? ISNOITER
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emitJump(JSOP_IFNE, &loopInfo_->breaks)) {
|
||||
if (!bce_->emitJump(JSOp::IfNe, &loopInfo_->breaks)) {
|
||||
// [stack] ITER NEXTITERVAL?
|
||||
return false;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ bool ForInEmitter::emitInitialize() {
|
|||
ScopeKind::Lexical);
|
||||
|
||||
if (headLexicalEmitterScope_->hasEnvironment()) {
|
||||
if (!bce_->emit1(JSOP_RECREATELEXICALENV)) {
|
||||
if (!bce_->emit1(JSOp::RecreateLexicalEnv)) {
|
||||
// [stack] ITER ITERVAL
|
||||
return false;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ bool ForInEmitter::emitInitialize() {
|
|||
#endif
|
||||
MOZ_ASSERT(loopDepth_ >= 2);
|
||||
|
||||
if (!bce_->emit1(JSOP_ITERNEXT)) {
|
||||
if (!bce_->emit1(JSOp::IterNext)) {
|
||||
// [stack] ITER ITERVAL
|
||||
return false;
|
||||
}
|
||||
|
@ -130,11 +130,11 @@ bool ForInEmitter::emitEnd(const Maybe<uint32_t>& forPos) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] ITER
|
||||
return false;
|
||||
}
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOP_GOTO, JSTRY_FOR_IN)) {
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOp::Goto, JSTRY_FOR_IN)) {
|
||||
// [stack] ITER
|
||||
return false;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ bool ForInEmitter::emitEnd(const Maybe<uint32_t>& forPos) {
|
|||
// [stack] ITER ITERVAL
|
||||
|
||||
// Pop the value and iterator and close the iterator.
|
||||
if (!bce_->emit1(JSOP_ENDITER)) {
|
||||
if (!bce_->emit1(JSOp::EndIter)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ bool ForOfEmitter::emitInitialize(const Maybe<uint32_t>& forPos) {
|
|||
ScopeKind::Lexical);
|
||||
|
||||
if (headLexicalEmitterScope_->hasEnvironment()) {
|
||||
if (!bce_->emit1(JSOP_RECREATELEXICALENV)) {
|
||||
if (!bce_->emit1(JSOp::RecreateLexicalEnv)) {
|
||||
// [stack] NEXT ITER
|
||||
return false;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ bool ForOfEmitter::emitInitialize(const Maybe<uint32_t>& forPos) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_DUP2)) {
|
||||
if (!bce_->emit1(JSOp::Dup2)) {
|
||||
// [stack] NEXT ITER NEXT ITER
|
||||
return false;
|
||||
}
|
||||
|
@ -115,11 +115,11 @@ bool ForOfEmitter::emitInitialize(const Maybe<uint32_t>& forPos) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] NEXT ITER RESULT RESULT
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emitAtomOp(JSOP_GETPROP, bce_->cx->names().done)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetProp, bce_->cx->names().done)) {
|
||||
// [stack] NEXT ITER RESULT DONE
|
||||
return false;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ bool ForOfEmitter::emitInitialize(const Maybe<uint32_t>& forPos) {
|
|||
// if (done) break;
|
||||
MOZ_ASSERT(bce_->innermostNestableControl == loopInfo_.ptr(),
|
||||
"must be at the top-level of the loop");
|
||||
if (!bce_->emitJump(JSOP_IFNE, &loopInfo_->breaks)) {
|
||||
if (!bce_->emitJump(JSOp::IfNe, &loopInfo_->breaks)) {
|
||||
// [stack] NEXT ITER RESULT
|
||||
return false;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ bool ForOfEmitter::emitInitialize(const Maybe<uint32_t>& forPos) {
|
|||
//
|
||||
// Note that ES 13.7.5.13, step 5.c says getting result.value does not
|
||||
// call IteratorClose, so start JSTRY_ITERCLOSE after the GetProp.
|
||||
if (!bce_->emitAtomOp(JSOP_GETPROP, bce_->cx->names().value)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetProp, bce_->cx->names().value)) {
|
||||
// [stack] NEXT ITER VALUE
|
||||
return false;
|
||||
}
|
||||
|
@ -190,12 +190,12 @@ bool ForOfEmitter::emitEnd(const Maybe<uint32_t>& iteratedPos) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] NEXT ITER
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOP_GOTO, JSTRY_FOR_OF)) {
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOp::Goto, JSTRY_FOR_OF)) {
|
||||
// [stack] NEXT ITER
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -54,11 +54,11 @@ bool ForOfLoopControl::emitEndCodeNeedingIteratorClose(BytecodeEmitter* bce) {
|
|||
// If ITER is undefined, it means the exception is thrown by
|
||||
// IteratorClose for non-local jump, and we should't perform
|
||||
// IteratorClose again here.
|
||||
if (!bce->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce->emit1(JSOp::Undefined)) {
|
||||
// [stack] ITER ... EXCEPTION ITER UNDEF
|
||||
return false;
|
||||
}
|
||||
if (!bce->emit1(JSOP_STRICTNE)) {
|
||||
if (!bce->emit1(JSOp::StrictNe)) {
|
||||
// [stack] ITER ... EXCEPTION NE
|
||||
return false;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ bool ForOfLoopControl::emitEndCodeNeedingIteratorClose(BytecodeEmitter* bce) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce->emit1(JSOP_THROW)) {
|
||||
if (!bce->emit1(JSOp::Throw)) {
|
||||
// [stack] ITER ...
|
||||
return false;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ bool ForOfLoopControl::emitEndCodeNeedingIteratorClose(BytecodeEmitter* bce) {
|
|||
}
|
||||
|
||||
InternalIfEmitter ifGeneratorClosing(bce);
|
||||
if (!bce->emit1(JSOP_ISGENCLOSING)) {
|
||||
if (!bce->emit1(JSOp::IsGenClosing)) {
|
||||
// [stack] ITER ... FTYPE FVALUE CLOSING
|
||||
return false;
|
||||
}
|
||||
|
@ -168,28 +168,28 @@ bool ForOfLoopControl::emitPrepareForNonLocalJumpFromScope(
|
|||
// leaving try-catch block. However, the performing IteratorClose can
|
||||
// reach the depth for try-catch, and effectively re-enter the
|
||||
// try-catch block.
|
||||
if (!bce->emit1(JSOP_POP)) {
|
||||
if (!bce->emit1(JSOp::Pop)) {
|
||||
// [stack] NEXT ITER
|
||||
return false;
|
||||
}
|
||||
|
||||
// Pop the iterator's next method.
|
||||
if (!bce->emit1(JSOP_SWAP)) {
|
||||
if (!bce->emit1(JSOp::Swap)) {
|
||||
// [stack] ITER NEXT
|
||||
return false;
|
||||
}
|
||||
if (!bce->emit1(JSOP_POP)) {
|
||||
if (!bce->emit1(JSOp::Pop)) {
|
||||
// [stack] ITER
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear ITER slot on the stack to tell catch block to avoid performing
|
||||
// IteratorClose again.
|
||||
if (!bce->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce->emit1(JSOp::Undefined)) {
|
||||
// [stack] ITER UNDEF
|
||||
return false;
|
||||
}
|
||||
if (!bce->emit1(JSOP_SWAP)) {
|
||||
if (!bce->emit1(JSOp::Swap)) {
|
||||
// [stack] UNDEF ITER
|
||||
return false;
|
||||
}
|
||||
|
@ -204,16 +204,16 @@ bool ForOfLoopControl::emitPrepareForNonLocalJumpFromScope(
|
|||
// At the level of the target block, there's bytecode after the
|
||||
// loop that will pop the next method, the iterator, and the
|
||||
// value, so push two undefineds to balance the stack.
|
||||
if (!bce->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce->emit1(JSOp::Undefined)) {
|
||||
// [stack] UNDEF UNDEF
|
||||
return false;
|
||||
}
|
||||
if (!bce->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce->emit1(JSOp::Undefined)) {
|
||||
// [stack] UNDEF UNDEF UNDEF
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!bce->emit1(JSOP_POP)) {
|
||||
if (!bce->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -350,7 +350,7 @@ class FullParseHandler {
|
|||
|
||||
CallNodeType newSuperCall(Node callee, Node args, bool isSpread) {
|
||||
return new_<CallNode>(ParseNodeKind::SuperCallExpr,
|
||||
isSpread ? JSOP_SPREADSUPERCALL : JSOP_SUPERCALL,
|
||||
isSpread ? JSOp::SpreadSuperCall : JSOp::SuperCall,
|
||||
callee, args);
|
||||
}
|
||||
|
||||
|
@ -875,7 +875,7 @@ class FullParseHandler {
|
|||
CallNodeType newNewExpression(uint32_t begin, Node ctor, Node args,
|
||||
bool isSpread) {
|
||||
return new_<CallNode>(ParseNodeKind::NewExpr,
|
||||
isSpread ? JSOP_SPREADNEW : JSOP_NEW,
|
||||
isSpread ? JSOp::SpreadNew : JSOp::New,
|
||||
TokenPos(begin, args->pn_pos.end), ctor, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ bool FunctionEmitter::emitAgain() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ bool FunctionEmitter::emitNonHoisted(unsigned index) {
|
|||
|
||||
if (syntaxKind_ == FunctionSyntaxKind::DerivedClassConstructor) {
|
||||
// [stack] PROTO
|
||||
if (!bce_->emitIndexOp(JSOP_FUNWITHPROTO, index)) {
|
||||
if (!bce_->emitIndexOp(JSOp::FunWithProto, index)) {
|
||||
// [stack] FUN
|
||||
return false;
|
||||
}
|
||||
|
@ -282,8 +282,8 @@ bool FunctionEmitter::emitNonHoisted(unsigned index) {
|
|||
|
||||
// This is a FunctionExpression, ArrowFunctionExpression, or class
|
||||
// constructor. Emit the single instruction (without location info).
|
||||
JSOp op = syntaxKind_ == FunctionSyntaxKind::Arrow ? JSOP_LAMBDA_ARROW
|
||||
: JSOP_LAMBDA;
|
||||
JSOp op = syntaxKind_ == FunctionSyntaxKind::Arrow ? JSOp::LambdaArrow
|
||||
: JSOp::Lambda;
|
||||
if (!bce_->emitIndexOp(op, index)) {
|
||||
// [stack] FUN
|
||||
return false;
|
||||
|
@ -306,7 +306,7 @@ bool FunctionEmitter::emitHoisted(unsigned index) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emitIndexOp(JSOP_LAMBDA, index)) {
|
||||
if (!bce_->emitIndexOp(JSOp::Lambda, index)) {
|
||||
// [stack] FUN
|
||||
return false;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ bool FunctionEmitter::emitHoisted(unsigned index) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -343,11 +343,11 @@ bool FunctionEmitter::emitTopLevelFunction(unsigned index) {
|
|||
MOZ_ASSERT(syntaxKind_ == FunctionSyntaxKind::Statement);
|
||||
MOZ_ASSERT(bce_->inPrologue());
|
||||
|
||||
if (!bce_->emitIndexOp(JSOP_LAMBDA, index)) {
|
||||
if (!bce_->emitIndexOp(JSOp::Lambda, index)) {
|
||||
// [stack] FUN
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_DEFFUN)) {
|
||||
if (!bce_->emit1(JSOp::DefFun)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -358,12 +358,12 @@ bool FunctionEmitter::emitNewTargetForArrow() {
|
|||
// [stack]
|
||||
|
||||
if (bce_->sc->allowNewTarget()) {
|
||||
if (!bce_->emit1(JSOP_NEWTARGET)) {
|
||||
if (!bce_->emit1(JSOp::NewTarget)) {
|
||||
// [stack] NEW.TARGET
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!bce_->emit1(JSOP_NULL)) {
|
||||
if (!bce_->emit1(JSOp::Null)) {
|
||||
// [stack] NULL
|
||||
return false;
|
||||
}
|
||||
|
@ -513,12 +513,12 @@ bool FunctionScriptEmitter::emitAsyncFunctionRejectEpilogue() {
|
|||
// [stack] EXC GEN
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit2(JSOP_ASYNCRESOLVE,
|
||||
if (!bce_->emit2(JSOp::AsyncResolve,
|
||||
uint8_t(AsyncFunctionResolveKind::Reject))) {
|
||||
// [stack] PROMISE
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_SETRVAL)) {
|
||||
if (!bce_->emit1(JSOp::SetRval)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ bool FunctionScriptEmitter::emitAsyncFunctionRejectEpilogue() {
|
|||
// [stack] GEN
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emitYieldOp(JSOP_FINALYIELDRVAL)) {
|
||||
if (!bce_->emitYieldOp(JSOp::FinalYieldRval)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -594,7 +594,7 @@ bool FunctionScriptEmitter::emitExtraBodyVarScope() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ bool FunctionScriptEmitter::emitEndBody() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce_->emit1(JSOp::Undefined)) {
|
||||
// [stack] RESULT? UNDEF
|
||||
return false;
|
||||
}
|
||||
|
@ -636,14 +636,14 @@ bool FunctionScriptEmitter::emitEndBody() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit2(JSOP_ASYNCRESOLVE,
|
||||
if (!bce_->emit2(JSOp::AsyncResolve,
|
||||
uint8_t(AsyncFunctionResolveKind::Fulfill))) {
|
||||
// [stack] PROMISE
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_SETRVAL)) {
|
||||
if (!bce_->emit1(JSOp::SetRval)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -654,7 +654,7 @@ bool FunctionScriptEmitter::emitEndBody() {
|
|||
}
|
||||
|
||||
// No need to check for finally blocks, etc as in EmitReturn.
|
||||
if (!bce_->emitYieldOp(JSOP_FINALYIELDRVAL)) {
|
||||
if (!bce_->emitYieldOp(JSOp::FinalYieldRval)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -665,11 +665,11 @@ bool FunctionScriptEmitter::emitEndBody() {
|
|||
// value in the return value slot. Make sure the return value
|
||||
// is |undefined|.
|
||||
if (bce_->hasTryFinally) {
|
||||
if (!bce_->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce_->emit1(JSOp::Undefined)) {
|
||||
// [stack] UNDEF
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_SETRVAL)) {
|
||||
if (!bce_->emit1(JSOp::SetRval)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -765,7 +765,7 @@ bool FunctionParamsEmitter::emitSimple(JS::Handle<JSAtom*> paramName) {
|
|||
// [stack]
|
||||
|
||||
if (funbox_->hasParameterExprs) {
|
||||
if (!bce_->emitArgOp(JSOP_GETARG, argSlot_)) {
|
||||
if (!bce_->emitArgOp(JSOp::GetArg, argSlot_)) {
|
||||
// [stack] ARG
|
||||
return false;
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ bool FunctionParamsEmitter::prepareForDestructuring() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emitArgOp(JSOP_GETARG, argSlot_)) {
|
||||
if (!bce_->emitArgOp(JSOp::GetArg, argSlot_)) {
|
||||
// [stack] ARG
|
||||
return false;
|
||||
}
|
||||
|
@ -850,7 +850,7 @@ bool FunctionParamsEmitter::emitDestructuringEnd() {
|
|||
|
||||
// [stack] ARG
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -907,7 +907,7 @@ bool FunctionParamsEmitter::emitDestructuringDefaultEnd() {
|
|||
|
||||
// [stack] ARG/DEFAULT
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -968,7 +968,7 @@ bool FunctionParamsEmitter::emitDestructuringRestEnd() {
|
|||
|
||||
// [stack] REST
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -1018,7 +1018,7 @@ bool FunctionParamsEmitter::prepareForInitializer() {
|
|||
// If we have an initializer, emit the initializer and assign it
|
||||
// to the argument slot. TDZ is taken care of afterwards.
|
||||
MOZ_ASSERT(funbox_->hasParameterExprs);
|
||||
if (!bce_->emitArgOp(JSOP_GETARG, argSlot_)) {
|
||||
if (!bce_->emitArgOp(JSOp::GetArg, argSlot_)) {
|
||||
// [stack] ARG
|
||||
return false;
|
||||
}
|
||||
|
@ -1044,7 +1044,7 @@ bool FunctionParamsEmitter::emitInitializerEnd() {
|
|||
bool FunctionParamsEmitter::emitRestArray() {
|
||||
// [stack]
|
||||
|
||||
if (!bce_->emit1(JSOP_REST)) {
|
||||
if (!bce_->emit1(JSOp::Rest)) {
|
||||
// [stack] REST
|
||||
return false;
|
||||
}
|
||||
|
@ -1074,7 +1074,7 @@ bool FunctionParamsEmitter::emitAssignment(JS::Handle<JSAtom*> paramName) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ bool BranchEmitterBase::emitThenInternal() {
|
|||
}
|
||||
|
||||
// Emit a branch-if-false around the then part.
|
||||
if (!bce_->emitJump(JSOP_IFEQ, &jumpAroundThen_)) {
|
||||
if (!bce_->emitJump(JSOp::IfEq, &jumpAroundThen_)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ bool BranchEmitterBase::emitElseInternal() {
|
|||
// Emit a jump from the end of our then part around the else part. The
|
||||
// patchJumpsToTarget call at the bottom of this function will fix up
|
||||
// the offset with jumpsAroundElse value.
|
||||
if (!bce_->emitJump(JSOP_GOTO, &jumpsAroundElse_)) {
|
||||
if (!bce_->emitJump(JSOp::Goto, &jumpsAroundElse_)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,37 +30,37 @@ bool NameOpEmitter::emitGet() {
|
|||
|
||||
switch (loc_.kind()) {
|
||||
case NameLocation::Kind::Dynamic:
|
||||
if (!bce_->emitAtomOp(JSOP_GETNAME, name_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetName, name_)) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case NameLocation::Kind::Global:
|
||||
if (!bce_->emitAtomOp(JSOP_GETGNAME, name_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetGName, name_)) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case NameLocation::Kind::Intrinsic:
|
||||
if (!bce_->emitAtomOp(JSOP_GETINTRINSIC, name_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetIntrinsic, name_)) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case NameLocation::Kind::NamedLambdaCallee:
|
||||
if (!bce_->emit1(JSOP_CALLEE)) {
|
||||
if (!bce_->emit1(JSOp::Callee)) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case NameLocation::Kind::Import:
|
||||
if (!bce_->emitAtomOp(JSOP_GETIMPORT, name_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetImport, name_)) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case NameLocation::Kind::ArgumentSlot:
|
||||
if (!bce_->emitArgOp(JSOP_GETARG, loc_.argumentSlot())) {
|
||||
if (!bce_->emitArgOp(JSOp::GetArg, loc_.argumentSlot())) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ bool NameOpEmitter::emitGet() {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
if (!bce_->emitLocalOp(JSOP_GETLOCAL, loc_.frameSlot())) {
|
||||
if (!bce_->emitLocalOp(JSOp::GetLocal, loc_.frameSlot())) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ bool NameOpEmitter::emitGet() {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
if (!bce_->emitEnvCoordOp(JSOP_GETALIASEDVAR,
|
||||
if (!bce_->emitEnvCoordOp(JSOp::GetAliasedVar,
|
||||
loc_.environmentCoordinate())) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
|
@ -97,8 +97,8 @@ bool NameOpEmitter::emitGet() {
|
|||
if (isCall()) {
|
||||
switch (loc_.kind()) {
|
||||
case NameLocation::Kind::Dynamic: {
|
||||
JSOp thisOp =
|
||||
bce_->needsImplicitThis() ? JSOP_IMPLICITTHIS : JSOP_GIMPLICITTHIS;
|
||||
JSOp thisOp = bce_->needsImplicitThis() ? JSOp::ImplicitThis
|
||||
: JSOp::GImplicitThis;
|
||||
if (!bce_->emitAtomOp(thisOp, name_)) {
|
||||
// [stack] CALLEE THIS
|
||||
return false;
|
||||
|
@ -106,7 +106,7 @@ bool NameOpEmitter::emitGet() {
|
|||
break;
|
||||
}
|
||||
case NameLocation::Kind::Global:
|
||||
if (!bce_->emitAtomOp(JSOP_GIMPLICITTHIS, name_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GImplicitThis, name_)) {
|
||||
// [stack] CALLEE THIS
|
||||
return false;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ bool NameOpEmitter::emitGet() {
|
|||
case NameLocation::Kind::ArgumentSlot:
|
||||
case NameLocation::Kind::FrameSlot:
|
||||
case NameLocation::Kind::EnvironmentCoordinate:
|
||||
if (!bce_->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce_->emit1(JSOp::Undefined)) {
|
||||
// [stack] CALLEE UNDEF
|
||||
return false;
|
||||
}
|
||||
|
@ -149,12 +149,12 @@ bool NameOpEmitter::prepareForRhs() {
|
|||
// Annex B vars always go on the nearest variable environment,
|
||||
// even if lexical environments in between contain same-named
|
||||
// bindings.
|
||||
if (!bce_->emit1(JSOP_BINDVAR)) {
|
||||
if (!bce_->emit1(JSOp::BindVar)) {
|
||||
// [stack] ENV
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!bce_->emitAtomOp(JSOP_BINDNAME, atomIndex_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::BindName, atomIndex_)) {
|
||||
// [stack] ENV
|
||||
return false;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ bool NameOpEmitter::prepareForRhs() {
|
|||
// need a BindGName.
|
||||
MOZ_ASSERT(bce_->innermostScope().is<GlobalScope>());
|
||||
} else {
|
||||
if (!bce_->emitAtomOp(JSOP_BINDGNAME, atomIndex_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::BindGName, atomIndex_)) {
|
||||
// [stack] ENV
|
||||
return false;
|
||||
}
|
||||
|
@ -212,11 +212,11 @@ bool NameOpEmitter::prepareForRhs() {
|
|||
//
|
||||
// GetBoundName uses the environment already pushed on the stack
|
||||
// from the earlier BindName.
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] ENV ENV
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emitAtomOp(JSOP_GETBOUNDNAME, name_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetBoundName, name_)) {
|
||||
// [stack] ENV V
|
||||
return false;
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ bool NameOpEmitter::emitAssignment() {
|
|||
case NameLocation::Kind::Dynamic:
|
||||
case NameLocation::Kind::Import:
|
||||
case NameLocation::Kind::DynamicAnnexBVar:
|
||||
if (!bce_->emitAtomOp(bce_->strictifySetNameOp(JSOP_SETNAME),
|
||||
if (!bce_->emitAtomOp(bce_->strictifySetNameOp(JSOp::SetName),
|
||||
atomIndex_)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -249,9 +249,9 @@ bool NameOpEmitter::emitAssignment() {
|
|||
case NameLocation::Kind::Global: {
|
||||
JSOp op;
|
||||
if (emittedBindOp_) {
|
||||
op = bce_->strictifySetNameOp(JSOP_SETGNAME);
|
||||
op = bce_->strictifySetNameOp(JSOp::SetGName);
|
||||
} else {
|
||||
op = JSOP_INITGLEXICAL;
|
||||
op = JSOp::InitGLexical;
|
||||
}
|
||||
if (!bce_->emitAtomOp(op, atomIndex_)) {
|
||||
return false;
|
||||
|
@ -259,7 +259,7 @@ bool NameOpEmitter::emitAssignment() {
|
|||
break;
|
||||
}
|
||||
case NameLocation::Kind::Intrinsic:
|
||||
if (!bce_->emitAtomOp(JSOP_SETINTRINSIC, name_)) {
|
||||
if (!bce_->emitAtomOp(JSOp::SetIntrinsic, name_)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
@ -267,24 +267,24 @@ bool NameOpEmitter::emitAssignment() {
|
|||
// Assigning to the named lambda is a no-op in sloppy mode but
|
||||
// throws in strict mode.
|
||||
if (bce_->sc->strict()) {
|
||||
if (!bce_->emit1(JSOP_THROWSETCALLEE)) {
|
||||
if (!bce_->emit1(JSOp::ThrowSetCallee)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NameLocation::Kind::ArgumentSlot:
|
||||
if (!bce_->emitArgOp(JSOP_SETARG, loc_.argumentSlot())) {
|
||||
if (!bce_->emitArgOp(JSOp::SetArg, loc_.argumentSlot())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case NameLocation::Kind::FrameSlot: {
|
||||
JSOp op = JSOP_SETLOCAL;
|
||||
JSOp op = JSOp::SetLocal;
|
||||
if (loc_.isLexical()) {
|
||||
if (isInitialize()) {
|
||||
op = JSOP_INITLEXICAL;
|
||||
op = JSOp::InitLexical;
|
||||
} else {
|
||||
if (loc_.isConst()) {
|
||||
op = JSOP_THROWSETCONST;
|
||||
op = JSOp::ThrowSetConst;
|
||||
}
|
||||
|
||||
if (!bce_->emitTDZCheckIfNeeded(name_, loc_)) {
|
||||
|
@ -295,7 +295,7 @@ bool NameOpEmitter::emitAssignment() {
|
|||
if (!bce_->emitLocalOp(op, loc_.frameSlot())) {
|
||||
return false;
|
||||
}
|
||||
if (op == JSOP_INITLEXICAL) {
|
||||
if (op == JSOp::InitLexical) {
|
||||
if (!bce_->innermostTDZCheckCache->noteTDZCheck(bce_, name_,
|
||||
DontCheckTDZ)) {
|
||||
return false;
|
||||
|
@ -304,13 +304,13 @@ bool NameOpEmitter::emitAssignment() {
|
|||
break;
|
||||
}
|
||||
case NameLocation::Kind::EnvironmentCoordinate: {
|
||||
JSOp op = JSOP_SETALIASEDVAR;
|
||||
JSOp op = JSOp::SetAliasedVar;
|
||||
if (loc_.isLexical()) {
|
||||
if (isInitialize()) {
|
||||
op = JSOP_INITALIASEDLEXICAL;
|
||||
op = JSOp::InitAliasedLexical;
|
||||
} else {
|
||||
if (loc_.isConst()) {
|
||||
op = JSOP_THROWSETALIASEDCONST;
|
||||
op = JSOp::ThrowSetAliasedConst;
|
||||
}
|
||||
|
||||
if (!bce_->emitTDZCheckIfNeeded(name_, loc_)) {
|
||||
|
@ -321,7 +321,7 @@ bool NameOpEmitter::emitAssignment() {
|
|||
if (loc_.bindingKind() == BindingKind::NamedLambdaCallee) {
|
||||
// Assigning to the named lambda is a no-op in sloppy mode and throws
|
||||
// in strict mode.
|
||||
op = JSOP_THROWSETALIASEDCONST;
|
||||
op = JSOp::ThrowSetAliasedConst;
|
||||
if (bce_->sc->strict()) {
|
||||
if (!bce_->emitEnvCoordOp(op, loc_.environmentCoordinate())) {
|
||||
return false;
|
||||
|
@ -332,7 +332,7 @@ bool NameOpEmitter::emitAssignment() {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
if (op == JSOP_INITALIASEDLEXICAL) {
|
||||
if (op == JSOp::InitAliasedLexical) {
|
||||
if (!bce_->innermostTDZCheckCache->noteTDZCheck(bce_, name_,
|
||||
DontCheckTDZ)) {
|
||||
return false;
|
||||
|
@ -351,17 +351,17 @@ bool NameOpEmitter::emitAssignment() {
|
|||
bool NameOpEmitter::emitIncDec() {
|
||||
MOZ_ASSERT(state_ == State::Start);
|
||||
|
||||
JSOp incOp = isInc() ? JSOP_INC : JSOP_DEC;
|
||||
JSOp incOp = isInc() ? JSOp::Inc : JSOp::Dec;
|
||||
if (!prepareForRhs()) {
|
||||
// [stack] ENV? V
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_TONUMERIC)) {
|
||||
if (!bce_->emit1(JSOp::ToNumeric)) {
|
||||
// [stack] ENV? N
|
||||
return false;
|
||||
}
|
||||
if (isPostIncDec()) {
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] ENV? N? N
|
||||
return false;
|
||||
}
|
||||
|
@ -371,11 +371,11 @@ bool NameOpEmitter::emitIncDec() {
|
|||
return false;
|
||||
}
|
||||
if (isPostIncDec() && emittedBindOp()) {
|
||||
if (!bce_->emit2(JSOP_PICK, 2)) {
|
||||
if (!bce_->emit2(JSOp::Pick, 2)) {
|
||||
// [stack] N? N+1 ENV?
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_SWAP)) {
|
||||
if (!bce_->emit1(JSOp::Swap)) {
|
||||
// [stack] N? ENV? N+1
|
||||
return false;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ bool NameOpEmitter::emitIncDec() {
|
|||
return false;
|
||||
}
|
||||
if (isPostIncDec()) {
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] N
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ bool PropertyEmitter::emitMutateProto() {
|
|||
|
||||
// [stack] OBJ PROTO
|
||||
|
||||
if (!bce_->emit1(JSOP_MUTATEPROTO)) {
|
||||
if (!bce_->emit1(JSOp::MutateProto)) {
|
||||
// [stack] OBJ
|
||||
return false;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ bool PropertyEmitter::prepareForSpreadOperand(
|
|||
return false;
|
||||
}
|
||||
}
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] OBJ OBJ
|
||||
return false;
|
||||
}
|
||||
|
@ -120,11 +120,11 @@ MOZ_ALWAYS_INLINE bool PropertyEmitter::prepareForProp(
|
|||
}
|
||||
|
||||
if (isStatic_) {
|
||||
if (!bce_->emit1(JSOP_DUP2)) {
|
||||
if (!bce_->emit1(JSOp::Dup2)) {
|
||||
// [stack] CTOR HOMEOBJ CTOR HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] CTOR HOMEOBJ CTOR
|
||||
return false;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ bool PropertyEmitter::prepareForComputedPropValue() {
|
|||
|
||||
// [stack] CTOR? OBJ CTOR? KEY
|
||||
|
||||
if (!bce_->emit1(JSOP_TOID)) {
|
||||
if (!bce_->emit1(JSOp::ToId)) {
|
||||
// [stack] CTOR? OBJ CTOR? KEY
|
||||
return false;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ bool PropertyEmitter::emitInitHomeObject() {
|
|||
// [stack] CTOR? HOMEOBJ KEY? FUN HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_INITHOMEOBJECT)) {
|
||||
if (!bce_->emit1(JSOp::InitHomeObject)) {
|
||||
// [stack] CTOR? HOMEOBJ CTOR? KEY? FUN
|
||||
return false;
|
||||
}
|
||||
|
@ -262,56 +262,56 @@ bool PropertyEmitter::emitInitHomeObject() {
|
|||
}
|
||||
|
||||
bool PropertyEmitter::emitInitProp(JS::Handle<JSAtom*> key) {
|
||||
return emitInit(isClass_ ? JSOP_INITHIDDENPROP : JSOP_INITPROP, key);
|
||||
return emitInit(isClass_ ? JSOp::InitHiddenProp : JSOp::InitProp, key);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitGetter(JS::Handle<JSAtom*> key) {
|
||||
return emitInit(isClass_ ? JSOP_INITHIDDENPROP_GETTER : JSOP_INITPROP_GETTER,
|
||||
return emitInit(isClass_ ? JSOp::InitHiddenPropGetter : JSOp::InitPropGetter,
|
||||
key);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitSetter(JS::Handle<JSAtom*> key) {
|
||||
return emitInit(isClass_ ? JSOP_INITHIDDENPROP_SETTER : JSOP_INITPROP_SETTER,
|
||||
return emitInit(isClass_ ? JSOp::InitHiddenPropSetter : JSOp::InitPropSetter,
|
||||
key);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitIndexProp() {
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOP_INITHIDDENELEM
|
||||
: JSOP_INITELEM);
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOp::InitHiddenElem
|
||||
: JSOp::InitElem);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitIndexGetter() {
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOP_INITHIDDENELEM_GETTER
|
||||
: JSOP_INITELEM_GETTER);
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOp::InitHiddenElemGetter
|
||||
: JSOp::InitElemGetter);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitIndexSetter() {
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOP_INITHIDDENELEM_SETTER
|
||||
: JSOP_INITELEM_SETTER);
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOp::InitHiddenElemSetter
|
||||
: JSOp::InitElemSetter);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitComputedProp() {
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOP_INITHIDDENELEM
|
||||
: JSOP_INITELEM);
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOp::InitHiddenElem
|
||||
: JSOp::InitElem);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitComputedGetter() {
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOP_INITHIDDENELEM_GETTER
|
||||
: JSOP_INITELEM_GETTER);
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOp::InitHiddenElemGetter
|
||||
: JSOp::InitElemGetter);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInitComputedSetter() {
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOP_INITHIDDENELEM_SETTER
|
||||
: JSOP_INITELEM_SETTER);
|
||||
return emitInitIndexOrComputed(isClass_ ? JSOp::InitHiddenElemSetter
|
||||
: JSOp::InitElemSetter);
|
||||
}
|
||||
|
||||
bool PropertyEmitter::emitInit(JSOp op, JS::Handle<JSAtom*> key) {
|
||||
MOZ_ASSERT(propertyState_ == PropertyState::PropValue ||
|
||||
propertyState_ == PropertyState::InitHomeObj);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_INITPROP || op == JSOP_INITHIDDENPROP ||
|
||||
op == JSOP_INITPROP_GETTER || op == JSOP_INITHIDDENPROP_GETTER ||
|
||||
op == JSOP_INITPROP_SETTER || op == JSOP_INITHIDDENPROP_SETTER);
|
||||
MOZ_ASSERT(op == JSOp::InitProp || op == JSOp::InitHiddenProp ||
|
||||
op == JSOp::InitPropGetter || op == JSOp::InitHiddenPropGetter ||
|
||||
op == JSOp::InitPropSetter || op == JSOp::InitHiddenPropSetter);
|
||||
|
||||
// [stack] CTOR? OBJ CTOR? VAL
|
||||
|
||||
|
@ -341,9 +341,9 @@ bool PropertyEmitter::emitInitIndexOrComputed(JSOp op) {
|
|||
propertyState_ == PropertyState::ComputedValue ||
|
||||
propertyState_ == PropertyState::InitHomeObjForComputed);
|
||||
|
||||
MOZ_ASSERT(op == JSOP_INITELEM || op == JSOP_INITHIDDENELEM ||
|
||||
op == JSOP_INITELEM_GETTER || op == JSOP_INITHIDDENELEM_GETTER ||
|
||||
op == JSOP_INITELEM_SETTER || op == JSOP_INITHIDDENELEM_SETTER);
|
||||
MOZ_ASSERT(op == JSOp::InitElem || op == JSOp::InitHiddenElem ||
|
||||
op == JSOp::InitElemGetter || op == JSOp::InitHiddenElemGetter ||
|
||||
op == JSOp::InitElemSetter || op == JSOp::InitHiddenElemSetter);
|
||||
|
||||
// [stack] CTOR? OBJ CTOR? KEY VAL
|
||||
|
||||
|
@ -366,7 +366,7 @@ bool PropertyEmitter::emitPopClassConstructor() {
|
|||
if (isStatic_) {
|
||||
// [stack] CTOR HOMEOBJ CTOR
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] CTOR HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
|
@ -507,21 +507,21 @@ bool ClassEmitter::emitDerivedClass(JS::Handle<JSAtom*> name,
|
|||
InternalIfEmitter ifThenElse(bce_);
|
||||
|
||||
// Heritage must be null or a non-generator constructor
|
||||
if (!bce_->emit1(JSOP_CHECKCLASSHERITAGE)) {
|
||||
if (!bce_->emit1(JSOp::CheckClassHeritage)) {
|
||||
// [stack] HERITAGE
|
||||
return false;
|
||||
}
|
||||
|
||||
// [IF] (heritage !== null)
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] HERITAGE HERITAGE
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_NULL)) {
|
||||
if (!bce_->emit1(JSOp::Null)) {
|
||||
// [stack] HERITAGE HERITAGE NULL
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_STRICTNE)) {
|
||||
if (!bce_->emit1(JSOp::StrictNe)) {
|
||||
// [stack] HERITAGE NE
|
||||
return false;
|
||||
}
|
||||
|
@ -530,11 +530,11 @@ bool ClassEmitter::emitDerivedClass(JS::Handle<JSAtom*> name,
|
|||
if (!ifThenElse.emitThenElse()) {
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] HERITAGE HERITAGE
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emitAtomOp(JSOP_GETPROP, bce_->cx->names().prototype)) {
|
||||
if (!bce_->emitAtomOp(JSOp::GetProp, bce_->cx->names().prototype)) {
|
||||
// [stack] HERITAGE PROTO
|
||||
return false;
|
||||
}
|
||||
|
@ -543,15 +543,15 @@ bool ClassEmitter::emitDerivedClass(JS::Handle<JSAtom*> name,
|
|||
if (!ifThenElse.emitElse()) {
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit2(JSOP_BUILTINPROTO, JSProto_Function)) {
|
||||
if (!bce_->emit2(JSOp::BuiltinProto, JSProto_Function)) {
|
||||
// [stack] PROTO
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_NULL)) {
|
||||
if (!bce_->emit1(JSOp::Null)) {
|
||||
// [stack] PROTO NULL
|
||||
return false;
|
||||
}
|
||||
|
@ -561,11 +561,11 @@ bool ClassEmitter::emitDerivedClass(JS::Handle<JSAtom*> name,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_OBJWITHPROTO)) {
|
||||
if (!bce_->emit1(JSOp::ObjWithProto)) {
|
||||
// [stack] HERITAGE HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_SWAP)) {
|
||||
if (!bce_->emit1(JSOp::Swap)) {
|
||||
// [stack] HOMEOBJ HERITAGE
|
||||
return false;
|
||||
}
|
||||
|
@ -588,7 +588,7 @@ bool ClassEmitter::emitInitConstructor(bool needsHomeObject) {
|
|||
// [stack] HOMEOBJ CTOR HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_INITHOMEOBJECT)) {
|
||||
if (!bce_->emit1(JSOp::InitHomeObject)) {
|
||||
// [stack] HOMEOBJ CTOR
|
||||
return false;
|
||||
}
|
||||
|
@ -632,13 +632,13 @@ bool ClassEmitter::emitInitDefaultConstructor(uint32_t classStart,
|
|||
BytecodeOffset off;
|
||||
if (isDerived_) {
|
||||
// [stack] HERITAGE PROTO
|
||||
if (!bce_->emitN(JSOP_DERIVEDCONSTRUCTOR, 12, &off)) {
|
||||
if (!bce_->emitN(JSOp::DerivedConstructor, 12, &off)) {
|
||||
// [stack] HOMEOBJ CTOR
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// [stack] HOMEOBJ
|
||||
if (!bce_->emitN(JSOP_CLASSCONSTRUCTOR, 12, &off)) {
|
||||
if (!bce_->emitN(JSOp::ClassConstructor, 12, &off)) {
|
||||
// [stack] HOMEOBJ CTOR
|
||||
return false;
|
||||
}
|
||||
|
@ -665,25 +665,25 @@ bool ClassEmitter::initProtoAndCtor() {
|
|||
// [stack] NAME HOMEOBJ CTOR NAME
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit2(JSOP_SETFUNNAME, uint8_t(FunctionPrefixKind::None))) {
|
||||
if (!bce_->emit2(JSOp::SetFunName, uint8_t(FunctionPrefixKind::None))) {
|
||||
// [stack] NAME HOMEOBJ CTOR
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_SWAP)) {
|
||||
if (!bce_->emit1(JSOp::Swap)) {
|
||||
// [stack] NAME? CTOR HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_DUP2)) {
|
||||
if (!bce_->emit1(JSOp::Dup2)) {
|
||||
// [stack] NAME? CTOR HOMEOBJ CTOR HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emitAtomOp(JSOP_INITLOCKEDPROP, bce_->cx->names().prototype)) {
|
||||
if (!bce_->emitAtomOp(JSOp::InitLockedProp, bce_->cx->names().prototype)) {
|
||||
// [stack] NAME? CTOR HOMEOBJ CTOR
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emitAtomOp(JSOP_INITHIDDENPROP, bce_->cx->names().constructor)) {
|
||||
if (!bce_->emitAtomOp(JSOp::InitHiddenProp, bce_->cx->names().constructor)) {
|
||||
// [stack] NAME? CTOR HOMEOBJ
|
||||
return false;
|
||||
}
|
||||
|
@ -704,7 +704,7 @@ bool ClassEmitter::prepareForFieldInitializers(size_t numFields) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!bce_->emitUint32Operand(JSOP_NEWARRAY, numFields)) {
|
||||
if (!bce_->emitUint32Operand(JSOp::NewArray, numFields)) {
|
||||
// [stack] HOMEOBJ HERITAGE? ARRAY
|
||||
return false;
|
||||
}
|
||||
|
@ -725,7 +725,7 @@ bool ClassEmitter::emitFieldInitializerHomeObject() {
|
|||
// [stack] OBJ HERITAGE? ARRAY METHOD OBJ
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_INITHOMEOBJECT)) {
|
||||
if (!bce_->emit1(JSOp::InitHomeObject)) {
|
||||
// [stack] OBJ HERITAGE? ARRAY METHOD
|
||||
return false;
|
||||
}
|
||||
|
@ -742,7 +742,7 @@ bool ClassEmitter::emitStoreFieldInitializer() {
|
|||
MOZ_ASSERT(fieldIndex_ < numFields_);
|
||||
// [stack] HOMEOBJ HERITAGE? ARRAY METHOD
|
||||
|
||||
if (!bce_->emitUint32Operand(JSOP_INITELEM_ARRAY, fieldIndex_)) {
|
||||
if (!bce_->emitUint32Operand(JSOp::InitElemArray, fieldIndex_)) {
|
||||
// [stack] HOMEOBJ HERITAGE? ARRAY
|
||||
return false;
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ bool ClassEmitter::emitFieldInitializersEnd() {
|
|||
}
|
||||
initializersAssignment_.reset();
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] HOMEOBJ HERITAGE?
|
||||
return false;
|
||||
}
|
||||
|
@ -785,7 +785,7 @@ bool ClassEmitter::emitEnd(Kind kind) {
|
|||
classState_ == ClassState::FieldInitializersEnd);
|
||||
// [stack] CTOR HOMEOBJ
|
||||
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] CTOR
|
||||
return false;
|
||||
}
|
||||
|
@ -811,7 +811,7 @@ bool ClassEmitter::emitEnd(Kind kind) {
|
|||
}
|
||||
// Only class statements make outer bindings, and they do not leave
|
||||
// themselves on the stack.
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -9324,18 +9324,18 @@ typename ParseHandler::Node GeneralParser<ParseHandler, Unit>::memberExpr(
|
|||
return null();
|
||||
}
|
||||
|
||||
JSOp op = JSOP_CALL;
|
||||
JSOp op = JSOp::Call;
|
||||
bool maybeAsyncArrow = false;
|
||||
if (PropertyName* prop = handler_.maybeDottedProperty(lhs)) {
|
||||
// Use the JSOp::Fun{Apply,Call} optimizations given the right
|
||||
// syntax.
|
||||
if (prop == cx_->names().apply) {
|
||||
op = JSOP_FUNAPPLY;
|
||||
op = JSOp::FunApply;
|
||||
if (pc_->isFunctionBox()) {
|
||||
pc_->functionBox()->usesApply = true;
|
||||
}
|
||||
} else if (prop == cx_->names().call) {
|
||||
op = JSOP_FUNCALL;
|
||||
op = JSOp::FunCall;
|
||||
}
|
||||
} else if (tt == TokenKind::LeftParen) {
|
||||
if (handler_.isAsyncKeyword(lhs, cx_)) {
|
||||
|
@ -9349,7 +9349,7 @@ typename ParseHandler::Node GeneralParser<ParseHandler, Unit>::memberExpr(
|
|||
} else if (handler_.isEvalName(lhs, cx_)) {
|
||||
// Select the right Eval op and flag pc_ as having a
|
||||
// direct eval.
|
||||
op = pc_->sc()->strict() ? JSOP_STRICTEVAL : JSOP_EVAL;
|
||||
op = pc_->sc()->strict() ? JSOp::StrictEval : JSOp::Eval;
|
||||
pc_->sc()->setBindingsAccessedDynamically();
|
||||
pc_->sc()->setHasDirectEval();
|
||||
|
||||
|
@ -9377,12 +9377,12 @@ typename ParseHandler::Node GeneralParser<ParseHandler, Unit>::memberExpr(
|
|||
return null();
|
||||
}
|
||||
if (isSpread) {
|
||||
if (op == JSOP_EVAL) {
|
||||
op = JSOP_SPREADEVAL;
|
||||
} else if (op == JSOP_STRICTEVAL) {
|
||||
op = JSOP_STRICTSPREADEVAL;
|
||||
if (op == JSOp::Eval) {
|
||||
op = JSOp::SpreadEval;
|
||||
} else if (op == JSOp::StrictEval) {
|
||||
op = JSOp::StrictSpreadEval;
|
||||
} else {
|
||||
op = JSOP_SPREADCALL;
|
||||
op = JSOp::SpreadCall;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ bool PropOpEmitter::emitGet(JSAtom* prop) {
|
|||
return false;
|
||||
}
|
||||
if (isCall()) {
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] # if Super
|
||||
// [stack] THIS THIS
|
||||
// [stack] # otherwise
|
||||
|
@ -58,12 +58,12 @@ bool PropOpEmitter::emitGet(JSAtom* prop) {
|
|||
}
|
||||
if (isIncDec() || isCompoundAssignment()) {
|
||||
if (isSuper()) {
|
||||
if (!bce_->emit1(JSOP_DUP2)) {
|
||||
if (!bce_->emit1(JSOp::Dup2)) {
|
||||
// [stack] THIS SUPERBASE THIS SUPERBASE
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] OBJ OBJ
|
||||
return false;
|
||||
}
|
||||
|
@ -72,11 +72,11 @@ bool PropOpEmitter::emitGet(JSAtom* prop) {
|
|||
|
||||
JSOp op;
|
||||
if (isSuper()) {
|
||||
op = JSOP_GETPROP_SUPER;
|
||||
op = JSOp::GetPropSuper;
|
||||
} else if (isCall()) {
|
||||
op = JSOP_CALLPROP;
|
||||
op = JSOp::CallProp;
|
||||
} else {
|
||||
op = isLength_ ? JSOP_LENGTH : JSOP_GETPROP;
|
||||
op = isLength_ ? JSOp::Length : JSOp::GetProp;
|
||||
}
|
||||
if (!bce_->emitAtomOp(op, propAtomIndex_, ShouldInstrument::Yes)) {
|
||||
// [stack] # if Get
|
||||
|
@ -90,7 +90,7 @@ bool PropOpEmitter::emitGet(JSAtom* prop) {
|
|||
return false;
|
||||
}
|
||||
if (isCall()) {
|
||||
if (!bce_->emit1(JSOP_SWAP)) {
|
||||
if (!bce_->emit1(JSOp::Swap)) {
|
||||
// [stack] PROP THIS
|
||||
return false;
|
||||
}
|
||||
|
@ -148,19 +148,19 @@ bool PropOpEmitter::emitDelete(JSAtom* prop) {
|
|||
}
|
||||
|
||||
// Unconditionally throw when attempting to delete a super-reference.
|
||||
if (!bce_->emitUint16Operand(JSOP_THROWMSG, JSMSG_CANT_DELETE_SUPER)) {
|
||||
if (!bce_->emitUint16Operand(JSOp::ThrowMsg, JSMSG_CANT_DELETE_SUPER)) {
|
||||
// [stack] THIS SUPERBASE
|
||||
return false;
|
||||
}
|
||||
|
||||
// Another wrinkle: Balance the stack from the emitter's point of view.
|
||||
// Execution will not reach here, as the last bytecode threw.
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] THIS
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
JSOp op = bce_->sc->strict() ? JSOP_STRICTDELPROP : JSOP_DELPROP;
|
||||
JSOp op = bce_->sc->strict() ? JSOp::StrictDelProp : JSOp::DelProp;
|
||||
if (!bce_->emitAtomOp(op, propAtomIndex_)) {
|
||||
// [stack] SUCCEEDED
|
||||
return false;
|
||||
|
@ -184,12 +184,12 @@ bool PropOpEmitter::emitAssignment(JSAtom* prop) {
|
|||
}
|
||||
|
||||
MOZ_ASSERT_IF(isPropInit(), !isSuper());
|
||||
JSOp setOp =
|
||||
isPropInit()
|
||||
? JSOP_INITPROP
|
||||
: isSuper() ? bce_->sc->strict() ? JSOP_STRICTSETPROP_SUPER
|
||||
: JSOP_SETPROP_SUPER
|
||||
: bce_->sc->strict() ? JSOP_STRICTSETPROP : JSOP_SETPROP;
|
||||
JSOp setOp = isPropInit()
|
||||
? JSOp::InitProp
|
||||
: isSuper() ? bce_->sc->strict() ? JSOp::StrictSetPropSuper
|
||||
: JSOp::SetPropSuper
|
||||
: bce_->sc->strict() ? JSOp::StrictSetProp
|
||||
: JSOp::SetProp;
|
||||
if (!bce_->emitAtomOp(setOp, propAtomIndex_, ShouldInstrument::Yes)) {
|
||||
// [stack] VAL
|
||||
return false;
|
||||
|
@ -211,19 +211,19 @@ bool PropOpEmitter::emitIncDec(JSAtom* prop) {
|
|||
|
||||
MOZ_ASSERT(state_ == State::Get);
|
||||
|
||||
JSOp incOp = isInc() ? JSOP_INC : JSOP_DEC;
|
||||
JSOp incOp = isInc() ? JSOp::Inc : JSOp::Dec;
|
||||
|
||||
if (!bce_->emit1(JSOP_TONUMERIC)) {
|
||||
if (!bce_->emit1(JSOp::ToNumeric)) {
|
||||
// [stack] ... N
|
||||
return false;
|
||||
}
|
||||
if (isPostIncDec()) {
|
||||
// [stack] OBJ SUPERBASE? N
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
// [stack] .. N N
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit2(JSOP_UNPICK, 2 + isSuper())) {
|
||||
if (!bce_->emit2(JSOp::Unpick, 2 + isSuper())) {
|
||||
// [stack] N OBJ SUPERBASE? N
|
||||
return false;
|
||||
}
|
||||
|
@ -235,14 +235,14 @@ bool PropOpEmitter::emitIncDec(JSAtom* prop) {
|
|||
|
||||
JSOp setOp =
|
||||
isSuper()
|
||||
? bce_->sc->strict() ? JSOP_STRICTSETPROP_SUPER : JSOP_SETPROP_SUPER
|
||||
: bce_->sc->strict() ? JSOP_STRICTSETPROP : JSOP_SETPROP;
|
||||
? bce_->sc->strict() ? JSOp::StrictSetPropSuper : JSOp::SetPropSuper
|
||||
: bce_->sc->strict() ? JSOp::StrictSetProp : JSOp::SetProp;
|
||||
if (!bce_->emitAtomOp(setOp, propAtomIndex_, ShouldInstrument::Yes)) {
|
||||
// [stack] N? N+1
|
||||
return false;
|
||||
}
|
||||
if (isPostIncDec()) {
|
||||
if (!bce_->emit1(JSOP_POP)) {
|
||||
if (!bce_->emit1(JSOp::Pop)) {
|
||||
// [stack] N
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ bool SwitchEmitter::emitTable(const TableGenerator& tableGen) {
|
|||
}
|
||||
|
||||
MOZ_ASSERT(top_ == bce_->bytecodeSection().offset());
|
||||
if (!bce_->emitN(JSOP_TABLESWITCH,
|
||||
if (!bce_->emitN(JSOp::TableSwitch,
|
||||
JSOpLength_TableSwitch - sizeof(jsbytecode))) {
|
||||
return false;
|
||||
}
|
||||
|
@ -205,14 +205,14 @@ bool SwitchEmitter::emitCaseOrDefaultJump(uint32_t caseIndex, bool isDefault) {
|
|||
MOZ_ASSERT(kind_ == Kind::Cond);
|
||||
|
||||
if (isDefault) {
|
||||
if (!bce_->emitJump(JSOP_DEFAULT, &condSwitchDefaultOffset_)) {
|
||||
if (!bce_->emitJump(JSOp::Default, &condSwitchDefaultOffset_)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
JumpList caseJump;
|
||||
if (!bce_->emitJump(JSOP_CASE, &caseJump)) {
|
||||
if (!bce_->emitJump(JSOp::Case, &caseJump)) {
|
||||
return false;
|
||||
}
|
||||
caseOffsets_[caseIndex] = caseJump.offset;
|
||||
|
@ -225,7 +225,7 @@ bool SwitchEmitter::prepareForCaseValue() {
|
|||
MOZ_ASSERT(kind_ == Kind::Cond);
|
||||
MOZ_ASSERT(state_ == State::Cond || state_ == State::Case);
|
||||
|
||||
if (!bce_->emit1(JSOP_DUP)) {
|
||||
if (!bce_->emit1(JSOp::Dup)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ bool SwitchEmitter::emitCaseJump() {
|
|||
MOZ_ASSERT(kind_ == Kind::Cond);
|
||||
MOZ_ASSERT(state_ == State::CaseValue);
|
||||
|
||||
if (!bce_->emit1(JSOP_STRICTEQ)) {
|
||||
if (!bce_->emit1(JSOp::StrictEq)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ bool TryEmitter::emitTry() {
|
|||
// uses this depth to properly unwind the stack and the scope chain.
|
||||
depth_ = bce_->bytecodeSection().stackDepth();
|
||||
|
||||
if (!bce_->emitN(JSOP_TRY, 4, &tryOpOffset_)) {
|
||||
if (!bce_->emitN(JSOp::Try, 4, &tryOpOffset_)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -72,11 +72,11 @@ 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(JSOp(*trypc) == JSOp::Try);
|
||||
SET_CODE_OFFSET(trypc, offset.value());
|
||||
|
||||
// Emit jump over catch and/or finally.
|
||||
if (!bce_->emitJump(JSOP_GOTO, &catchAndFinallyJump_)) {
|
||||
if (!bce_->emitJump(JSOp::Goto, &catchAndFinallyJump_)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -100,15 +100,15 @@ bool TryEmitter::emitCatch() {
|
|||
// try block:
|
||||
//
|
||||
// eval("try { 1; throw 2 } catch(e) {}"); // undefined, not 1
|
||||
if (!bce_->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce_->emit1(JSOp::Undefined)) {
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_SETRVAL)) {
|
||||
if (!bce_->emit1(JSOp::SetRval)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_EXCEPTION)) {
|
||||
if (!bce_->emit1(JSOp::Exception)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ bool TryEmitter::emitCatchEnd() {
|
|||
MOZ_ASSERT(bce_->bytecodeSection().stackDepth() == depth_);
|
||||
|
||||
// Jump over the finally block.
|
||||
if (!bce_->emitJump(JSOP_GOTO, &catchAndFinallyJump_)) {
|
||||
if (!bce_->emitJump(JSOp::Goto, &catchAndFinallyJump_)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -192,12 +192,12 @@ bool TryEmitter::emitFinally(
|
|||
return false;
|
||||
}
|
||||
}
|
||||
if (!bce_->emit1(JSOP_FINALLY)) {
|
||||
if (!bce_->emit1(JSOp::Finally)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (controlKind_ == ControlKind::Syntactic) {
|
||||
if (!bce_->emit1(JSOP_GETRVAL)) {
|
||||
if (!bce_->emit1(JSOp::GetRval)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -205,10 +205,10 @@ bool TryEmitter::emitFinally(
|
|||
// correct value even if there's no other statement before them:
|
||||
//
|
||||
// eval("x: try { 1 } finally { break x; }"); // undefined, not 1
|
||||
if (!bce_->emit1(JSOP_UNDEFINED)) {
|
||||
if (!bce_->emit1(JSOp::Undefined)) {
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit1(JSOP_SETRVAL)) {
|
||||
if (!bce_->emit1(JSOp::SetRval)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -227,12 +227,12 @@ bool TryEmitter::emitFinallyEnd() {
|
|||
MOZ_ASSERT(state_ == State::Finally);
|
||||
|
||||
if (controlKind_ == ControlKind::Syntactic) {
|
||||
if (!bce_->emit1(JSOP_SETRVAL)) {
|
||||
if (!bce_->emit1(JSOp::SetRval)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bce_->emit1(JSOP_RETSUB)) {
|
||||
if (!bce_->emit1(JSOp::Retsub)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ bool WhileEmitter::emitCond(const Maybe<uint32_t>& whilePos,
|
|||
return false;
|
||||
}
|
||||
// Emit a Nop to ensure the source position is not part of the loop.
|
||||
if (!bce_->emit1(JSOP_NOP)) {
|
||||
if (!bce_->emit1(JSOp::Nop)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ bool WhileEmitter::emitCond(const Maybe<uint32_t>& whilePos,
|
|||
bool WhileEmitter::emitBody() {
|
||||
MOZ_ASSERT(state_ == State::Cond);
|
||||
|
||||
if (!bce_->emitJump(JSOP_IFEQ, &loopInfo_->breaks)) {
|
||||
if (!bce_->emitJump(JSOp::IfEq, &loopInfo_->breaks)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ bool WhileEmitter::emitEnd() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOP_GOTO, JSTRY_LOOP)) {
|
||||
if (!loopInfo_->emitLoopEnd(bce_, JSOp::Goto, JSTRY_LOOP)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ FRAGMENT(Interpreter, Regs) {
|
|||
JS::Value slot1;
|
||||
JS::Value slot2;
|
||||
} fakeFrame;
|
||||
uint8_t fakeOpcode = uint8_t(JSOP_TRUE);
|
||||
uint8_t fakeOpcode = uint8_t(JSOp::True);
|
||||
|
||||
js::InterpreterRegs regs;
|
||||
js::GDBTestInitInterpreterRegs(regs, &fakeFrame.frame, &fakeFrame.slot2,
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "vm/BytecodeUtil.h"
|
||||
|
||||
FRAGMENT(jsop, simple) {
|
||||
JSOp undefined = JSOP_UNDEFINED;
|
||||
JSOp debugger = JSOP_DEBUGGER;
|
||||
JSOp undefined = JSOp::Undefined;
|
||||
JSOp debugger = JSOp::Debugger;
|
||||
|
||||
breakpoint();
|
||||
|
||||
|
|
|
@ -444,14 +444,14 @@ static inline jsbytecode* GetNextNonLoopHeadPc(jsbytecode* pc,
|
|||
jsbytecode** skippedLoopHead) {
|
||||
JSOp op = JSOp(*pc);
|
||||
switch (op) {
|
||||
case JSOP_GOTO:
|
||||
case JSOp::Goto:
|
||||
return pc + GET_JUMP_OFFSET(pc);
|
||||
|
||||
case JSOP_LOOPHEAD:
|
||||
case JSOp::LoopHead:
|
||||
*skippedLoopHead = pc;
|
||||
return GetNextPc(pc);
|
||||
|
||||
case JSOP_NOP:
|
||||
case JSOp::Nop:
|
||||
return GetNextPc(pc);
|
||||
|
||||
default:
|
||||
|
@ -895,12 +895,12 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
|
|||
uint32_t pushedSlots = 0;
|
||||
RootedValueVector savedCallerArgs(cx);
|
||||
bool needToSaveArgs =
|
||||
op == JSOP_FUNAPPLY || IsIonInlinableGetterOrSetterOp(op);
|
||||
if (iter.moreFrames() && (op == JSOP_FUNCALL || needToSaveArgs)) {
|
||||
op == JSOp::FunApply || IsIonInlinableGetterOrSetterOp(op);
|
||||
if (iter.moreFrames() && (op == JSOp::FunCall || needToSaveArgs)) {
|
||||
uint32_t inlined_args = 0;
|
||||
if (op == JSOP_FUNCALL) {
|
||||
if (op == JSOp::FunCall) {
|
||||
inlined_args = 2 + GET_ARGC(pc) - 1;
|
||||
} else if (op == JSOP_FUNAPPLY) {
|
||||
} else if (op == JSOp::FunApply) {
|
||||
inlined_args = 2 + blFrame->numActualArgs();
|
||||
} else {
|
||||
MOZ_ASSERT(IsIonInlinableGetterOrSetterOp(op));
|
||||
|
@ -920,7 +920,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
|
|||
}
|
||||
}
|
||||
|
||||
if (op == JSOP_FUNCALL) {
|
||||
if (op == JSOp::FunCall) {
|
||||
// When funcall got inlined and the native js_fun_call was bypassed,
|
||||
// the stack state is incorrect. To restore correctly it must look like
|
||||
// js_fun_call was actually called. This means transforming the stack
|
||||
|
@ -945,7 +945,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
|
|||
// to |js_fun_apply, target, this, argObject|.
|
||||
// Since the information is never read, we can just push undefined
|
||||
// for all values.
|
||||
if (op == JSOP_FUNAPPLY) {
|
||||
if (op == JSOp::FunApply) {
|
||||
JitSpew(JitSpew_BaselineBailouts,
|
||||
" pushing 4x undefined to fixup funapply");
|
||||
if (!builder.writeValue(UndefinedValue(), "StackValue")) {
|
||||
|
@ -1050,8 +1050,8 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
|
|||
}
|
||||
|
||||
if (reachablePC) {
|
||||
if (op != JSOP_FUNAPPLY || !iter.moreFrames() || resumeAfter) {
|
||||
if (op == JSOP_FUNCALL) {
|
||||
if (op != JSOp::FunApply || !iter.moreFrames() || resumeAfter) {
|
||||
if (op == JSOp::FunCall) {
|
||||
// For fun.call(this, ...); the reconstructStackDepth will
|
||||
// include the this. When inlining that is not included.
|
||||
// So the exprStackSlots will be one less.
|
||||
|
@ -1222,7 +1222,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
|
|||
if (needToSaveArgs) {
|
||||
// For FunApply or an accessor, the arguments are not on the stack anymore,
|
||||
// but they are copied in a vector and are written here.
|
||||
if (op == JSOP_FUNAPPLY) {
|
||||
if (op == JSOp::FunApply) {
|
||||
actualArgc = blFrame->numActualArgs();
|
||||
} else {
|
||||
actualArgc = IsSetPropOp(op);
|
||||
|
@ -1248,7 +1248,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
|
|||
}
|
||||
} else {
|
||||
actualArgc = GET_ARGC(pc);
|
||||
if (op == JSOP_FUNCALL) {
|
||||
if (op == JSOp::FunCall) {
|
||||
MOZ_ASSERT(actualArgc > 0);
|
||||
actualArgc--;
|
||||
}
|
||||
|
|
|
@ -768,7 +768,7 @@ bool BaselineCacheIRCompiler::emitCompareStringResult() {
|
|||
// Push the operands in reverse order for JSOp::Le and JSOp::Gt:
|
||||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
if (op == JSOP_LE || op == JSOP_GT) {
|
||||
if (op == JSOp::Le || op == JSOp::Gt) {
|
||||
masm.Push(left);
|
||||
masm.Push(right);
|
||||
} else {
|
||||
|
@ -777,14 +777,14 @@ bool BaselineCacheIRCompiler::emitCompareStringResult() {
|
|||
}
|
||||
|
||||
using Fn = bool (*)(JSContext*, HandleString, HandleString, bool*);
|
||||
if (op == JSOP_EQ || op == JSOP_STRICTEQ) {
|
||||
if (op == JSOp::Eq || op == JSOp::StrictEq) {
|
||||
callVM<Fn, jit::StringsEqual<EqualityKind::Equal>>(masm);
|
||||
} else if (op == JSOP_NE || op == JSOP_STRICTNE) {
|
||||
} else if (op == JSOp::Ne || op == JSOp::StrictNe) {
|
||||
callVM<Fn, jit::StringsEqual<EqualityKind::NotEqual>>(masm);
|
||||
} else if (op == JSOP_LT || op == JSOP_GT) {
|
||||
} else if (op == JSOp::Lt || op == JSOp::Gt) {
|
||||
callVM<Fn, jit::StringsCompare<ComparisonKind::LessThan>>(masm);
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_LE || op == JSOP_GE);
|
||||
MOZ_ASSERT(op == JSOp::Le || op == JSOp::Ge);
|
||||
callVM<Fn, jit::StringsCompare<ComparisonKind::GreaterThanOrEqual>>(masm);
|
||||
}
|
||||
|
||||
|
|
|
@ -1276,7 +1276,7 @@ bool BaselineCompilerCodeGen::emitWarmUpCounterIncrement() {
|
|||
// if --ion-eager is used.
|
||||
JSScript* script = handler.script();
|
||||
jsbytecode* pc = handler.pc();
|
||||
if (JSOp(*pc) == JSOP_LOOPHEAD) {
|
||||
if (JSOp(*pc) == JSOp::LoopHead) {
|
||||
uint32_t pcOffset = script->pcToOffset(pc);
|
||||
uint32_t nativeOffset = masm.currentOffset();
|
||||
if (!handler.osrEntries().emplaceBack(pcOffset, nativeOffset)) {
|
||||
|
@ -1303,7 +1303,7 @@ bool BaselineCompilerCodeGen::emitWarmUpCounterIncrement() {
|
|||
masm.add32(Imm32(1), countReg);
|
||||
masm.store32(countReg, warmUpCounterAddr);
|
||||
|
||||
if (JSOp(*pc) == JSOP_LOOPHEAD) {
|
||||
if (JSOp(*pc) == JSOp::LoopHead) {
|
||||
// If this is a loop inside a catch or finally block, increment the warmup
|
||||
// counter but don't attempt OSR (Ion only compiles the try block).
|
||||
if (handler.analysis().info(pc).loopHeadInCatchOrFinally) {
|
||||
|
@ -1327,7 +1327,7 @@ bool BaselineCompilerCodeGen::emitWarmUpCounterIncrement() {
|
|||
&done);
|
||||
|
||||
// Try to compile and/or finish a compilation.
|
||||
if (JSOp(*pc) == JSOP_LOOPHEAD) {
|
||||
if (JSOp(*pc) == JSOp::LoopHead) {
|
||||
// Try to OSR into Ion.
|
||||
computeFrameSize(R0.scratchReg());
|
||||
|
||||
|
@ -1870,7 +1870,7 @@ bool BaselineCompilerCodeGen::emit_Unpick() {
|
|||
masm.loadValue(frame.addressOfStackValue(-1), R0);
|
||||
|
||||
MOZ_ASSERT(GET_INT8(handler.pc()) > 0,
|
||||
"Interpreter code assumes JSOP_UNPICK operand > 0");
|
||||
"Interpreter code assumes JSOp::Unpick operand > 0");
|
||||
|
||||
// Move the other values up.
|
||||
int32_t depth = -(GET_INT8(handler.pc()) + 1);
|
||||
|
@ -1911,7 +1911,7 @@ bool BaselineInterpreterCodeGen::emit_Unpick() {
|
|||
{
|
||||
Label ok;
|
||||
masm.branch32(Assembler::GreaterThan, scratch, Imm32(0), &ok);
|
||||
masm.assumeUnreachable("JSOP_UNPICK with operand <= 0?");
|
||||
masm.assumeUnreachable("JSOp::Unpick with operand <= 0?");
|
||||
masm.bind(&ok);
|
||||
}
|
||||
#endif
|
||||
|
@ -3415,7 +3415,7 @@ bool BaselineCodeGen<Handler>::emit_BindGName() {
|
|||
if (tryOptimizeBindGlobalName()) {
|
||||
return true;
|
||||
}
|
||||
return emitBindName(JSOP_BINDGNAME);
|
||||
return emitBindName(JSOp::BindGName);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
|
@ -3848,12 +3848,12 @@ bool BaselineCodeGen<Handler>::emitBindName(JSOp op) {
|
|||
return true;
|
||||
};
|
||||
|
||||
if (op == JSOP_BINDNAME) {
|
||||
if (op == JSOp::BindName) {
|
||||
if (!loadFrameEnv()) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_BINDGNAME);
|
||||
MOZ_ASSERT(op == JSOp::BindGName);
|
||||
if (!emitTestScriptFlag(JSScript::ImmutableFlags::HasNonSyntacticScope,
|
||||
loadFrameEnv, loadGlobalLexical, R2.scratchReg())) {
|
||||
return false;
|
||||
|
@ -3872,7 +3872,7 @@ bool BaselineCodeGen<Handler>::emitBindName(JSOp op) {
|
|||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_BindName() {
|
||||
return emitBindName(JSOP_BINDNAME);
|
||||
return emitBindName(JSOp::BindName);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
|
@ -4014,7 +4014,7 @@ bool BaselineCodeGen<Handler>::emit_DefVar() {
|
|||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emitDefLexical(JSOp op) {
|
||||
MOZ_ASSERT(op == JSOP_DEFCONST || op == JSOP_DEFLET);
|
||||
MOZ_ASSERT(op == JSOp::DefConst || op == JSOp::DefLet);
|
||||
|
||||
frame.syncStack(0);
|
||||
|
||||
|
@ -4032,12 +4032,12 @@ bool BaselineCodeGen<Handler>::emitDefLexical(JSOp op) {
|
|||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_DefConst() {
|
||||
return emitDefLexical(JSOP_DEFCONST);
|
||||
return emitDefLexical(JSOp::DefConst);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_DefLet() {
|
||||
return emitDefLexical(JSOP_DEFLET);
|
||||
return emitDefLexical(JSOp::DefLet);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
|
@ -4224,14 +4224,14 @@ bool BaselineInterpreterCodeGen::emit_SetLocal() {
|
|||
|
||||
template <>
|
||||
bool BaselineCompilerCodeGen::emitFormalArgAccess(JSOp op) {
|
||||
MOZ_ASSERT(op == JSOP_GETARG || op == JSOP_SETARG);
|
||||
MOZ_ASSERT(op == JSOp::GetArg || op == JSOp::SetArg);
|
||||
|
||||
uint32_t arg = GET_ARGNO(handler.pc());
|
||||
|
||||
// Fast path: the script does not use |arguments| or formals don't
|
||||
// alias the arguments object.
|
||||
if (!handler.script()->argumentsAliasesFormals()) {
|
||||
if (op == JSOP_GETARG) {
|
||||
if (op == JSOp::GetArg) {
|
||||
frame.pushArg(arg);
|
||||
} else {
|
||||
// See the comment in emit_SetLocal.
|
||||
|
@ -4253,7 +4253,7 @@ bool BaselineCompilerCodeGen::emitFormalArgAccess(JSOp op) {
|
|||
Label hasArgsObj;
|
||||
masm.branchTest32(Assembler::NonZero, frame.addressOfFlags(),
|
||||
Imm32(BaselineFrame::HAS_ARGS_OBJ), &hasArgsObj);
|
||||
if (op == JSOP_GETARG) {
|
||||
if (op == JSOp::GetArg) {
|
||||
masm.loadValue(frame.addressOfArg(arg), R0);
|
||||
} else {
|
||||
frame.storeStackValue(-1, frame.addressOfArg(arg), R0);
|
||||
|
@ -4269,7 +4269,7 @@ bool BaselineCompilerCodeGen::emitFormalArgAccess(JSOp op) {
|
|||
|
||||
// Load/store the argument.
|
||||
Address argAddr(reg, ArgumentsData::offsetOfArgs() + arg * sizeof(Value));
|
||||
if (op == JSOP_GETARG) {
|
||||
if (op == JSOp::GetArg) {
|
||||
masm.loadValue(argAddr, R0);
|
||||
frame.push(R0);
|
||||
} else {
|
||||
|
@ -4300,7 +4300,7 @@ bool BaselineCompilerCodeGen::emitFormalArgAccess(JSOp op) {
|
|||
|
||||
template <>
|
||||
bool BaselineInterpreterCodeGen::emitFormalArgAccess(JSOp op) {
|
||||
MOZ_ASSERT(op == JSOP_GETARG || op == JSOP_SETARG);
|
||||
MOZ_ASSERT(op == JSOp::GetArg || op == JSOp::SetArg);
|
||||
|
||||
// Load the index.
|
||||
Register argReg = R1.scratchReg();
|
||||
|
@ -4326,7 +4326,7 @@ bool BaselineInterpreterCodeGen::emitFormalArgAccess(JSOp op) {
|
|||
|
||||
// Load/store the argument.
|
||||
BaseValueIndex argAddr(reg, argReg, ArgumentsData::offsetOfArgs());
|
||||
if (op == JSOP_GETARG) {
|
||||
if (op == JSOp::GetArg) {
|
||||
masm.loadValue(argAddr, R0);
|
||||
frame.push(R0);
|
||||
} else {
|
||||
|
@ -4350,7 +4350,7 @@ bool BaselineInterpreterCodeGen::emitFormalArgAccess(JSOp op) {
|
|||
{
|
||||
BaseValueIndex addr(BaselineFrameReg, argReg,
|
||||
BaselineFrame::offsetOfArg(0));
|
||||
if (op == JSOP_GETARG) {
|
||||
if (op == JSOp::GetArg) {
|
||||
masm.loadValue(addr, R0);
|
||||
frame.push(R0);
|
||||
} else {
|
||||
|
@ -4365,12 +4365,12 @@ bool BaselineInterpreterCodeGen::emitFormalArgAccess(JSOp op) {
|
|||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_GetArg() {
|
||||
return emitFormalArgAccess(JSOP_GETARG);
|
||||
return emitFormalArgAccess(JSOp::GetArg);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_SetArg() {
|
||||
return emitFormalArgAccess(JSOP_SETARG);
|
||||
return emitFormalArgAccess(JSOp::SetArg);
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@ -4623,7 +4623,7 @@ bool BaselineCodeGen<Handler>::emitSpreadCall(JSOp op) {
|
|||
}
|
||||
|
||||
// Update FrameInfo.
|
||||
bool construct = op == JSOP_SPREADNEW || op == JSOP_SPREADSUPERCALL;
|
||||
bool construct = op == JSOp::SpreadNew || op == JSOp::SpreadSuperCall;
|
||||
frame.popn(3 + construct);
|
||||
frame.push(R0);
|
||||
return true;
|
||||
|
@ -4631,72 +4631,72 @@ bool BaselineCodeGen<Handler>::emitSpreadCall(JSOp op) {
|
|||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_Call() {
|
||||
return emitCall(JSOP_CALL);
|
||||
return emitCall(JSOp::Call);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_CallIgnoresRv() {
|
||||
return emitCall(JSOP_CALL_IGNORES_RV);
|
||||
return emitCall(JSOp::CallIgnoresRv);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_CallIter() {
|
||||
return emitCall(JSOP_CALLITER);
|
||||
return emitCall(JSOp::CallIter);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_New() {
|
||||
return emitCall(JSOP_NEW);
|
||||
return emitCall(JSOp::New);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_SuperCall() {
|
||||
return emitCall(JSOP_SUPERCALL);
|
||||
return emitCall(JSOp::SuperCall);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_FunCall() {
|
||||
return emitCall(JSOP_FUNCALL);
|
||||
return emitCall(JSOp::FunCall);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_FunApply() {
|
||||
return emitCall(JSOP_FUNAPPLY);
|
||||
return emitCall(JSOp::FunApply);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_Eval() {
|
||||
return emitCall(JSOP_EVAL);
|
||||
return emitCall(JSOp::Eval);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_StrictEval() {
|
||||
return emitCall(JSOP_STRICTEVAL);
|
||||
return emitCall(JSOp::StrictEval);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_SpreadCall() {
|
||||
return emitSpreadCall(JSOP_SPREADCALL);
|
||||
return emitSpreadCall(JSOp::SpreadCall);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_SpreadNew() {
|
||||
return emitSpreadCall(JSOP_SPREADNEW);
|
||||
return emitSpreadCall(JSOp::SpreadNew);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_SpreadSuperCall() {
|
||||
return emitSpreadCall(JSOP_SPREADSUPERCALL);
|
||||
return emitSpreadCall(JSOp::SpreadSuperCall);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_SpreadEval() {
|
||||
return emitSpreadCall(JSOP_SPREADEVAL);
|
||||
return emitSpreadCall(JSOp::SpreadEval);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
bool BaselineCodeGen<Handler>::emit_StrictSpreadEval() {
|
||||
return emitSpreadCall(JSOP_STRICTSPREADEVAL);
|
||||
return emitSpreadCall(JSOp::StrictSpreadEval);
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
|
@ -6690,12 +6690,12 @@ bool BaselineInterpreterCodeGen::emit_InstrumentationScriptId() {
|
|||
template <>
|
||||
bool BaselineCompilerCodeGen::emit_ForceInterpreter() {
|
||||
// Caller is responsible for checking script->hasForceInterpreterOp().
|
||||
MOZ_CRASH("JSOP_FORCEINTERPRETER in baseline");
|
||||
MOZ_CRASH("JSOp::ForceInterpreter in baseline");
|
||||
}
|
||||
|
||||
template <>
|
||||
bool BaselineInterpreterCodeGen::emit_ForceInterpreter() {
|
||||
masm.assumeUnreachable("JSOP_FORCEINTERPRETER");
|
||||
masm.assumeUnreachable("JSOp::ForceInterpreter");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -6887,7 +6887,7 @@ MethodStatus BaselineCompiler::emitBody() {
|
|||
#endif
|
||||
}
|
||||
|
||||
MOZ_ASSERT(JSOp(*prevpc) == JSOP_RETRVAL);
|
||||
MOZ_ASSERT(JSOp(*prevpc) == JSOp::RetRval);
|
||||
return Method_Compiled;
|
||||
}
|
||||
|
||||
|
|
|
@ -257,60 +257,60 @@ bool JitScript::initICEntriesAndBytecodeTypeMap(JSContext* cx,
|
|||
}
|
||||
|
||||
switch (op) {
|
||||
case JSOP_NOT:
|
||||
case JSOP_AND:
|
||||
case JSOP_OR:
|
||||
case JSOP_IFEQ:
|
||||
case JSOP_IFNE: {
|
||||
case JSOp::Not:
|
||||
case JSOp::And:
|
||||
case JSOp::Or:
|
||||
case JSOp::IfEq:
|
||||
case JSOp::IfNe: {
|
||||
ICStub* stub = alloc.newStub<ICToBool_Fallback>(Kind::ToBool);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_BITNOT:
|
||||
case JSOP_NEG:
|
||||
case JSOP_INC:
|
||||
case JSOP_DEC: {
|
||||
case JSOp::BitNot:
|
||||
case JSOp::Neg:
|
||||
case JSOp::Inc:
|
||||
case JSOp::Dec: {
|
||||
ICStub* stub = alloc.newStub<ICUnaryArith_Fallback>(Kind::UnaryArith);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_BITOR:
|
||||
case JSOP_BITXOR:
|
||||
case JSOP_BITAND:
|
||||
case JSOP_LSH:
|
||||
case JSOP_RSH:
|
||||
case JSOP_URSH:
|
||||
case JSOP_ADD:
|
||||
case JSOP_SUB:
|
||||
case JSOP_MUL:
|
||||
case JSOP_DIV:
|
||||
case JSOP_MOD:
|
||||
case JSOP_POW: {
|
||||
case JSOp::BitOr:
|
||||
case JSOp::BitXor:
|
||||
case JSOp::BitAnd:
|
||||
case JSOp::Lsh:
|
||||
case JSOp::Rsh:
|
||||
case JSOp::Ursh:
|
||||
case JSOp::Add:
|
||||
case JSOp::Sub:
|
||||
case JSOp::Mul:
|
||||
case JSOp::Div:
|
||||
case JSOp::Mod:
|
||||
case JSOp::Pow: {
|
||||
ICStub* stub = alloc.newStub<ICBinaryArith_Fallback>(Kind::BinaryArith);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_EQ:
|
||||
case JSOP_NE:
|
||||
case JSOP_LT:
|
||||
case JSOP_LE:
|
||||
case JSOP_GT:
|
||||
case JSOP_GE:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOP_STRICTNE: {
|
||||
case JSOp::Eq:
|
||||
case JSOp::Ne:
|
||||
case JSOp::Lt:
|
||||
case JSOp::Le:
|
||||
case JSOp::Gt:
|
||||
case JSOp::Ge:
|
||||
case JSOp::StrictEq:
|
||||
case JSOp::StrictNe: {
|
||||
ICStub* stub = alloc.newStub<ICCompare_Fallback>(Kind::Compare);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_NEWARRAY: {
|
||||
case JSOp::NewArray: {
|
||||
ObjectGroup* group = ObjectGroup::allocationSiteGroup(
|
||||
cx, script, loc.toRawBytecode(), JSProto_Array);
|
||||
if (!group) {
|
||||
|
@ -323,107 +323,107 @@ bool JitScript::initICEntriesAndBytecodeTypeMap(JSContext* cx,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_NEWOBJECT:
|
||||
case JSOP_NEWOBJECT_WITHGROUP:
|
||||
case JSOP_NEWINIT: {
|
||||
case JSOp::NewObject:
|
||||
case JSOp::NewObjectWithGroup:
|
||||
case JSOp::NewInit: {
|
||||
ICStub* stub = alloc.newStub<ICNewObject_Fallback>(Kind::NewObject);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_INITELEM:
|
||||
case JSOP_INITHIDDENELEM:
|
||||
case JSOP_INITELEM_ARRAY:
|
||||
case JSOP_INITELEM_INC:
|
||||
case JSOP_SETELEM:
|
||||
case JSOP_STRICTSETELEM: {
|
||||
case JSOp::InitElem:
|
||||
case JSOp::InitHiddenElem:
|
||||
case JSOp::InitElemArray:
|
||||
case JSOp::InitElemInc:
|
||||
case JSOp::SetElem:
|
||||
case JSOp::StrictSetElem: {
|
||||
ICStub* stub = alloc.newStub<ICSetElem_Fallback>(Kind::SetElem);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_INITPROP:
|
||||
case JSOP_INITLOCKEDPROP:
|
||||
case JSOP_INITHIDDENPROP:
|
||||
case JSOP_INITGLEXICAL:
|
||||
case JSOP_SETPROP:
|
||||
case JSOP_STRICTSETPROP:
|
||||
case JSOP_SETNAME:
|
||||
case JSOP_STRICTSETNAME:
|
||||
case JSOP_SETGNAME:
|
||||
case JSOP_STRICTSETGNAME: {
|
||||
case JSOp::InitProp:
|
||||
case JSOp::InitLockedProp:
|
||||
case JSOp::InitHiddenProp:
|
||||
case JSOp::InitGLexical:
|
||||
case JSOp::SetProp:
|
||||
case JSOp::StrictSetProp:
|
||||
case JSOp::SetName:
|
||||
case JSOp::StrictSetName:
|
||||
case JSOp::SetGName:
|
||||
case JSOp::StrictSetGName: {
|
||||
ICStub* stub = alloc.newStub<ICSetProp_Fallback>(Kind::SetProp);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_GETPROP:
|
||||
case JSOP_CALLPROP:
|
||||
case JSOP_LENGTH:
|
||||
case JSOP_GETBOUNDNAME: {
|
||||
case JSOp::GetProp:
|
||||
case JSOp::CallProp:
|
||||
case JSOp::Length:
|
||||
case JSOp::GetBoundName: {
|
||||
ICStub* stub = alloc.newStub<ICGetProp_Fallback>(Kind::GetProp);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_GETPROP_SUPER: {
|
||||
case JSOp::GetPropSuper: {
|
||||
ICStub* stub = alloc.newStub<ICGetProp_Fallback>(Kind::GetPropSuper);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_GETELEM:
|
||||
case JSOP_CALLELEM: {
|
||||
case JSOp::GetElem:
|
||||
case JSOp::CallElem: {
|
||||
ICStub* stub = alloc.newStub<ICGetElem_Fallback>(Kind::GetElem);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_GETELEM_SUPER: {
|
||||
case JSOp::GetElemSuper: {
|
||||
ICStub* stub = alloc.newStub<ICGetElem_Fallback>(Kind::GetElemSuper);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_IN: {
|
||||
case JSOp::In: {
|
||||
ICStub* stub = alloc.newStub<ICIn_Fallback>(Kind::In);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_HASOWN: {
|
||||
case JSOp::HasOwn: {
|
||||
ICStub* stub = alloc.newStub<ICHasOwn_Fallback>(Kind::HasOwn);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_GETNAME:
|
||||
case JSOP_GETGNAME: {
|
||||
case JSOp::GetName:
|
||||
case JSOp::GetGName: {
|
||||
ICStub* stub = alloc.newStub<ICGetName_Fallback>(Kind::GetName);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_BINDNAME:
|
||||
case JSOP_BINDGNAME: {
|
||||
case JSOp::BindName:
|
||||
case JSOp::BindGName: {
|
||||
ICStub* stub = alloc.newStub<ICBindName_Fallback>(Kind::BindName);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_GETALIASEDVAR:
|
||||
case JSOP_GETIMPORT: {
|
||||
case JSOp::GetAliasedVar:
|
||||
case JSOp::GetImport: {
|
||||
ICStub* stub =
|
||||
alloc.newStub<ICTypeMonitor_Fallback>(Kind::TypeMonitor, nullptr);
|
||||
if (!addIC(loc, stub)) {
|
||||
|
@ -431,7 +431,7 @@ bool JitScript::initICEntriesAndBytecodeTypeMap(JSContext* cx,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_GETINTRINSIC: {
|
||||
case JSOp::GetIntrinsic: {
|
||||
ICStub* stub =
|
||||
alloc.newStub<ICGetIntrinsic_Fallback>(Kind::GetIntrinsic);
|
||||
if (!addIC(loc, stub)) {
|
||||
|
@ -439,38 +439,38 @@ bool JitScript::initICEntriesAndBytecodeTypeMap(JSContext* cx,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_CALL:
|
||||
case JSOP_CALL_IGNORES_RV:
|
||||
case JSOP_CALLITER:
|
||||
case JSOP_FUNCALL:
|
||||
case JSOP_FUNAPPLY:
|
||||
case JSOP_EVAL:
|
||||
case JSOP_STRICTEVAL: {
|
||||
case JSOp::Call:
|
||||
case JSOp::CallIgnoresRv:
|
||||
case JSOp::CallIter:
|
||||
case JSOp::FunCall:
|
||||
case JSOp::FunApply:
|
||||
case JSOp::Eval:
|
||||
case JSOp::StrictEval: {
|
||||
ICStub* stub = alloc.newStub<ICCall_Fallback>(Kind::Call);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_SUPERCALL:
|
||||
case JSOP_NEW: {
|
||||
case JSOp::SuperCall:
|
||||
case JSOp::New: {
|
||||
ICStub* stub = alloc.newStub<ICCall_Fallback>(Kind::CallConstructing);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_SPREADCALL:
|
||||
case JSOP_SPREADEVAL:
|
||||
case JSOP_STRICTSPREADEVAL: {
|
||||
case JSOp::SpreadCall:
|
||||
case JSOp::SpreadEval:
|
||||
case JSOp::StrictSpreadEval: {
|
||||
ICStub* stub = alloc.newStub<ICCall_Fallback>(Kind::SpreadCall);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_SPREADSUPERCALL:
|
||||
case JSOP_SPREADNEW: {
|
||||
case JSOp::SpreadSuperCall:
|
||||
case JSOp::SpreadNew: {
|
||||
ICStub* stub =
|
||||
alloc.newStub<ICCall_Fallback>(Kind::SpreadCallConstructing);
|
||||
if (!addIC(loc, stub)) {
|
||||
|
@ -478,29 +478,29 @@ bool JitScript::initICEntriesAndBytecodeTypeMap(JSContext* cx,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_INSTANCEOF: {
|
||||
case JSOp::Instanceof: {
|
||||
ICStub* stub = alloc.newStub<ICInstanceOf_Fallback>(Kind::InstanceOf);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_TYPEOF:
|
||||
case JSOP_TYPEOFEXPR: {
|
||||
case JSOp::Typeof:
|
||||
case JSOp::TypeofExpr: {
|
||||
ICStub* stub = alloc.newStub<ICTypeOf_Fallback>(Kind::TypeOf);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_ITER: {
|
||||
case JSOp::Iter: {
|
||||
ICStub* stub = alloc.newStub<ICGetIterator_Fallback>(Kind::GetIterator);
|
||||
if (!addIC(loc, stub)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_REST: {
|
||||
case JSOp::Rest: {
|
||||
ArrayObject* templateObject = ObjectGroup::newArrayObject(
|
||||
cx, nullptr, 0, TenuredObject,
|
||||
ObjectGroup::NewArrayKind::UnknownIndex);
|
||||
|
@ -1828,7 +1828,7 @@ bool DoGetElemFallback(JSContext* cx, BaselineFrame* frame,
|
|||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetElem(%s)", CodeName(op));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM);
|
||||
MOZ_ASSERT(op == JSOp::GetElem || op == JSOp::CallElem);
|
||||
|
||||
// Don't pass lhs directly, we need it when generating stubs.
|
||||
RootedValue lhsCopy(cx, lhs);
|
||||
|
@ -1894,7 +1894,7 @@ bool DoGetElemSuperFallback(JSContext* cx, BaselineFrame* frame,
|
|||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetElemSuper(%s)", CodeName(op));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETELEM_SUPER);
|
||||
MOZ_ASSERT(op == JSOp::GetElemSuper);
|
||||
|
||||
bool attached =
|
||||
TryAttachGetPropStub("GetElemSuper", cx, frame, stub,
|
||||
|
@ -2036,9 +2036,9 @@ bool DoSetElemFallback(JSContext* cx, BaselineFrame* frame,
|
|||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "SetElem(%s)", CodeName(JSOp(*pc)));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_SETELEM || op == JSOP_STRICTSETELEM ||
|
||||
op == JSOP_INITELEM || op == JSOP_INITHIDDENELEM ||
|
||||
op == JSOP_INITELEM_ARRAY || op == JSOP_INITELEM_INC);
|
||||
MOZ_ASSERT(op == JSOp::SetElem || op == JSOp::StrictSetElem ||
|
||||
op == JSOp::InitElem || op == JSOp::InitHiddenElem ||
|
||||
op == JSOp::InitElemArray || op == JSOp::InitElemInc);
|
||||
|
||||
RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, objv, index));
|
||||
if (!obj) {
|
||||
|
@ -2094,33 +2094,33 @@ bool DoSetElemFallback(JSContext* cx, BaselineFrame* frame,
|
|||
}
|
||||
}
|
||||
|
||||
if (op == JSOP_INITELEM || op == JSOP_INITHIDDENELEM) {
|
||||
if (op == JSOp::InitElem || op == JSOp::InitHiddenElem) {
|
||||
if (!InitElemOperation(cx, pc, obj, index, rhs)) {
|
||||
return false;
|
||||
}
|
||||
} else if (op == JSOP_INITELEM_ARRAY) {
|
||||
} else if (op == JSOp::InitElemArray) {
|
||||
MOZ_ASSERT(uint32_t(index.toInt32()) <= INT32_MAX,
|
||||
"the bytecode emitter must fail to compile code that would "
|
||||
"produce JSOP_INITELEM_ARRAY with an index exceeding "
|
||||
"produce JSOp::InitElemArray with an index exceeding "
|
||||
"int32_t range");
|
||||
MOZ_ASSERT(uint32_t(index.toInt32()) == GET_UINT32(pc));
|
||||
if (!InitArrayElemOperation(cx, pc, obj, index.toInt32(), rhs)) {
|
||||
return false;
|
||||
}
|
||||
} else if (op == JSOP_INITELEM_INC) {
|
||||
} else if (op == JSOp::InitElemInc) {
|
||||
if (!InitArrayElemOperation(cx, pc, obj, index.toInt32(), rhs)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!SetObjectElement(cx, obj, index, rhs, objv,
|
||||
JSOp(*pc) == JSOP_STRICTSETELEM, script, pc)) {
|
||||
JSOp(*pc) == JSOp::StrictSetElem, script, pc)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't try to attach stubs that wish to be hidden. We don't know how to
|
||||
// have different enumerability in the stubs for the moment.
|
||||
if (op == JSOP_INITHIDDENELEM) {
|
||||
if (op == JSOp::InitHiddenElem) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2320,7 +2320,7 @@ bool DoGetNameFallback(JSContext* cx, BaselineFrame* frame,
|
|||
mozilla::DebugOnly<JSOp> op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetName(%s)", CodeName(JSOp(*pc)));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETNAME || op == JSOP_GETGNAME);
|
||||
MOZ_ASSERT(op == JSOp::GetName || op == JSOp::GetGName);
|
||||
|
||||
RootedPropertyName name(cx, script->getName(pc));
|
||||
|
||||
|
@ -2329,8 +2329,8 @@ bool DoGetNameFallback(JSContext* cx, BaselineFrame* frame,
|
|||
envChain, name);
|
||||
|
||||
static_assert(JSOpLength_GetGName == JSOpLength_GetName,
|
||||
"Otherwise our check for JSOP_TYPEOF isn't ok");
|
||||
if (JSOp(pc[JSOpLength_GetGName]) == JSOP_TYPEOF) {
|
||||
"Otherwise our check for JSOp::Typeof isn't ok");
|
||||
if (JSOp(pc[JSOpLength_GetGName]) == JSOp::Typeof) {
|
||||
if (!GetEnvironmentName<GetNameMode::TypeOf>(cx, envChain, name, res)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -2370,7 +2370,7 @@ bool DoBindNameFallback(JSContext* cx, BaselineFrame* frame,
|
|||
mozilla::DebugOnly<JSOp> op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "BindName(%s)", CodeName(JSOp(*pc)));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_BINDNAME || op == JSOP_BINDGNAME);
|
||||
MOZ_ASSERT(op == JSOp::BindName || op == JSOp::BindGName);
|
||||
|
||||
RootedPropertyName name(cx, frame->script()->getName(pc));
|
||||
|
||||
|
@ -2415,7 +2415,7 @@ bool DoGetIntrinsicFallback(JSContext* cx, BaselineFrame* frame,
|
|||
mozilla::DebugOnly<JSOp> op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetIntrinsic(%s)", CodeName(JSOp(*pc)));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETINTRINSIC);
|
||||
MOZ_ASSERT(op == JSOp::GetIntrinsic);
|
||||
|
||||
if (!GetIntrinsicOperation(cx, script, pc, res)) {
|
||||
return false;
|
||||
|
@ -2455,7 +2455,7 @@ static bool ComputeGetPropResult(JSContext* cx, BaselineFrame* frame, JSOp op,
|
|||
// Handle arguments.length and arguments.callee on optimized arguments, as
|
||||
// it is not an object.
|
||||
if (val.isMagic(JS_OPTIMIZED_ARGUMENTS) && IsOptimizedArguments(frame, val)) {
|
||||
if (op == JSOP_LENGTH) {
|
||||
if (op == JSOp::Length) {
|
||||
res.setInt32(frame->numActualArgs());
|
||||
} else {
|
||||
MOZ_ASSERT(name == cx->names().callee);
|
||||
|
@ -2463,15 +2463,15 @@ static bool ComputeGetPropResult(JSContext* cx, BaselineFrame* frame, JSOp op,
|
|||
res.setObject(*frame->callee());
|
||||
}
|
||||
} else {
|
||||
if (op == JSOP_GETBOUNDNAME) {
|
||||
if (op == JSOp::GetBoundName) {
|
||||
RootedObject env(cx, &val.toObject());
|
||||
RootedId id(cx, NameToId(name));
|
||||
if (!GetNameBoundInEnvironment(cx, env, id, res)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_GETPROP || op == JSOP_CALLPROP ||
|
||||
op == JSOP_LENGTH);
|
||||
MOZ_ASSERT(op == JSOp::GetProp || op == JSOp::CallProp ||
|
||||
op == JSOp::Length);
|
||||
if (!GetProperty(cx, val, name, res)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -2491,8 +2491,8 @@ bool DoGetPropFallback(JSContext* cx, BaselineFrame* frame,
|
|||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "GetProp(%s)", CodeName(op));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_GETPROP || op == JSOP_CALLPROP || op == JSOP_LENGTH ||
|
||||
op == JSOP_GETBOUNDNAME);
|
||||
MOZ_ASSERT(op == JSOp::GetProp || op == JSOp::CallProp ||
|
||||
op == JSOp::Length || op == JSOp::GetBoundName);
|
||||
|
||||
RootedPropertyName name(cx, script->getName(pc));
|
||||
RootedValue idVal(cx, StringValue(name));
|
||||
|
@ -2516,7 +2516,7 @@ bool DoGetPropSuperFallback(JSContext* cx, BaselineFrame* frame,
|
|||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
FallbackICSpew(cx, stub, "GetPropSuper(%s)", CodeName(JSOp(*pc)));
|
||||
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_GETPROP_SUPER);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::GetPropSuper);
|
||||
|
||||
RootedPropertyName name(cx, script->getName(pc));
|
||||
RootedValue idVal(cx, StringValue(name));
|
||||
|
@ -2619,11 +2619,11 @@ bool DoSetPropFallback(JSContext* cx, BaselineFrame* frame,
|
|||
JSOp op = JSOp(*pc);
|
||||
FallbackICSpew(cx, stub, "SetProp(%s)", CodeName(op));
|
||||
|
||||
MOZ_ASSERT(op == JSOP_SETPROP || op == JSOP_STRICTSETPROP ||
|
||||
op == JSOP_SETNAME || op == JSOP_STRICTSETNAME ||
|
||||
op == JSOP_SETGNAME || op == JSOP_STRICTSETGNAME ||
|
||||
op == JSOP_INITPROP || op == JSOP_INITLOCKEDPROP ||
|
||||
op == JSOP_INITHIDDENPROP || op == JSOP_INITGLEXICAL);
|
||||
MOZ_ASSERT(op == JSOp::SetProp || op == JSOp::StrictSetProp ||
|
||||
op == JSOp::SetName || op == JSOp::StrictSetName ||
|
||||
op == JSOp::SetGName || op == JSOp::StrictSetGName ||
|
||||
op == JSOp::InitProp || op == JSOp::InitLockedProp ||
|
||||
op == JSOp::InitHiddenProp || op == JSOp::InitGLexical);
|
||||
|
||||
RootedPropertyName name(cx, script->getName(pc));
|
||||
RootedId id(cx, NameToId(name));
|
||||
|
@ -2677,17 +2677,17 @@ bool DoSetPropFallback(JSContext* cx, BaselineFrame* frame,
|
|||
}
|
||||
}
|
||||
|
||||
if (op == JSOP_INITPROP || op == JSOP_INITLOCKEDPROP ||
|
||||
op == JSOP_INITHIDDENPROP) {
|
||||
if (op == JSOp::InitProp || op == JSOp::InitLockedProp ||
|
||||
op == JSOp::InitHiddenProp) {
|
||||
if (!InitPropertyOperation(cx, op, obj, name, rhs)) {
|
||||
return false;
|
||||
}
|
||||
} else if (op == JSOP_SETNAME || op == JSOP_STRICTSETNAME ||
|
||||
op == JSOP_SETGNAME || op == JSOP_STRICTSETGNAME) {
|
||||
} else if (op == JSOp::SetName || op == JSOp::StrictSetName ||
|
||||
op == JSOp::SetGName || op == JSOp::StrictSetGName) {
|
||||
if (!SetNameOperation(cx, script, pc, obj, rhs)) {
|
||||
return false;
|
||||
}
|
||||
} else if (op == JSOP_INITGLEXICAL) {
|
||||
} else if (op == JSOp::InitGLexical) {
|
||||
RootedValue v(cx, rhs);
|
||||
LexicalEnvironmentObject* lexicalEnv;
|
||||
if (script->hasNonSyntacticScope()) {
|
||||
|
@ -2698,12 +2698,12 @@ bool DoSetPropFallback(JSContext* cx, BaselineFrame* frame,
|
|||
}
|
||||
InitGlobalLexicalOperation(cx, lexicalEnv, script, pc, v);
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_SETPROP || op == JSOP_STRICTSETPROP);
|
||||
MOZ_ASSERT(op == JSOp::SetProp || op == JSOp::StrictSetProp);
|
||||
|
||||
ObjectOpResult result;
|
||||
if (!SetProperty(cx, obj, id, rhs, lhs, result) ||
|
||||
!result.checkStrictErrorOrWarning(cx, obj, id,
|
||||
op == JSOP_STRICTSETPROP)) {
|
||||
op == JSOp::StrictSetProp)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2822,8 +2822,8 @@ bool DoCallFallback(JSContext* cx, BaselineFrame* frame, ICCall_Fallback* stub,
|
|||
FallbackICSpew(cx, stub, "Call(%s)", CodeName(op));
|
||||
|
||||
MOZ_ASSERT(argc == GET_ARGC(pc));
|
||||
bool constructing = (op == JSOP_NEW || op == JSOP_SUPERCALL);
|
||||
bool ignoresReturnValue = (op == JSOP_CALL_IGNORES_RV);
|
||||
bool constructing = (op == JSOp::New || op == JSOp::SuperCall);
|
||||
bool ignoresReturnValue = (op == JSOp::CallIgnoresRv);
|
||||
|
||||
// Ensure vp array is rooted - we may GC in here.
|
||||
size_t numValues = argc + 2 + constructing;
|
||||
|
@ -2835,7 +2835,7 @@ bool DoCallFallback(JSContext* cx, BaselineFrame* frame, ICCall_Fallback* stub,
|
|||
RootedValue newTarget(cx, constructing ? callArgs.newTarget() : NullValue());
|
||||
|
||||
// Handle funapply with JSOp::Arguments
|
||||
if (op == JSOP_FUNAPPLY && argc == 2 &&
|
||||
if (op == JSOp::FunApply && argc == 2 &&
|
||||
callArgs[1].isMagic(JS_OPTIMIZED_ARGUMENTS)) {
|
||||
if (!GuardFunApplyArgumentsOptimization(cx, frame, callArgs)) {
|
||||
return false;
|
||||
|
@ -2887,16 +2887,17 @@ bool DoCallFallback(JSContext* cx, BaselineFrame* frame, ICCall_Fallback* stub,
|
|||
return false;
|
||||
}
|
||||
res.set(callArgs.rval());
|
||||
} else if ((op == JSOP_EVAL || op == JSOP_STRICTEVAL) &&
|
||||
} else if ((op == JSOp::Eval || op == JSOp::StrictEval) &&
|
||||
cx->global()->valueIsEval(callee)) {
|
||||
if (!DirectEval(cx, callArgs.get(0), res)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_CALL || op == JSOP_CALL_IGNORES_RV ||
|
||||
op == JSOP_CALLITER || op == JSOP_FUNCALL ||
|
||||
op == JSOP_FUNAPPLY || op == JSOP_EVAL || op == JSOP_STRICTEVAL);
|
||||
if (op == JSOP_CALLITER && callee.isPrimitive()) {
|
||||
MOZ_ASSERT(op == JSOp::Call || op == JSOp::CallIgnoresRv ||
|
||||
op == JSOp::CallIter || op == JSOp::FunCall ||
|
||||
op == JSOp::FunApply || op == JSOp::Eval ||
|
||||
op == JSOp::StrictEval);
|
||||
if (op == JSOp::CallIter && callee.isPrimitive()) {
|
||||
MOZ_ASSERT(argc == 0, "thisv must be on top of the stack");
|
||||
ReportValueError(cx, JSMSG_NOT_ITERABLE, -1, callArgs.thisv(), nullptr);
|
||||
return false;
|
||||
|
@ -2961,7 +2962,7 @@ bool DoSpreadCallFallback(JSContext* cx, BaselineFrame* frame,
|
|||
RootedScript script(cx, frame->script());
|
||||
jsbytecode* pc = stub->icEntry()->pc(script);
|
||||
JSOp op = JSOp(*pc);
|
||||
bool constructing = (op == JSOP_SPREADNEW || op == JSOP_SPREADSUPERCALL);
|
||||
bool constructing = (op == JSOp::SpreadNew || op == JSOp::SpreadSuperCall);
|
||||
FallbackICSpew(cx, stub, "SpreadCall(%s)", CodeName(op));
|
||||
|
||||
// Ensure vp array is rooted - we may GC in here.
|
||||
|
@ -2979,7 +2980,7 @@ bool DoSpreadCallFallback(JSContext* cx, BaselineFrame* frame,
|
|||
|
||||
// Try attaching a call stub.
|
||||
bool handled = false;
|
||||
if (op != JSOP_SPREADEVAL && op != JSOP_STRICTSPREADEVAL &&
|
||||
if (op != JSOp::SpreadEval && op != JSOp::StrictSpreadEval &&
|
||||
stub->state().canAttachStub()) {
|
||||
// Try CacheIR first:
|
||||
RootedArrayObject aobj(cx, &arr.toObject().as<ArrayObject>());
|
||||
|
@ -3406,25 +3407,25 @@ bool DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame,
|
|||
// below.
|
||||
RootedValue valCopy(cx, val);
|
||||
switch (op) {
|
||||
case JSOP_BITNOT: {
|
||||
case JSOp::BitNot: {
|
||||
if (!BitNot(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_NEG: {
|
||||
case JSOp::Neg: {
|
||||
if (!NegOperation(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_INC: {
|
||||
case JSOp::Inc: {
|
||||
if (!IncOperation(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_DEC: {
|
||||
case JSOp::Dec: {
|
||||
if (!DecOperation(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -3487,68 +3488,68 @@ bool DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame,
|
|||
|
||||
// Perform the compare operation.
|
||||
switch (op) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
// Do an add.
|
||||
if (!AddValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
if (!SubValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
if (!MulValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
if (!DivValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_MOD:
|
||||
case JSOp::Mod:
|
||||
if (!ModValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_POW:
|
||||
case JSOp::Pow:
|
||||
if (!PowValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_BITOR: {
|
||||
case JSOp::BitOr: {
|
||||
if (!BitOr(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_BITXOR: {
|
||||
case JSOp::BitXor: {
|
||||
if (!BitXor(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_BITAND: {
|
||||
case JSOp::BitAnd: {
|
||||
if (!BitAnd(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_LSH: {
|
||||
case JSOp::Lsh: {
|
||||
if (!BitLsh(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_RSH: {
|
||||
case JSOp::Rsh: {
|
||||
if (!BitRsh(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_URSH: {
|
||||
case JSOp::Ursh: {
|
||||
if (!UrshOperation(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -3611,42 +3612,42 @@ bool DoCompareFallback(JSContext* cx, BaselineFrame* frame,
|
|||
// Perform the compare operation.
|
||||
bool out;
|
||||
switch (op) {
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
if (!LessThan(cx, &lhsCopy, &rhsCopy, &out)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
if (!LessThanOrEqual(cx, &lhsCopy, &rhsCopy, &out)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
if (!GreaterThan(cx, &lhsCopy, &rhsCopy, &out)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
if (!GreaterThanOrEqual(cx, &lhsCopy, &rhsCopy, &out)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_EQ:
|
||||
case JSOp::Eq:
|
||||
if (!LooselyEqual<EqualityKind::Equal>(cx, &lhsCopy, &rhsCopy, &out)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_NE:
|
||||
case JSOp::Ne:
|
||||
if (!LooselyEqual<EqualityKind::NotEqual>(cx, &lhsCopy, &rhsCopy, &out)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOp::StrictEq:
|
||||
if (!StrictlyEqual<EqualityKind::Equal>(cx, &lhsCopy, &rhsCopy, &out)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::StrictNe:
|
||||
if (!StrictlyEqual<EqualityKind::NotEqual>(cx, &lhsCopy, &rhsCopy,
|
||||
&out)) {
|
||||
return false;
|
||||
|
|
|
@ -582,7 +582,7 @@ MIRType BaselineInspector::expectedBinaryArithSpecialization(jsbytecode* pc) {
|
|||
MIRType result;
|
||||
ICStub* stubs[2];
|
||||
|
||||
if (JSOp(*pc) == JSOP_POS) {
|
||||
if (JSOp(*pc) == JSOp::Pos) {
|
||||
// +x expanding to x*1, but no corresponding IC.
|
||||
return MIRType::None;
|
||||
}
|
||||
|
@ -749,7 +749,7 @@ ObjectGroup* BaselineInspector::getTemplateObjectGroup(jsbytecode* pc) {
|
|||
}
|
||||
|
||||
JSFunction* BaselineInspector::getSingleCallee(jsbytecode* pc) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_NEW);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::New);
|
||||
|
||||
const ICEntry& entry = icEntryFromPC(pc);
|
||||
ICStub* stub = entry.firstStub();
|
||||
|
@ -1143,7 +1143,7 @@ bool BaselineInspector::commonGetPropFunction(
|
|||
jsbytecode* pc, jsid id, bool innerized, JSObject** holder,
|
||||
Shape** holderShape, JSFunction** commonGetter, Shape** globalShape,
|
||||
bool* isOwnProperty, ReceiverVector& receivers) {
|
||||
MOZ_ASSERT(IsGetPropPC(pc) || IsGetElemPC(pc) || JSOp(*pc) == JSOP_GETGNAME);
|
||||
MOZ_ASSERT(IsGetPropPC(pc) || IsGetElemPC(pc) || JSOp(*pc) == JSOp::GetGName);
|
||||
MOZ_ASSERT(receivers.empty());
|
||||
|
||||
// Only GetElem operations need to guard against a specific property id.
|
||||
|
@ -1222,9 +1222,9 @@ static JSFunction* GetMegamorphicGetterSetterFunction(
|
|||
bool BaselineInspector::megamorphicGetterSetterFunction(
|
||||
jsbytecode* pc, jsid id, bool isGetter, JSFunction** getterOrSetter) {
|
||||
MOZ_ASSERT(IsGetPropPC(pc) || IsGetElemPC(pc) || IsSetPropPC(pc) ||
|
||||
JSOp(*pc) == JSOP_GETGNAME || JSOp(*pc) == JSOP_INITGLEXICAL ||
|
||||
JSOp(*pc) == JSOP_INITPROP || JSOp(*pc) == JSOP_INITLOCKEDPROP ||
|
||||
JSOp(*pc) == JSOP_INITHIDDENPROP);
|
||||
JSOp(*pc) == JSOp::GetGName || JSOp(*pc) == JSOp::InitGLexical ||
|
||||
JSOp(*pc) == JSOp::InitProp || JSOp(*pc) == JSOp::InitLockedProp ||
|
||||
JSOp(*pc) == JSOp::InitHiddenProp);
|
||||
|
||||
// Only GetElem operations need to guard against a specific property id.
|
||||
if (!IsGetElemPC(pc)) {
|
||||
|
@ -1382,9 +1382,9 @@ bool BaselineInspector::commonSetPropFunction(jsbytecode* pc, JSObject** holder,
|
|||
JSFunction** commonSetter,
|
||||
bool* isOwnProperty,
|
||||
ReceiverVector& receivers) {
|
||||
MOZ_ASSERT(IsSetPropPC(pc) || JSOp(*pc) == JSOP_INITGLEXICAL ||
|
||||
JSOp(*pc) == JSOP_INITPROP || JSOp(*pc) == JSOP_INITLOCKEDPROP ||
|
||||
JSOp(*pc) == JSOP_INITHIDDENPROP);
|
||||
MOZ_ASSERT(IsSetPropPC(pc) || JSOp(*pc) == JSOp::InitGLexical ||
|
||||
JSOp(*pc) == JSOp::InitProp || JSOp(*pc) == JSOp::InitLockedProp ||
|
||||
JSOp(*pc) == JSOp::InitHiddenProp);
|
||||
MOZ_ASSERT(receivers.empty());
|
||||
|
||||
*commonSetter = nullptr;
|
||||
|
@ -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(JSOp(*pc) == JSOp::Instanceof);
|
||||
|
||||
const ICEntry& entry = icEntryFromPC(pc);
|
||||
ICStub* firstStub = entry.firstStub();
|
||||
|
|
|
@ -138,7 +138,7 @@ static JitExecStatus EnterBaseline(JSContext* cx, EnterJitData& data) {
|
|||
JitExecStatus jit::EnterBaselineInterpreterAtBranch(JSContext* cx,
|
||||
InterpreterFrame* fp,
|
||||
jsbytecode* pc) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::LoopHead);
|
||||
|
||||
EnterJitData data(cx);
|
||||
|
||||
|
@ -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() || JSOp(*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 (JSOp(*pc) == JSOp::LoopHead) {
|
||||
MOZ_ASSERT(pc > script->code(),
|
||||
"Prologue vs OSR cases must not be ambiguous");
|
||||
BaselineScript* baselineScript = script->baselineScript();
|
||||
|
|
|
@ -79,7 +79,7 @@ bool BytecodeAnalysis::init(TempAllocator& alloc) {
|
|||
MOZ_ASSERT(stackDepth <= BytecodeInfo::MAX_STACK_DEPTH);
|
||||
|
||||
switch (op) {
|
||||
case JSOP_TABLESWITCH: {
|
||||
case JSOp::TableSwitch: {
|
||||
uint32_t defaultOffset = it.getTableSwitchDefaultOffset(script_);
|
||||
int32_t low = it.getTableSwitchLow();
|
||||
int32_t high = it.getTableSwitchHigh();
|
||||
|
@ -99,7 +99,7 @@ bool BytecodeAnalysis::init(TempAllocator& alloc) {
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_TRY: {
|
||||
case JSOp::Try: {
|
||||
for (const JSTryNote& tn : script_->trynotes()) {
|
||||
if (tn.start == offset + JSOpLength_Try &&
|
||||
(tn.kind == JSTRY_CATCH || tn.kind == JSTRY_FINALLY)) {
|
||||
|
@ -113,7 +113,7 @@ bool BytecodeAnalysis::init(TempAllocator& alloc) {
|
|||
// JSOp::Goto to jump over the catch/finally blocks.
|
||||
BytecodeLocation endOfTryLoc(script_,
|
||||
it.toRawBytecode() + it.codeOffset());
|
||||
MOZ_ASSERT(endOfTryLoc.is(JSOP_GOTO));
|
||||
MOZ_ASSERT(endOfTryLoc.is(JSOp::Goto));
|
||||
|
||||
BytecodeLocation afterTryLoc(
|
||||
script_, endOfTryLoc.toRawBytecode() + endOfTryLoc.jumpOffset());
|
||||
|
@ -139,7 +139,7 @@ bool BytecodeAnalysis::init(TempAllocator& alloc) {
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_LOOPHEAD:
|
||||
case JSOp::LoopHead:
|
||||
for (size_t i = 0; i < catchFinallyRanges.length(); i++) {
|
||||
if (catchFinallyRanges[i].contains(offset)) {
|
||||
infos_[offset].loopHeadInCatchOrFinally = true;
|
||||
|
@ -155,7 +155,7 @@ bool BytecodeAnalysis::init(TempAllocator& alloc) {
|
|||
if (jump) {
|
||||
// Case instructions do not push the lvalue back when branching.
|
||||
uint32_t newStackDepth = stackDepth;
|
||||
if (it.is(JSOP_CASE)) {
|
||||
if (it.is(JSOp::Case)) {
|
||||
newStackDepth--;
|
||||
}
|
||||
|
||||
|
@ -208,40 +208,40 @@ IonBytecodeInfo js::jit::AnalyzeBytecodeForIon(JSContext* cx,
|
|||
for (jsbytecode* pc = script->code(); pc < pcEnd; pc = GetNextPc(pc)) {
|
||||
JSOp op = JSOp(*pc);
|
||||
switch (op) {
|
||||
case JSOP_SETARG:
|
||||
case JSOp::SetArg:
|
||||
result.modifiesArguments = true;
|
||||
break;
|
||||
|
||||
case JSOP_GETNAME:
|
||||
case JSOP_BINDNAME:
|
||||
case JSOP_BINDVAR:
|
||||
case JSOP_SETNAME:
|
||||
case JSOP_STRICTSETNAME:
|
||||
case JSOP_DELNAME:
|
||||
case JSOP_GETALIASEDVAR:
|
||||
case JSOP_SETALIASEDVAR:
|
||||
case JSOP_LAMBDA:
|
||||
case JSOP_LAMBDA_ARROW:
|
||||
case JSOP_DEFFUN:
|
||||
case JSOP_DEFVAR:
|
||||
case JSOP_DEFLET:
|
||||
case JSOP_DEFCONST:
|
||||
case JSOP_PUSHLEXICALENV:
|
||||
case JSOP_POPLEXICALENV:
|
||||
case JSOP_IMPLICITTHIS:
|
||||
case JSOp::GetName:
|
||||
case JSOp::BindName:
|
||||
case JSOp::BindVar:
|
||||
case JSOp::SetName:
|
||||
case JSOp::StrictSetName:
|
||||
case JSOp::DelName:
|
||||
case JSOp::GetAliasedVar:
|
||||
case JSOp::SetAliasedVar:
|
||||
case JSOp::Lambda:
|
||||
case JSOp::LambdaArrow:
|
||||
case JSOp::DefFun:
|
||||
case JSOp::DefVar:
|
||||
case JSOp::DefLet:
|
||||
case JSOp::DefConst:
|
||||
case JSOp::PushLexicalEnv:
|
||||
case JSOp::PopLexicalEnv:
|
||||
case JSOp::ImplicitThis:
|
||||
result.usesEnvironmentChain = true;
|
||||
break;
|
||||
|
||||
case JSOP_GETGNAME:
|
||||
case JSOP_SETGNAME:
|
||||
case JSOP_STRICTSETGNAME:
|
||||
case JSOP_GIMPLICITTHIS:
|
||||
case JSOp::GetGName:
|
||||
case JSOp::SetGName:
|
||||
case JSOp::StrictSetGName:
|
||||
case JSOp::GImplicitThis:
|
||||
if (script->hasNonSyntacticScope()) {
|
||||
result.usesEnvironmentChain = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case JSOP_FINALLY:
|
||||
case JSOp::Finally:
|
||||
result.hasTryFinally = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -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 && JSOp(*pc) == JSOp::GetBoundName) ||
|
||||
cx->realm()->behaviors().extraWarnings(cx)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -3802,7 +3802,7 @@ AttachDecision SetPropIRGenerator::tryAttachSetDenseElementHole(
|
|||
JSOp op = JSOp(*pc_);
|
||||
MOZ_ASSERT(IsPropertySetOp(op) || IsPropertyInitOp(op));
|
||||
|
||||
if (op == JSOP_INITHIDDENELEM) {
|
||||
if (op == JSOp::InitHiddenElem) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -3872,7 +3872,7 @@ AttachDecision SetPropIRGenerator::tryAttachAddOrUpdateSparseElement(
|
|||
JSOp op = JSOp(*pc_);
|
||||
MOZ_ASSERT(IsPropertySetOp(op) || IsPropertyInitOp(op));
|
||||
|
||||
if (op != JSOP_SETELEM && op != JSOP_STRICTSETELEM) {
|
||||
if (op != JSOp::SetElem && op != JSOp::StrictSetElem) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -3944,7 +3944,7 @@ AttachDecision SetPropIRGenerator::tryAttachAddOrUpdateSparseElement(
|
|||
|
||||
writer.callAddOrUpdateSparseElementHelper(
|
||||
objId, indexId, rhsId,
|
||||
/* strict = */ op == JSOP_STRICTSETELEM);
|
||||
/* strict = */ op == JSOp::StrictSetElem);
|
||||
writer.returnFromIC();
|
||||
|
||||
trackAttached("AddOrUpdateSparseElement");
|
||||
|
@ -4706,7 +4706,7 @@ AttachDecision GetIteratorIRGenerator::tryAttachStub() {
|
|||
|
||||
AttachDecision GetIteratorIRGenerator::tryAttachNativeIterator(
|
||||
ObjOperandId objId, HandleObject obj) {
|
||||
MOZ_ASSERT(JSOp(*pc_) == JSOP_ITER);
|
||||
MOZ_ASSERT(JSOp(*pc_) == JSOp::Iter);
|
||||
|
||||
PropertyIteratorObject* iterobj = LookupInIteratorCache(cx_, obj);
|
||||
if (!iterobj) {
|
||||
|
@ -5074,15 +5074,15 @@ AttachDecision CallIRGenerator::tryAttachSpecialCaseCallNative(
|
|||
MOZ_ASSERT(callee->isNative());
|
||||
|
||||
// Check for fun_call and fun_apply.
|
||||
if (op_ == JSOP_FUNCALL && callee->native() == fun_call) {
|
||||
if (op_ == JSOp::FunCall && callee->native() == fun_call) {
|
||||
return tryAttachFunCall();
|
||||
}
|
||||
if (op_ == JSOP_FUNAPPLY && callee->native() == fun_apply) {
|
||||
if (op_ == JSOp::FunApply && callee->native() == fun_apply) {
|
||||
return tryAttachFunApply();
|
||||
}
|
||||
|
||||
// Other functions are only optimized for normal calls.
|
||||
if (op_ != JSOP_CALL && op_ != JSOP_CALL_IGNORES_RV) {
|
||||
if (op_ != JSOp::Call && op_ != JSOp::CallIgnoresRv) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -5110,7 +5110,7 @@ bool CallIRGenerator::getTemplateObjectForScripted(HandleFunction calleeFunc,
|
|||
// Saving the template object is unsound for super(), as a single
|
||||
// callsite can have multiple possible prototype objects created
|
||||
// (via different newTargets)
|
||||
bool isSuper = op_ == JSOP_SUPERCALL || op_ == JSOP_SPREADSUPERCALL;
|
||||
bool isSuper = op_ == JSOp::SuperCall || op_ == JSOp::SpreadSuperCall;
|
||||
if (isSuper) {
|
||||
return true;
|
||||
}
|
||||
|
@ -5164,7 +5164,7 @@ AttachDecision CallIRGenerator::tryAttachCallScripted(
|
|||
HandleFunction calleeFunc) {
|
||||
// Never attach optimized scripted call stubs for JSOp::FunApply.
|
||||
// MagicArguments may escape the frame through them.
|
||||
if (op_ == JSOP_FUNAPPLY) {
|
||||
if (op_ == JSOp::FunApply) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -5266,7 +5266,7 @@ bool CallIRGenerator::getTemplateObjectForNative(HandleFunction calleeFunc,
|
|||
// Saving the template object is unsound for super(), as a single
|
||||
// callsite can have multiple possible prototype objects created
|
||||
// (via different newTargets)
|
||||
bool isSuper = op_ == JSOP_SUPERCALL || op_ == JSOP_SPREADSUPERCALL;
|
||||
bool isSuper = op_ == JSOp::SuperCall || op_ == JSOp::SpreadSuperCall;
|
||||
if (isSuper) {
|
||||
return true;
|
||||
}
|
||||
|
@ -5435,7 +5435,7 @@ bool CallIRGenerator::getTemplateObjectForClassHook(
|
|||
// Saving the template object is unsound for super(), as a single
|
||||
// callsite can have multiple possible prototype objects created
|
||||
// (via different newTargets)
|
||||
bool isSuper = op_ == JSOP_SUPERCALL || op_ == JSOP_SPREADSUPERCALL;
|
||||
bool isSuper = op_ == JSOp::SuperCall || op_ == JSOp::SpreadSuperCall;
|
||||
if (isSuper) {
|
||||
return true;
|
||||
}
|
||||
|
@ -5456,7 +5456,7 @@ bool CallIRGenerator::getTemplateObjectForClassHook(
|
|||
}
|
||||
|
||||
AttachDecision CallIRGenerator::tryAttachCallHook(HandleObject calleeObj) {
|
||||
if (op_ == JSOP_FUNAPPLY) {
|
||||
if (op_ == JSOp::FunApply) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -5513,16 +5513,16 @@ AttachDecision CallIRGenerator::tryAttachStub() {
|
|||
|
||||
// Some opcodes are not yet supported.
|
||||
switch (op_) {
|
||||
case JSOP_CALL:
|
||||
case JSOP_CALL_IGNORES_RV:
|
||||
case JSOP_CALLITER:
|
||||
case JSOP_SPREADCALL:
|
||||
case JSOP_NEW:
|
||||
case JSOP_SPREADNEW:
|
||||
case JSOP_SUPERCALL:
|
||||
case JSOP_SPREADSUPERCALL:
|
||||
case JSOP_FUNCALL:
|
||||
case JSOP_FUNAPPLY:
|
||||
case JSOp::Call:
|
||||
case JSOp::CallIgnoresRv:
|
||||
case JSOp::CallIter:
|
||||
case JSOp::SpreadCall:
|
||||
case JSOp::New:
|
||||
case JSOp::SpreadNew:
|
||||
case JSOp::SuperCall:
|
||||
case JSOp::SpreadSuperCall:
|
||||
case JSOp::FunCall:
|
||||
case JSOp::FunApply:
|
||||
break;
|
||||
default:
|
||||
return AttachDecision::NoAction;
|
||||
|
@ -5559,7 +5559,7 @@ AttachDecision CallIRGenerator::tryAttachDeferredStub(HandleValue result) {
|
|||
AutoAssertNoPendingException aanpe(cx_);
|
||||
|
||||
// Ensure that the opcode makes sense.
|
||||
MOZ_ASSERT(op_ == JSOP_CALL || op_ == JSOP_CALL_IGNORES_RV);
|
||||
MOZ_ASSERT(op_ == JSOp::Call || op_ == JSOp::CallIgnoresRv);
|
||||
|
||||
// Ensure that the mode makes sense.
|
||||
MOZ_ASSERT(mode_ == ICState::Mode::Specialized);
|
||||
|
@ -5680,7 +5680,7 @@ AttachDecision CompareIRGenerator::tryAttachStrictDifferentTypes(
|
|||
ValOperandId lhsId, ValOperandId rhsId) {
|
||||
MOZ_ASSERT(IsEqualityOp(op_));
|
||||
|
||||
if (op_ != JSOP_STRICTEQ && op_ != JSOP_STRICTNE) {
|
||||
if (op_ != JSOp::StrictEq && op_ != JSOp::StrictNe) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -5697,7 +5697,7 @@ AttachDecision CompareIRGenerator::tryAttachStrictDifferentTypes(
|
|||
|
||||
// Now that we've passed the guard, we know differing types, so return the
|
||||
// bool result.
|
||||
writer.loadBooleanResult(op_ == JSOP_STRICTNE ? true : false);
|
||||
writer.loadBooleanResult(op_ == JSOp::StrictNe ? true : false);
|
||||
writer.returnFromIC();
|
||||
|
||||
trackAttached("StrictDifferentTypes");
|
||||
|
@ -5718,7 +5718,7 @@ AttachDecision CompareIRGenerator::tryAttachInt32(ValOperandId lhsId,
|
|||
|
||||
// Strictly different types should have been handed by
|
||||
// tryAttachStrictDifferentTypes
|
||||
MOZ_ASSERT_IF(op_ == JSOP_STRICTEQ || op_ == JSOP_STRICTNE,
|
||||
MOZ_ASSERT_IF(op_ == JSOp::StrictEq || op_ == JSOp::StrictNe,
|
||||
lhsVal_.isInt32() == rhsVal_.isInt32());
|
||||
|
||||
writer.compareInt32Result(op_, lhsIntId, rhsIntId);
|
||||
|
@ -5765,7 +5765,7 @@ AttachDecision CompareIRGenerator::tryAttachObjectUndefined(
|
|||
!(rhsVal_.isNullOrUndefined() && lhsVal_.isObject()))
|
||||
return AttachDecision::NoAction;
|
||||
|
||||
if (op_ != JSOP_EQ && op_ != JSOP_NE) {
|
||||
if (op_ != JSOp::Eq && op_ != JSOp::Ne) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -5803,7 +5803,7 @@ AttachDecision CompareIRGenerator::tryAttachNumberUndefined(
|
|||
|
||||
// Comparing a number with undefined will always be true for Ne/StrictNe,
|
||||
// and always be false for other compare ops.
|
||||
writer.loadBooleanResult(op_ == JSOP_NE || op_ == JSOP_STRICTNE);
|
||||
writer.loadBooleanResult(op_ == JSOp::Ne || op_ == JSOp::StrictNe);
|
||||
writer.returnFromIC();
|
||||
|
||||
trackAttached("NumberUndefined");
|
||||
|
@ -5858,7 +5858,7 @@ AttachDecision CompareIRGenerator::tryAttachPrimitiveUndefined(
|
|||
|
||||
// Comparing a primitive with undefined/null will always be true for
|
||||
// Ne/StrictNe, and always be false for other compare ops.
|
||||
writer.loadBooleanResult(op_ == JSOP_NE || op_ == JSOP_STRICTNE);
|
||||
writer.loadBooleanResult(op_ == JSOp::Ne || op_ == JSOp::StrictNe);
|
||||
writer.returnFromIC();
|
||||
|
||||
trackAttached("PrimitiveUndefined");
|
||||
|
@ -5872,11 +5872,11 @@ AttachDecision CompareIRGenerator::tryAttachNullUndefined(ValOperandId lhsId,
|
|||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
if (op_ == JSOP_EQ || op_ == JSOP_NE) {
|
||||
if (op_ == JSOp::Eq || op_ == JSOp::Ne) {
|
||||
writer.guardIsNullOrUndefined(lhsId);
|
||||
writer.guardIsNullOrUndefined(rhsId);
|
||||
// Sloppy equality means we actually only care about the op:
|
||||
writer.loadBooleanResult(op_ == JSOP_EQ);
|
||||
writer.loadBooleanResult(op_ == JSOp::Eq);
|
||||
trackAttached("SloppyNullUndefined");
|
||||
} else {
|
||||
// Strict equality only hits this branch, and only in the
|
||||
|
@ -5887,7 +5887,7 @@ AttachDecision CompareIRGenerator::tryAttachNullUndefined(ValOperandId lhsId,
|
|||
: writer.guardIsUndefined(lhsId);
|
||||
rhsVal_.isNull() ? writer.guardIsNull(rhsId)
|
||||
: writer.guardIsUndefined(rhsId);
|
||||
writer.loadBooleanResult(op_ == JSOP_STRICTEQ);
|
||||
writer.loadBooleanResult(op_ == JSOp::StrictEq);
|
||||
trackAttached("StrictNullUndefinedEquality");
|
||||
}
|
||||
|
||||
|
@ -5904,7 +5904,7 @@ AttachDecision CompareIRGenerator::tryAttachStringNumber(ValOperandId lhsId,
|
|||
}
|
||||
|
||||
// Case should have been handled by tryAttachStrictlDifferentTypes
|
||||
MOZ_ASSERT(op_ != JSOP_STRICTEQ && op_ != JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op_ != JSOp::StrictEq && op_ != JSOp::StrictNe);
|
||||
|
||||
auto createGuards = [&](HandleValue v, ValOperandId vId) {
|
||||
if (v.isString()) {
|
||||
|
@ -5973,7 +5973,7 @@ AttachDecision CompareIRGenerator::tryAttachPrimitiveSymbol(
|
|||
|
||||
// Comparing a primitive with symbol will always be true for Ne/StrictNe, and
|
||||
// always be false for other compare ops.
|
||||
writer.loadBooleanResult(op_ == JSOP_NE || op_ == JSOP_STRICTNE);
|
||||
writer.loadBooleanResult(op_ == JSOp::Ne || op_ == JSOp::StrictNe);
|
||||
writer.returnFromIC();
|
||||
|
||||
trackAttached("PrimitiveSymbol");
|
||||
|
@ -5989,7 +5989,7 @@ AttachDecision CompareIRGenerator::tryAttachBoolStringOrNumber(
|
|||
}
|
||||
|
||||
// Case should have been handled by tryAttachStrictlDifferentTypes
|
||||
MOZ_ASSERT(op_ != JSOP_STRICTEQ && op_ != JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op_ != JSOp::StrictEq && op_ != JSOp::StrictNe);
|
||||
|
||||
// Case should have been handled by tryAttachInt32
|
||||
MOZ_ASSERT(!lhsVal_.isInt32() && !rhsVal_.isInt32());
|
||||
|
@ -6025,7 +6025,7 @@ AttachDecision CompareIRGenerator::tryAttachBigIntInt32(ValOperandId lhsId,
|
|||
}
|
||||
|
||||
// Case should have been handled by tryAttachStrictlDifferentTypes
|
||||
MOZ_ASSERT(op_ != JSOP_STRICTEQ && op_ != JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op_ != JSOp::StrictEq && op_ != JSOp::StrictNe);
|
||||
|
||||
auto createGuards = [&](HandleValue v, ValOperandId vId) {
|
||||
if (v.isBoolean()) {
|
||||
|
@ -6061,7 +6061,7 @@ AttachDecision CompareIRGenerator::tryAttachBigIntNumber(ValOperandId lhsId,
|
|||
}
|
||||
|
||||
// Case should have been handled by tryAttachStrictlDifferentTypes
|
||||
MOZ_ASSERT(op_ != JSOP_STRICTEQ && op_ != JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op_ != JSOp::StrictEq && op_ != JSOp::StrictNe);
|
||||
|
||||
if (lhsVal_.isBigInt()) {
|
||||
BigIntOperandId bigIntId = writer.guardToBigInt(lhsId);
|
||||
|
@ -6089,7 +6089,7 @@ AttachDecision CompareIRGenerator::tryAttachBigIntString(ValOperandId lhsId,
|
|||
}
|
||||
|
||||
// Case should have been handled by tryAttachStrictlDifferentTypes
|
||||
MOZ_ASSERT(op_ != JSOP_STRICTEQ && op_ != JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op_ != JSOp::StrictEq && op_ != JSOp::StrictNe);
|
||||
|
||||
if (lhsVal_.isBigInt()) {
|
||||
BigIntOperandId bigIntId = writer.guardToBigInt(lhsId);
|
||||
|
@ -6363,19 +6363,19 @@ AttachDecision UnaryArithIRGenerator::tryAttachInt32() {
|
|||
|
||||
Int32OperandId intId = writer.guardToInt32(valId);
|
||||
switch (op_) {
|
||||
case JSOP_BITNOT:
|
||||
case JSOp::BitNot:
|
||||
writer.int32NotResult(intId);
|
||||
trackAttached("UnaryArith.Int32Not");
|
||||
break;
|
||||
case JSOP_NEG:
|
||||
case JSOp::Neg:
|
||||
writer.int32NegationResult(intId);
|
||||
trackAttached("UnaryArith.Int32Neg");
|
||||
break;
|
||||
case JSOP_INC:
|
||||
case JSOp::Inc:
|
||||
writer.int32IncResult(intId);
|
||||
trackAttached("UnaryArith.Int32Inc");
|
||||
break;
|
||||
case JSOP_DEC:
|
||||
case JSOp::Dec:
|
||||
writer.int32DecResult(intId);
|
||||
trackAttached("UnaryArith.Int32Dec");
|
||||
break;
|
||||
|
@ -6396,20 +6396,20 @@ AttachDecision UnaryArithIRGenerator::tryAttachNumber() {
|
|||
NumberOperandId numId = writer.guardIsNumber(valId);
|
||||
Int32OperandId truncatedId;
|
||||
switch (op_) {
|
||||
case JSOP_BITNOT:
|
||||
case JSOp::BitNot:
|
||||
truncatedId = writer.truncateDoubleToUInt32(numId);
|
||||
writer.int32NotResult(truncatedId);
|
||||
trackAttached("UnaryArith.DoubleNot");
|
||||
break;
|
||||
case JSOP_NEG:
|
||||
case JSOp::Neg:
|
||||
writer.doubleNegationResult(numId);
|
||||
trackAttached("UnaryArith.DoubleNeg");
|
||||
break;
|
||||
case JSOP_INC:
|
||||
case JSOp::Inc:
|
||||
writer.doubleIncResult(numId);
|
||||
trackAttached("UnaryArith.DoubleInc");
|
||||
break;
|
||||
case JSOP_DEC:
|
||||
case JSOp::Dec:
|
||||
writer.doubleDecResult(numId);
|
||||
trackAttached("UnaryArith.DoubleDec");
|
||||
break;
|
||||
|
@ -6429,19 +6429,19 @@ AttachDecision UnaryArithIRGenerator::tryAttachBigInt() {
|
|||
ValOperandId valId(writer.setInputOperandId(0));
|
||||
BigIntOperandId bigIntId = writer.guardToBigInt(valId);
|
||||
switch (op_) {
|
||||
case JSOP_BITNOT:
|
||||
case JSOp::BitNot:
|
||||
writer.bigIntNotResult(bigIntId);
|
||||
trackAttached("UnaryArith.BigIntNot");
|
||||
break;
|
||||
case JSOP_NEG:
|
||||
case JSOp::Neg:
|
||||
writer.bigIntNegationResult(bigIntId);
|
||||
trackAttached("UnaryArith.BigIntNeg");
|
||||
break;
|
||||
case JSOP_INC:
|
||||
case JSOp::Inc:
|
||||
writer.bigIntIncResult(bigIntId);
|
||||
trackAttached("UnaryArith.BigIntInc");
|
||||
break;
|
||||
case JSOP_DEC:
|
||||
case JSOp::Dec:
|
||||
writer.bigIntDecResult(bigIntId);
|
||||
trackAttached("UnaryArith.BigIntDec");
|
||||
break;
|
||||
|
@ -6505,8 +6505,8 @@ AttachDecision BinaryArithIRGenerator::tryAttachStub() {
|
|||
|
||||
AttachDecision BinaryArithIRGenerator::tryAttachBitwise() {
|
||||
// Only bit-wise and shifts.
|
||||
if (op_ != JSOP_BITOR && op_ != JSOP_BITXOR && op_ != JSOP_BITAND &&
|
||||
op_ != JSOP_LSH && op_ != JSOP_RSH && op_ != JSOP_URSH) {
|
||||
if (op_ != JSOp::BitOr && op_ != JSOp::BitXor && op_ != JSOp::BitAnd &&
|
||||
op_ != JSOp::Lsh && op_ != JSOp::Rsh && op_ != JSOp::Ursh) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -6517,7 +6517,7 @@ AttachDecision BinaryArithIRGenerator::tryAttachBitwise() {
|
|||
}
|
||||
|
||||
// All ops, with the exception of Ursh produce Int32 values.
|
||||
MOZ_ASSERT_IF(op_ != JSOP_URSH, res_.isInt32());
|
||||
MOZ_ASSERT_IF(op_ != JSOp::Ursh, res_.isInt32());
|
||||
|
||||
ValOperandId lhsId(writer.setInputOperandId(0));
|
||||
ValOperandId rhsId(writer.setInputOperandId(1));
|
||||
|
@ -6539,27 +6539,27 @@ AttachDecision BinaryArithIRGenerator::tryAttachBitwise() {
|
|||
Int32OperandId rhsIntId = guardToInt32(rhsId, rhs_);
|
||||
|
||||
switch (op_) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
writer.int32BitOrResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Bitwise.BitOr");
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
writer.int32BitXOrResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Bitwise.BitXOr");
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
writer.int32BitAndResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Bitwise.BitAnd");
|
||||
break;
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
writer.int32LeftShiftResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Bitwise.LeftShift");
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
writer.int32RightShiftResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Bitwise.RightShift");
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
writer.int32URightShiftResult(lhsIntId, rhsIntId, res_.isDouble());
|
||||
trackAttached("BinaryArith.Bitwise.UnsignedRightShift");
|
||||
break;
|
||||
|
@ -6573,8 +6573,8 @@ AttachDecision BinaryArithIRGenerator::tryAttachBitwise() {
|
|||
|
||||
AttachDecision BinaryArithIRGenerator::tryAttachDouble() {
|
||||
// Check valid opcodes
|
||||
if (op_ != JSOP_ADD && op_ != JSOP_SUB && op_ != JSOP_MUL &&
|
||||
op_ != JSOP_DIV && op_ != JSOP_MOD) {
|
||||
if (op_ != JSOp::Add && op_ != JSOp::Sub && op_ != JSOp::Mul &&
|
||||
op_ != JSOp::Div && op_ != JSOp::Mod) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -6590,23 +6590,23 @@ AttachDecision BinaryArithIRGenerator::tryAttachDouble() {
|
|||
NumberOperandId rhs = writer.guardIsNumber(rhsId);
|
||||
|
||||
switch (op_) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
writer.doubleAddResult(lhs, rhs);
|
||||
trackAttached("BinaryArith.Double.Add");
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
writer.doubleSubResult(lhs, rhs);
|
||||
trackAttached("BinaryArith.Double.Sub");
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
writer.doubleMulResult(lhs, rhs);
|
||||
trackAttached("BinaryArith.Double.Mul");
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
writer.doubleDivResult(lhs, rhs);
|
||||
trackAttached("BinaryArith.Double.Div");
|
||||
break;
|
||||
case JSOP_MOD:
|
||||
case JSOp::Mod:
|
||||
writer.doubleModResult(lhs, rhs);
|
||||
trackAttached("BinaryArith.Double.Mod");
|
||||
break;
|
||||
|
@ -6630,8 +6630,8 @@ AttachDecision BinaryArithIRGenerator::tryAttachInt32() {
|
|||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
if (op_ != JSOP_ADD && op_ != JSOP_SUB && op_ != JSOP_MUL &&
|
||||
op_ != JSOP_DIV && op_ != JSOP_MOD) {
|
||||
if (op_ != JSOp::Add && op_ != JSOp::Sub && op_ != JSOp::Mul &&
|
||||
op_ != JSOp::Div && op_ != JSOp::Mod) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -6650,23 +6650,23 @@ AttachDecision BinaryArithIRGenerator::tryAttachInt32() {
|
|||
Int32OperandId rhsIntId = guardToInt32(rhsId, rhs_);
|
||||
|
||||
switch (op_) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
writer.int32AddResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Int32.Add");
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
writer.int32SubResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Int32.Sub");
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
writer.int32MulResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Int32.Mul");
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
writer.int32DivResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Int32.Div");
|
||||
break;
|
||||
case JSOP_MOD:
|
||||
case JSOp::Mod:
|
||||
writer.int32ModResult(lhsIntId, rhsIntId);
|
||||
trackAttached("BinaryArith.Int32.Mod");
|
||||
break;
|
||||
|
@ -6680,7 +6680,7 @@ AttachDecision BinaryArithIRGenerator::tryAttachInt32() {
|
|||
|
||||
AttachDecision BinaryArithIRGenerator::tryAttachStringNumberConcat() {
|
||||
// Only Addition
|
||||
if (op_ != JSOP_ADD) {
|
||||
if (op_ != JSOp::Add) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -6719,7 +6719,7 @@ AttachDecision BinaryArithIRGenerator::tryAttachStringNumberConcat() {
|
|||
|
||||
AttachDecision BinaryArithIRGenerator::tryAttachStringBooleanConcat() {
|
||||
// Only Addition
|
||||
if (op_ != JSOP_ADD) {
|
||||
if (op_ != JSOp::Add) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -6752,7 +6752,7 @@ AttachDecision BinaryArithIRGenerator::tryAttachStringBooleanConcat() {
|
|||
|
||||
AttachDecision BinaryArithIRGenerator::tryAttachStringConcat() {
|
||||
// Only Addition
|
||||
if (op_ != JSOP_ADD) {
|
||||
if (op_ != JSOp::Add) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -6776,7 +6776,7 @@ AttachDecision BinaryArithIRGenerator::tryAttachStringConcat() {
|
|||
|
||||
AttachDecision BinaryArithIRGenerator::tryAttachStringObjectConcat() {
|
||||
// Only Addition
|
||||
if (op_ != JSOP_ADD) {
|
||||
if (op_ != JSOp::Add) {
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
|
@ -6813,20 +6813,20 @@ AttachDecision BinaryArithIRGenerator::tryAttachBigInt() {
|
|||
}
|
||||
|
||||
switch (op_) {
|
||||
case JSOP_ADD:
|
||||
case JSOP_SUB:
|
||||
case JSOP_MUL:
|
||||
case JSOP_DIV:
|
||||
case JSOP_MOD:
|
||||
case JSOP_POW:
|
||||
case JSOp::Add:
|
||||
case JSOp::Sub:
|
||||
case JSOp::Mul:
|
||||
case JSOp::Div:
|
||||
case JSOp::Mod:
|
||||
case JSOp::Pow:
|
||||
// Arithmetic operations.
|
||||
break;
|
||||
|
||||
case JSOP_BITOR:
|
||||
case JSOP_BITXOR:
|
||||
case JSOP_BITAND:
|
||||
case JSOP_LSH:
|
||||
case JSOP_RSH:
|
||||
case JSOp::BitOr:
|
||||
case JSOp::BitXor:
|
||||
case JSOp::BitAnd:
|
||||
case JSOp::Lsh:
|
||||
case JSOp::Rsh:
|
||||
// Bitwise operations.
|
||||
break;
|
||||
|
||||
|
@ -6841,47 +6841,47 @@ AttachDecision BinaryArithIRGenerator::tryAttachBigInt() {
|
|||
BigIntOperandId rhsBigIntId = writer.guardToBigInt(rhsId);
|
||||
|
||||
switch (op_) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
writer.bigIntAddResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.Add");
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
writer.bigIntSubResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.Sub");
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
writer.bigIntMulResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.Mul");
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
writer.bigIntDivResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.Div");
|
||||
break;
|
||||
case JSOP_MOD:
|
||||
case JSOp::Mod:
|
||||
writer.bigIntModResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.Mod");
|
||||
break;
|
||||
case JSOP_POW:
|
||||
case JSOp::Pow:
|
||||
writer.bigIntPowResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.Pow");
|
||||
break;
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
writer.bigIntBitOrResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.BitOr");
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
writer.bigIntBitXorResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.BitXor");
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
writer.bigIntBitAndResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.BitAnd");
|
||||
break;
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
writer.bigIntLeftShiftResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.LeftShift");
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
writer.bigIntRightShiftResult(lhsBigIntId, rhsBigIntId);
|
||||
trackAttached("BinaryArith.BigInt.RightShift");
|
||||
break;
|
||||
|
|
|
@ -1493,7 +1493,7 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter {
|
|||
// Some native functions can be implemented faster if we know that
|
||||
// the return value is ignored.
|
||||
bool ignoresReturnValue =
|
||||
op == JSOP_CALL_IGNORES_RV && calleeFunc->hasJitInfo() &&
|
||||
op == JSOp::CallIgnoresRv && calleeFunc->hasJitInfo() &&
|
||||
calleeFunc->jitInfo()->type() == JSJitInfo::IgnoresReturnValueNative;
|
||||
|
||||
#ifdef JS_SIMULATOR
|
||||
|
|
|
@ -4239,7 +4239,7 @@ bool CacheIRCompiler::emitCompareBigIntResult() {
|
|||
// Push the operands in reverse order for JSOp::Le and JSOp::Gt:
|
||||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
if (op == JSOP_LE || op == JSOP_GT) {
|
||||
if (op == JSOp::Le || op == JSOp::Gt) {
|
||||
masm.passABIArg(rhs);
|
||||
masm.passABIArg(lhs);
|
||||
} else {
|
||||
|
@ -4249,14 +4249,14 @@ bool CacheIRCompiler::emitCompareBigIntResult() {
|
|||
|
||||
using Fn = bool (*)(BigInt*, BigInt*);
|
||||
Fn fn;
|
||||
if (op == JSOP_EQ || op == JSOP_STRICTEQ) {
|
||||
if (op == JSOp::Eq || op == JSOp::StrictEq) {
|
||||
fn = jit::BigIntEqual<EqualityKind::Equal>;
|
||||
} else if (op == JSOP_NE || op == JSOP_STRICTNE) {
|
||||
} else if (op == JSOp::Ne || op == JSOp::StrictNe) {
|
||||
fn = jit::BigIntEqual<EqualityKind::NotEqual>;
|
||||
} else if (op == JSOP_LT || op == JSOP_GT) {
|
||||
} else if (op == JSOp::Lt || op == JSOp::Gt) {
|
||||
fn = jit::BigIntCompare<ComparisonKind::LessThan>;
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_LE || op == JSOP_GE);
|
||||
MOZ_ASSERT(op == JSOp::Le || op == JSOp::Ge);
|
||||
fn = jit::BigIntCompare<ComparisonKind::GreaterThanOrEqual>;
|
||||
}
|
||||
|
||||
|
@ -4286,8 +4286,8 @@ bool CacheIRCompiler::emitCompareBigIntInt32ResultShared(
|
|||
// If the absolute value of the BigInt can't be expressed in an uint32/uint64,
|
||||
// the result of the comparison is a constant.
|
||||
Label ifTrue, ifFalse;
|
||||
if (op == JSOP_EQ || op == JSOP_NE) {
|
||||
Label* tooLarge = op == JSOP_EQ ? &ifFalse : &ifTrue;
|
||||
if (op == JSOp::Eq || op == JSOp::Ne) {
|
||||
Label* tooLarge = op == JSOp::Eq ? &ifFalse : &ifTrue;
|
||||
masm.branch32(Assembler::GreaterThan,
|
||||
Address(bigInt, BigInt::offsetOfDigitLength()), Imm32(1),
|
||||
tooLarge);
|
||||
|
@ -4298,7 +4298,7 @@ bool CacheIRCompiler::emitCompareBigIntInt32ResultShared(
|
|||
&doCompare);
|
||||
|
||||
// Still need to take the sign-bit into account for relational operations.
|
||||
if (op == JSOP_LT || op == JSOP_LE) {
|
||||
if (op == JSOp::Lt || op == JSOp::Le) {
|
||||
masm.branchIfNegativeBigInt(bigInt, &ifTrue);
|
||||
masm.jump(&ifFalse);
|
||||
} else {
|
||||
|
@ -4318,17 +4318,17 @@ bool CacheIRCompiler::emitCompareBigIntInt32ResultShared(
|
|||
// operator.
|
||||
Label* greaterThan;
|
||||
Label* lessThan;
|
||||
if (op == JSOP_EQ) {
|
||||
if (op == JSOp::Eq) {
|
||||
greaterThan = &ifFalse;
|
||||
lessThan = &ifFalse;
|
||||
} else if (op == JSOP_NE) {
|
||||
} else if (op == JSOp::Ne) {
|
||||
greaterThan = &ifTrue;
|
||||
lessThan = &ifTrue;
|
||||
} else if (op == JSOP_LT || op == JSOP_LE) {
|
||||
} else if (op == JSOp::Lt || op == JSOp::Le) {
|
||||
greaterThan = &ifFalse;
|
||||
lessThan = &ifTrue;
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_GT || op == JSOP_GE);
|
||||
MOZ_ASSERT(op == JSOp::Gt || op == JSOp::Ge);
|
||||
greaterThan = &ifTrue;
|
||||
lessThan = &ifFalse;
|
||||
}
|
||||
|
@ -4431,7 +4431,7 @@ bool CacheIRCompiler::emitCompareBigIntNumberResult() {
|
|||
// Push the operands in reverse order for JSOp::Le and JSOp::Gt:
|
||||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
if (op == JSOP_LE || op == JSOP_GT) {
|
||||
if (op == JSOp::Le || op == JSOp::Gt) {
|
||||
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(lhs);
|
||||
} else {
|
||||
|
@ -4443,33 +4443,33 @@ bool CacheIRCompiler::emitCompareBigIntNumberResult() {
|
|||
using FnNumberBigInt = bool (*)(double, BigInt*);
|
||||
void* fun;
|
||||
switch (op) {
|
||||
case JSOP_EQ: {
|
||||
case JSOp::Eq: {
|
||||
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::Equal>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_NE: {
|
||||
case JSOp::Ne: {
|
||||
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::NotEqual>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_LT: {
|
||||
case JSOp::Lt: {
|
||||
FnBigIntNumber fn = jit::BigIntNumberCompare<ComparisonKind::LessThan>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_GT: {
|
||||
case JSOp::Gt: {
|
||||
FnNumberBigInt fn = jit::NumberBigIntCompare<ComparisonKind::LessThan>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_LE: {
|
||||
case JSOp::Le: {
|
||||
FnNumberBigInt fn =
|
||||
jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_GE: {
|
||||
case JSOp::Ge: {
|
||||
FnBigIntNumber fn =
|
||||
jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
|
@ -4511,7 +4511,7 @@ bool CacheIRCompiler::emitCompareNumberBigIntResult() {
|
|||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
// Also push the operands in reverse order for JSOp::Eq and JSOp::Ne.
|
||||
if (op == JSOP_LT || op == JSOP_GE) {
|
||||
if (op == JSOp::Lt || op == JSOp::Ge) {
|
||||
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(rhs);
|
||||
} else {
|
||||
|
@ -4523,33 +4523,33 @@ bool CacheIRCompiler::emitCompareNumberBigIntResult() {
|
|||
using FnNumberBigInt = bool (*)(double, BigInt*);
|
||||
void* fun;
|
||||
switch (op) {
|
||||
case JSOP_EQ: {
|
||||
case JSOp::Eq: {
|
||||
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::Equal>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_NE: {
|
||||
case JSOp::Ne: {
|
||||
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::NotEqual>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_LT: {
|
||||
case JSOp::Lt: {
|
||||
FnNumberBigInt fn = jit::NumberBigIntCompare<ComparisonKind::LessThan>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_GT: {
|
||||
case JSOp::Gt: {
|
||||
FnBigIntNumber fn = jit::BigIntNumberCompare<ComparisonKind::LessThan>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_LE: {
|
||||
case JSOp::Le: {
|
||||
FnBigIntNumber fn =
|
||||
jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
break;
|
||||
}
|
||||
case JSOP_GE: {
|
||||
case JSOp::Ge: {
|
||||
FnNumberBigInt fn =
|
||||
jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>;
|
||||
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
|
||||
|
@ -4583,7 +4583,7 @@ bool CacheIRCompiler::emitCompareBigIntStringResult() {
|
|||
// Push the operands in reverse order for JSOp::Le and JSOp::Gt:
|
||||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
if (op == JSOP_LE || op == JSOP_GT) {
|
||||
if (op == JSOp::Le || op == JSOp::Gt) {
|
||||
masm.Push(lhs);
|
||||
masm.Push(rhs);
|
||||
} else {
|
||||
|
@ -4597,32 +4597,32 @@ bool CacheIRCompiler::emitCompareBigIntStringResult() {
|
|||
bool (*)(JSContext*, HandleString, HandleBigInt, bool*);
|
||||
|
||||
switch (op) {
|
||||
case JSOP_EQ: {
|
||||
case JSOp::Eq: {
|
||||
constexpr auto Equal = EqualityKind::Equal;
|
||||
callvm.call<FnBigIntString, BigIntStringEqual<Equal>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_NE: {
|
||||
case JSOp::Ne: {
|
||||
constexpr auto NotEqual = EqualityKind::NotEqual;
|
||||
callvm.call<FnBigIntString, BigIntStringEqual<NotEqual>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_LT: {
|
||||
case JSOp::Lt: {
|
||||
constexpr auto LessThan = ComparisonKind::LessThan;
|
||||
callvm.call<FnBigIntString, BigIntStringCompare<LessThan>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_GT: {
|
||||
case JSOp::Gt: {
|
||||
constexpr auto LessThan = ComparisonKind::LessThan;
|
||||
callvm.call<FnStringBigInt, StringBigIntCompare<LessThan>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_LE: {
|
||||
case JSOp::Le: {
|
||||
constexpr auto GreaterThanOrEqual = ComparisonKind::GreaterThanOrEqual;
|
||||
callvm.call<FnStringBigInt, StringBigIntCompare<GreaterThanOrEqual>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_GE: {
|
||||
case JSOp::Ge: {
|
||||
constexpr auto GreaterThanOrEqual = ComparisonKind::GreaterThanOrEqual;
|
||||
callvm.call<FnBigIntString, BigIntStringCompare<GreaterThanOrEqual>>();
|
||||
break;
|
||||
|
@ -4647,7 +4647,7 @@ bool CacheIRCompiler::emitCompareStringBigIntResult() {
|
|||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
// Also push the operands in reverse order for JSOp::Eq and JSOp::Ne.
|
||||
if (op == JSOP_LT || op == JSOP_GE) {
|
||||
if (op == JSOp::Lt || op == JSOp::Ge) {
|
||||
masm.Push(rhs);
|
||||
masm.Push(lhs);
|
||||
} else {
|
||||
|
@ -4661,32 +4661,32 @@ bool CacheIRCompiler::emitCompareStringBigIntResult() {
|
|||
bool (*)(JSContext*, HandleString, HandleBigInt, bool*);
|
||||
|
||||
switch (op) {
|
||||
case JSOP_EQ: {
|
||||
case JSOp::Eq: {
|
||||
constexpr auto Equal = EqualityKind::Equal;
|
||||
callvm.call<FnBigIntString, BigIntStringEqual<Equal>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_NE: {
|
||||
case JSOp::Ne: {
|
||||
constexpr auto NotEqual = EqualityKind::NotEqual;
|
||||
callvm.call<FnBigIntString, BigIntStringEqual<NotEqual>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_LT: {
|
||||
case JSOp::Lt: {
|
||||
constexpr auto LessThan = ComparisonKind::LessThan;
|
||||
callvm.call<FnStringBigInt, StringBigIntCompare<LessThan>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_GT: {
|
||||
case JSOp::Gt: {
|
||||
constexpr auto LessThan = ComparisonKind::LessThan;
|
||||
callvm.call<FnBigIntString, BigIntStringCompare<LessThan>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_LE: {
|
||||
case JSOp::Le: {
|
||||
constexpr auto GreaterThanOrEqual = ComparisonKind::GreaterThanOrEqual;
|
||||
callvm.call<FnBigIntString, BigIntStringCompare<GreaterThanOrEqual>>();
|
||||
break;
|
||||
}
|
||||
case JSOP_GE: {
|
||||
case JSOp::Ge: {
|
||||
constexpr auto GreaterThanOrEqual = ComparisonKind::GreaterThanOrEqual;
|
||||
callvm.call<FnStringBigInt, StringBigIntCompare<GreaterThanOrEqual>>();
|
||||
break;
|
||||
|
@ -4709,19 +4709,19 @@ bool CacheIRCompiler::emitCompareObjectUndefinedNullResult() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (op == JSOP_STRICTEQ || op == JSOP_STRICTNE) {
|
||||
if (op == JSOp::StrictEq || op == JSOp::StrictNe) {
|
||||
// obj !== undefined/null for all objects.
|
||||
EmitStoreBoolean(masm, op == JSOP_STRICTNE, output);
|
||||
EmitStoreBoolean(masm, op == JSOp::StrictNe, output);
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_EQ || op == JSOP_NE);
|
||||
MOZ_ASSERT(op == JSOp::Eq || op == JSOp::Ne);
|
||||
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
|
||||
Label done, emulatesUndefined;
|
||||
masm.branchIfObjectEmulatesUndefined(obj, scratch, failure->label(),
|
||||
&emulatesUndefined);
|
||||
EmitStoreBoolean(masm, op == JSOP_NE, output);
|
||||
EmitStoreBoolean(masm, op == JSOp::Ne, output);
|
||||
masm.jump(&done);
|
||||
masm.bind(&emulatesUndefined);
|
||||
EmitStoreBoolean(masm, op == JSOP_EQ, output);
|
||||
EmitStoreBoolean(masm, op == JSOp::Eq, output);
|
||||
masm.bind(&done);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -3383,18 +3383,18 @@ void CodeGenerator::visitBinaryValueCache(LBinaryValueCache* lir) {
|
|||
JSOp jsop = JSOp(*lir->mirRaw()->toInstruction()->resumePoint()->pc());
|
||||
|
||||
switch (jsop) {
|
||||
case JSOP_ADD:
|
||||
case JSOP_SUB:
|
||||
case JSOP_MUL:
|
||||
case JSOP_DIV:
|
||||
case JSOP_MOD:
|
||||
case JSOP_POW:
|
||||
case JSOP_BITAND:
|
||||
case JSOP_BITOR:
|
||||
case JSOP_BITXOR:
|
||||
case JSOP_LSH:
|
||||
case JSOP_RSH:
|
||||
case JSOP_URSH: {
|
||||
case JSOp::Add:
|
||||
case JSOp::Sub:
|
||||
case JSOp::Mul:
|
||||
case JSOp::Div:
|
||||
case JSOp::Mod:
|
||||
case JSOp::Pow:
|
||||
case JSOp::BitAnd:
|
||||
case JSOp::BitOr:
|
||||
case JSOp::BitXor:
|
||||
case JSOp::Lsh:
|
||||
case JSOp::Rsh:
|
||||
case JSOp::Ursh: {
|
||||
IonBinaryArithIC ic(liveRegs, lhs, rhs, output);
|
||||
addIC(lir, allocateIC(ic));
|
||||
return;
|
||||
|
@ -3415,14 +3415,14 @@ void CodeGenerator::visitBinaryBoolCache(LBinaryBoolCache* lir) {
|
|||
JSOp jsop = JSOp(*lir->mirRaw()->toInstruction()->resumePoint()->pc());
|
||||
|
||||
switch (jsop) {
|
||||
case JSOP_LT:
|
||||
case JSOP_LE:
|
||||
case JSOP_GT:
|
||||
case JSOP_GE:
|
||||
case JSOP_EQ:
|
||||
case JSOP_NE:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOP_STRICTNE: {
|
||||
case JSOp::Lt:
|
||||
case JSOp::Le:
|
||||
case JSOp::Gt:
|
||||
case JSOp::Ge:
|
||||
case JSOp::Eq:
|
||||
case JSOp::Ne:
|
||||
case JSOp::StrictEq:
|
||||
case JSOp::StrictNe: {
|
||||
IonCompareIC ic(liveRegs, lhs, rhs, output);
|
||||
addIC(lir, allocateIC(ic));
|
||||
return;
|
||||
|
@ -8044,47 +8044,47 @@ void CodeGenerator::visitBinaryV(LBinaryV* lir) {
|
|||
using Fn = bool (*)(JSContext*, MutableHandleValue, MutableHandleValue,
|
||||
MutableHandleValue);
|
||||
switch (lir->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
callVM<Fn, js::AddValues>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
callVM<Fn, js::SubValues>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
callVM<Fn, js::MulValues>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
callVM<Fn, js::DivValues>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_MOD:
|
||||
case JSOp::Mod:
|
||||
callVM<Fn, js::ModValues>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
callVM<Fn, js::BitAnd>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
callVM<Fn, js::BitOr>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
callVM<Fn, js::BitXor>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
callVM<Fn, js::BitLsh>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
callVM<Fn, js::BitRsh>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
callVM<Fn, js::UrshValues>(lir);
|
||||
break;
|
||||
|
||||
|
@ -8100,28 +8100,28 @@ void CodeGenerator::emitCompareS(LInstruction* lir, JSOp op, Register left,
|
|||
OutOfLineCode* ool = nullptr;
|
||||
|
||||
using Fn = bool (*)(JSContext*, HandleString, HandleString, bool*);
|
||||
if (op == JSOP_EQ || op == JSOP_STRICTEQ) {
|
||||
if (op == JSOp::Eq || op == JSOp::StrictEq) {
|
||||
ool = oolCallVM<Fn, jit::StringsEqual<EqualityKind::Equal>>(
|
||||
lir, ArgList(left, right), StoreRegisterTo(output));
|
||||
} else if (op == JSOP_NE || op == JSOP_STRICTNE) {
|
||||
} else if (op == JSOp::Ne || op == JSOp::StrictNe) {
|
||||
ool = oolCallVM<Fn, jit::StringsEqual<EqualityKind::NotEqual>>(
|
||||
lir, ArgList(left, right), StoreRegisterTo(output));
|
||||
} else if (op == JSOP_LT) {
|
||||
} else if (op == JSOp::Lt) {
|
||||
ool = oolCallVM<Fn, jit::StringsCompare<ComparisonKind::LessThan>>(
|
||||
lir, ArgList(left, right), StoreRegisterTo(output));
|
||||
} else if (op == JSOP_LE) {
|
||||
} else if (op == JSOp::Le) {
|
||||
// Push the operands in reverse order for JSOp::Le:
|
||||
// - |left <= right| is implemented as |right >= left|.
|
||||
ool =
|
||||
oolCallVM<Fn, jit::StringsCompare<ComparisonKind::GreaterThanOrEqual>>(
|
||||
lir, ArgList(right, left), StoreRegisterTo(output));
|
||||
} else if (op == JSOP_GT) {
|
||||
} else if (op == JSOp::Gt) {
|
||||
// Push the operands in reverse order for JSOp::Gt:
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
ool = oolCallVM<Fn, jit::StringsCompare<ComparisonKind::LessThan>>(
|
||||
lir, ArgList(right, left), StoreRegisterTo(output));
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_GE);
|
||||
MOZ_ASSERT(op == JSOp::Ge);
|
||||
ool =
|
||||
oolCallVM<Fn, jit::StringsCompare<ComparisonKind::GreaterThanOrEqual>>(
|
||||
lir, ArgList(left, right), StoreRegisterTo(output));
|
||||
|
@ -8134,7 +8134,7 @@ void CodeGenerator::emitCompareS(LInstruction* lir, JSOp op, Register left,
|
|||
|
||||
void CodeGenerator::visitCompareStrictS(LCompareStrictS* lir) {
|
||||
JSOp op = lir->mir()->jsop();
|
||||
MOZ_ASSERT(op == JSOP_STRICTEQ || op == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op == JSOp::StrictEq || op == JSOp::StrictNe);
|
||||
|
||||
const ValueOperand leftV = ToValue(lir, LCompareStrictS::Lhs);
|
||||
Register right = ToRegister(lir->right());
|
||||
|
@ -8143,7 +8143,7 @@ void CodeGenerator::visitCompareStrictS(LCompareStrictS* lir) {
|
|||
Label string, done;
|
||||
|
||||
masm.branchTestString(Assembler::Equal, leftV, &string);
|
||||
masm.move32(Imm32(op == JSOP_STRICTNE), output);
|
||||
masm.move32(Imm32(op == JSOp::StrictNe), output);
|
||||
masm.jump(&done);
|
||||
|
||||
masm.bind(&string);
|
||||
|
@ -8174,35 +8174,35 @@ void CodeGenerator::visitCompareVM(LCompareVM* lir) {
|
|||
using Fn =
|
||||
bool (*)(JSContext*, MutableHandleValue, MutableHandleValue, bool*);
|
||||
switch (lir->mir()->jsop()) {
|
||||
case JSOP_EQ:
|
||||
case JSOp::Eq:
|
||||
callVM<Fn, jit::LooselyEqual<EqualityKind::Equal>>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_NE:
|
||||
case JSOp::Ne:
|
||||
callVM<Fn, jit::LooselyEqual<EqualityKind::NotEqual>>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOp::StrictEq:
|
||||
callVM<Fn, jit::StrictlyEqual<EqualityKind::Equal>>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::StrictNe:
|
||||
callVM<Fn, jit::StrictlyEqual<EqualityKind::NotEqual>>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
callVM<Fn, jit::LessThan>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
callVM<Fn, jit::LessThanOrEqual>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
callVM<Fn, jit::GreaterThan>(lir);
|
||||
break;
|
||||
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
callVM<Fn, jit::GreaterThanOrEqual>(lir);
|
||||
break;
|
||||
|
||||
|
@ -8220,7 +8220,7 @@ void CodeGenerator::visitIsNullOrLikeUndefinedV(LIsNullOrLikeUndefinedV* lir) {
|
|||
const ValueOperand value = ToValue(lir, LIsNullOrLikeUndefinedV::Value);
|
||||
Register output = ToRegister(lir->output());
|
||||
|
||||
if (op == JSOP_EQ || op == JSOP_NE) {
|
||||
if (op == JSOp::Eq || op == JSOp::Ne) {
|
||||
MOZ_ASSERT(
|
||||
lir->mir()->lhs()->type() != MIRType::Object ||
|
||||
lir->mir()->operandMightEmulateUndefined(),
|
||||
|
@ -8274,18 +8274,18 @@ void CodeGenerator::visitIsNullOrLikeUndefinedV(LIsNullOrLikeUndefinedV* lir) {
|
|||
|
||||
// It's not null or undefined, and if it's an object it doesn't
|
||||
// emulate undefined, so it's not like undefined.
|
||||
masm.move32(Imm32(op == JSOP_NE), output);
|
||||
masm.move32(Imm32(op == JSOp::Ne), output);
|
||||
masm.jump(&done);
|
||||
|
||||
masm.bind(nullOrLikeUndefined);
|
||||
masm.move32(Imm32(op == JSOP_EQ), output);
|
||||
masm.move32(Imm32(op == JSOp::Eq), output);
|
||||
|
||||
// Both branches meet here.
|
||||
masm.bind(&done);
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(op == JSOP_STRICTEQ || op == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op == JSOp::StrictEq || op == JSOp::StrictNe);
|
||||
|
||||
Assembler::Condition cond = JSOpToCondition(compareType, op);
|
||||
if (compareType == MCompare::Compare_Null) {
|
||||
|
@ -8305,18 +8305,18 @@ void CodeGenerator::visitIsNullOrLikeUndefinedAndBranchV(
|
|||
const ValueOperand value =
|
||||
ToValue(lir, LIsNullOrLikeUndefinedAndBranchV::Value);
|
||||
|
||||
if (op == JSOP_EQ || op == JSOP_NE) {
|
||||
if (op == JSOp::Eq || op == JSOp::Ne) {
|
||||
MBasicBlock* ifTrue;
|
||||
MBasicBlock* ifFalse;
|
||||
|
||||
if (op == JSOP_EQ) {
|
||||
if (op == JSOp::Eq) {
|
||||
ifTrue = lir->ifTrue();
|
||||
ifFalse = lir->ifFalse();
|
||||
} else {
|
||||
// Swap branches.
|
||||
ifTrue = lir->ifFalse();
|
||||
ifFalse = lir->ifTrue();
|
||||
op = JSOP_EQ;
|
||||
op = JSOp::Eq;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(
|
||||
|
@ -8363,7 +8363,7 @@ void CodeGenerator::visitIsNullOrLikeUndefinedAndBranchV(
|
|||
}
|
||||
}
|
||||
|
||||
MOZ_ASSERT(op == JSOP_STRICTEQ || op == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op == JSOp::StrictEq || op == JSOp::StrictNe);
|
||||
|
||||
Assembler::Condition cond = JSOpToCondition(compareType, op);
|
||||
if (compareType == MCompare::Compare_Null) {
|
||||
|
@ -8381,8 +8381,9 @@ void CodeGenerator::visitIsNullOrLikeUndefinedT(LIsNullOrLikeUndefinedT* lir) {
|
|||
MOZ_ASSERT(lhsType == MIRType::Object || lhsType == MIRType::ObjectOrNull);
|
||||
|
||||
JSOp op = lir->mir()->jsop();
|
||||
MOZ_ASSERT(lhsType == MIRType::ObjectOrNull || op == JSOP_EQ || op == JSOP_NE,
|
||||
"Strict equality should have been folded");
|
||||
MOZ_ASSERT(
|
||||
lhsType == MIRType::ObjectOrNull || op == JSOp::Eq || op == JSOp::Ne,
|
||||
"Strict equality should have been folded");
|
||||
|
||||
MOZ_ASSERT(lhsType == MIRType::ObjectOrNull ||
|
||||
lir->mir()->operandMightEmulateUndefined(),
|
||||
|
@ -8392,7 +8393,7 @@ void CodeGenerator::visitIsNullOrLikeUndefinedT(LIsNullOrLikeUndefinedT* lir) {
|
|||
Register objreg = ToRegister(lir->input());
|
||||
Register output = ToRegister(lir->output());
|
||||
|
||||
if ((op == JSOP_EQ || op == JSOP_NE) &&
|
||||
if ((op == JSOp::Eq || op == JSOp::Ne) &&
|
||||
lir->mir()->operandMightEmulateUndefined()) {
|
||||
OutOfLineTestObjectWithLabels* ool =
|
||||
new (alloc()) OutOfLineTestObjectWithLabels();
|
||||
|
@ -8410,11 +8411,11 @@ void CodeGenerator::visitIsNullOrLikeUndefinedT(LIsNullOrLikeUndefinedT* lir) {
|
|||
|
||||
Label done;
|
||||
|
||||
masm.move32(Imm32(op == JSOP_NE), output);
|
||||
masm.move32(Imm32(op == JSOp::Ne), output);
|
||||
masm.jump(&done);
|
||||
|
||||
masm.bind(emulatesUndefined);
|
||||
masm.move32(Imm32(op == JSOP_EQ), output);
|
||||
masm.move32(Imm32(op == JSOp::Eq), output);
|
||||
masm.bind(&done);
|
||||
} else {
|
||||
MOZ_ASSERT(lhsType == MIRType::ObjectOrNull);
|
||||
|
@ -8423,11 +8424,11 @@ void CodeGenerator::visitIsNullOrLikeUndefinedT(LIsNullOrLikeUndefinedT* lir) {
|
|||
|
||||
masm.branchTestPtr(Assembler::Zero, objreg, objreg, &isNull);
|
||||
|
||||
masm.move32(Imm32(op == JSOP_NE || op == JSOP_STRICTNE), output);
|
||||
masm.move32(Imm32(op == JSOp::Ne || op == JSOp::StrictNe), output);
|
||||
masm.jump(&done);
|
||||
|
||||
masm.bind(&isNull);
|
||||
masm.move32(Imm32(op == JSOP_EQ || op == JSOP_STRICTEQ), output);
|
||||
masm.move32(Imm32(op == JSOp::Eq || op == JSOp::StrictEq), output);
|
||||
|
||||
masm.bind(&done);
|
||||
}
|
||||
|
@ -8443,8 +8444,9 @@ void CodeGenerator::visitIsNullOrLikeUndefinedAndBranchT(
|
|||
MOZ_ASSERT(lhsType == MIRType::Object || lhsType == MIRType::ObjectOrNull);
|
||||
|
||||
JSOp op = lir->cmpMir()->jsop();
|
||||
MOZ_ASSERT(lhsType == MIRType::ObjectOrNull || op == JSOP_EQ || op == JSOP_NE,
|
||||
"Strict equality should have been folded");
|
||||
MOZ_ASSERT(
|
||||
lhsType == MIRType::ObjectOrNull || op == JSOp::Eq || op == JSOp::Ne,
|
||||
"Strict equality should have been folded");
|
||||
|
||||
MOZ_ASSERT(lhsType == MIRType::ObjectOrNull ||
|
||||
lir->cmpMir()->operandMightEmulateUndefined(),
|
||||
|
@ -8454,7 +8456,7 @@ void CodeGenerator::visitIsNullOrLikeUndefinedAndBranchT(
|
|||
MBasicBlock* ifTrue;
|
||||
MBasicBlock* ifFalse;
|
||||
|
||||
if (op == JSOP_EQ || op == JSOP_STRICTEQ) {
|
||||
if (op == JSOp::Eq || op == JSOp::StrictEq) {
|
||||
ifTrue = lir->ifTrue();
|
||||
ifFalse = lir->ifFalse();
|
||||
} else {
|
||||
|
@ -8465,7 +8467,7 @@ void CodeGenerator::visitIsNullOrLikeUndefinedAndBranchT(
|
|||
|
||||
Register input = ToRegister(lir->getOperand(0));
|
||||
|
||||
if ((op == JSOP_EQ || op == JSOP_NE) &&
|
||||
if ((op == JSOp::Eq || op == JSOp::Ne) &&
|
||||
lir->cmpMir()->operandMightEmulateUndefined()) {
|
||||
OutOfLineTestObject* ool = new (alloc()) OutOfLineTestObject();
|
||||
addOutOfLineCode(ool, lir->cmpMir());
|
||||
|
|
|
@ -187,7 +187,7 @@ class CompileInfo {
|
|||
mayReadFrameArgsDirectly_(script->mayReadFrameArgsDirectly()),
|
||||
trackRecordReplayProgress_(script->trackRecordReplayProgress()),
|
||||
inlineScriptTree_(inlineScriptTree) {
|
||||
MOZ_ASSERT_IF(osrPc, JSOp(*osrPc) == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT_IF(osrPc, JSOp(*osrPc) == JSOp::LoopHead);
|
||||
|
||||
// The function here can flow in from anywhere so look up the canonical
|
||||
// function to ensure that we do not try to embed a nursery pointer in
|
||||
|
@ -265,7 +265,7 @@ class CompileInfo {
|
|||
InlineScriptTree* inlineScriptTree() const { return inlineScriptTree_; }
|
||||
|
||||
bool hasOsrAt(jsbytecode* pc) const {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::LoopHead);
|
||||
return pc == osrPc();
|
||||
}
|
||||
|
||||
|
|
|
@ -2276,7 +2276,7 @@ static MethodStatus BaselineCanEnterAtBranch(JSContext* cx, HandleScript script,
|
|||
uint32_t osrFrameSize,
|
||||
jsbytecode* pc) {
|
||||
MOZ_ASSERT(jit::IsIonEnabled(cx));
|
||||
MOZ_ASSERT((JSOp)*pc == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT((JSOp)*pc == JSOp::LoopHead);
|
||||
|
||||
// Skip if the script has been disabled.
|
||||
if (!script->canIonCompile()) {
|
||||
|
@ -2352,7 +2352,7 @@ static bool IonCompileScriptForBaseline(JSContext* cx, BaselineFrame* frame,
|
|||
MOZ_ASSERT(frame->debugFrameSize() == frameSize);
|
||||
|
||||
RootedScript script(cx, frame->script());
|
||||
bool isLoopHead = JSOp(*pc) == JSOP_LOOPHEAD;
|
||||
bool isLoopHead = JSOp(*pc) == JSOp::LoopHead;
|
||||
|
||||
// The Baseline JIT code checks for Ion disabled or compiling off-thread.
|
||||
MOZ_ASSERT(script->canIonCompile());
|
||||
|
@ -2506,7 +2506,7 @@ bool jit::IonCompileScriptForBaselineOSR(JSContext* cx, BaselineFrame* frame,
|
|||
*infoPtr = nullptr;
|
||||
|
||||
MOZ_ASSERT(frame->debugFrameSize() == frameSize);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::LoopHead);
|
||||
|
||||
if (!IonCompileScriptForBaseline(cx, frame, frameSize, pc)) {
|
||||
return false;
|
||||
|
|
|
@ -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 || JSOp(*rp->pc()) != JSOp::Pop) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2368,11 +2368,11 @@ static bool CanCompareRegExp(MCompare* compare, MDefinition* def) {
|
|||
|
||||
JSOp op = compare->jsop();
|
||||
// Strict equality comparison won't invoke @@toPrimitive.
|
||||
if (op == JSOP_STRICTEQ || op == JSOP_STRICTNE) {
|
||||
if (op == JSOp::StrictEq || op == JSOp::StrictNe) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (op != JSOP_EQ && op != JSOP_NE) {
|
||||
if (op != JSOp::Eq && op != JSOp::Ne) {
|
||||
// Relational comparison always invoke @@toPrimitive.
|
||||
MOZ_ASSERT(IsRelationalOp(op));
|
||||
return false;
|
||||
|
@ -3578,20 +3578,20 @@ bool jit::ExtractLinearInequality(MTest* test, BranchDirection direction,
|
|||
|
||||
// Normalize operations to use <= or >=.
|
||||
switch (jsop) {
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
*plessEqual = true;
|
||||
break;
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
/* x < y ==> x + 1 <= y */
|
||||
if (!SafeAdd(lsum.constant, 1, &lsum.constant)) {
|
||||
return false;
|
||||
}
|
||||
*plessEqual = true;
|
||||
break;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
*plessEqual = false;
|
||||
break;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
/* x > y ==> x - 1 >= y */
|
||||
if (!SafeSub(lsum.constant, 1, &lsum.constant)) {
|
||||
return false;
|
||||
|
@ -4328,7 +4328,7 @@ MCompare* jit::ConvertLinearInequality(TempAllocator& alloc, MBasicBlock* block,
|
|||
}
|
||||
|
||||
MDefinition* lhsDef = nullptr;
|
||||
JSOp op = JSOP_GE;
|
||||
JSOp op = JSOp::Ge;
|
||||
|
||||
do {
|
||||
if (!lhs.numTerms()) {
|
||||
|
@ -4344,7 +4344,7 @@ MCompare* jit::ConvertLinearInequality(TempAllocator& alloc, MBasicBlock* block,
|
|||
}
|
||||
|
||||
if (lhs.constant() == -1) {
|
||||
op = JSOP_GT;
|
||||
op = JSOp::Gt;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -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 (JSOp(*ins->toCall()->resumePoint()->pc()) == JSOp::FunApply &&
|
||||
ins->toCall()->numActualArgs() == 2 &&
|
||||
index == MCall::IndexOfArgument(1)) {
|
||||
*argumentsContentsObserved = true;
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -121,9 +121,9 @@ class PendingEdge {
|
|||
private:
|
||||
MBasicBlock* block_;
|
||||
Kind kind_;
|
||||
JSOp testOp_ = JSOP_UNDEFINED;
|
||||
JSOp testOp_ = JSOp::Undefined;
|
||||
|
||||
PendingEdge(MBasicBlock* block, Kind kind, JSOp testOp = JSOP_UNDEFINED)
|
||||
PendingEdge(MBasicBlock* block, Kind kind, JSOp testOp = JSOp::Undefined)
|
||||
: block_(block), kind_(kind), testOp_(testOp) {}
|
||||
|
||||
public:
|
||||
|
@ -1428,7 +1428,7 @@ class CallInfo {
|
|||
constructing_(constructing),
|
||||
ignoresReturnValue_(ignoresReturnValue),
|
||||
setter_(false),
|
||||
apply_(JSOp(*pc) == JSOP_FUNAPPLY) {}
|
||||
apply_(JSOp(*pc) == JSOp::FunApply) {}
|
||||
|
||||
MOZ_MUST_USE bool init(CallInfo& callInfo) {
|
||||
MOZ_ASSERT(constructing_ == callInfo.constructing());
|
||||
|
|
|
@ -1184,7 +1184,7 @@ bool IonCacheIRCompiler::emitCompareStringResult() {
|
|||
// Push the operands in reverse order for JSOp::Le and JSOp::Gt:
|
||||
// - |left <= right| is implemented as |right >= left|.
|
||||
// - |left > right| is implemented as |right < left|.
|
||||
if (op == JSOP_LE || op == JSOP_GT) {
|
||||
if (op == JSOp::Le || op == JSOp::Gt) {
|
||||
masm.Push(left);
|
||||
masm.Push(right);
|
||||
} else {
|
||||
|
@ -1193,14 +1193,14 @@ bool IonCacheIRCompiler::emitCompareStringResult() {
|
|||
}
|
||||
|
||||
using Fn = bool (*)(JSContext*, HandleString, HandleString, bool*);
|
||||
if (op == JSOP_EQ || op == JSOP_STRICTEQ) {
|
||||
if (op == JSOp::Eq || op == JSOp::StrictEq) {
|
||||
callVM<Fn, jit::StringsEqual<EqualityKind::Equal>>(masm);
|
||||
} else if (op == JSOP_NE || op == JSOP_STRICTNE) {
|
||||
} else if (op == JSOp::Ne || op == JSOp::StrictNe) {
|
||||
callVM<Fn, jit::StringsEqual<EqualityKind::NotEqual>>(masm);
|
||||
} else if (op == JSOP_LT || op == JSOP_GT) {
|
||||
} else if (op == JSOp::Lt || op == JSOp::Gt) {
|
||||
callVM<Fn, jit::StringsCompare<ComparisonKind::LessThan>>(masm);
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_LE || op == JSOP_GE);
|
||||
MOZ_ASSERT(op == JSOp::Le || op == JSOp::Ge);
|
||||
callVM<Fn, jit::StringsCompare<ComparisonKind::GreaterThanOrEqual>>(masm);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 (JSOp(*pc) == JSOp::InitElemInc || JSOp(*pc) == JSOp::InitElemArray) {
|
||||
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 (JSOp(*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 (JSOp(*GetNextPc(pc)) == JSOp::Typeof) {
|
||||
if (!FetchName<GetNameMode::TypeOf>(cx, obj, holder, name, prop, res)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -520,25 +520,25 @@ bool IonUnaryArithIC::update(JSContext* cx, HandleScript outerScript,
|
|||
// below.
|
||||
RootedValue valCopy(cx, val);
|
||||
switch (op) {
|
||||
case JSOP_BITNOT: {
|
||||
case JSOp::BitNot: {
|
||||
if (!BitNot(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_NEG: {
|
||||
case JSOp::Neg: {
|
||||
if (!NegOperation(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_INC: {
|
||||
case JSOp::Inc: {
|
||||
if (!IncOperation(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_DEC: {
|
||||
case JSOp::Dec: {
|
||||
if (!DecOperation(cx, &valCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -570,63 +570,63 @@ bool IonBinaryArithIC::update(JSContext* cx, HandleScript outerScript,
|
|||
|
||||
// Perform the compare operation.
|
||||
switch (op) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
// Do an add.
|
||||
if (!AddValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
if (!SubValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
if (!MulValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
if (!DivValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_MOD:
|
||||
case JSOp::Mod:
|
||||
if (!ModValues(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_BITOR: {
|
||||
case JSOp::BitOr: {
|
||||
if (!BitOr(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_BITXOR: {
|
||||
case JSOp::BitXor: {
|
||||
if (!BitXor(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_BITAND: {
|
||||
case JSOp::BitAnd: {
|
||||
if (!BitAnd(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_LSH: {
|
||||
case JSOp::Lsh: {
|
||||
if (!BitLsh(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_RSH: {
|
||||
case JSOp::Rsh: {
|
||||
if (!BitRsh(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_URSH: {
|
||||
case JSOp::Ursh: {
|
||||
if (!UrshOperation(cx, &lhsCopy, &rhsCopy, ret)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -658,42 +658,42 @@ bool IonCompareIC::update(JSContext* cx, HandleScript outerScript,
|
|||
|
||||
// Perform the compare operation.
|
||||
switch (op) {
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
if (!LessThan(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
if (!LessThanOrEqual(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
if (!GreaterThan(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
if (!GreaterThanOrEqual(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_EQ:
|
||||
case JSOp::Eq:
|
||||
if (!LooselyEqual<EqualityKind::Equal>(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_NE:
|
||||
case JSOp::Ne:
|
||||
if (!LooselyEqual<EqualityKind::NotEqual>(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOp::StrictEq:
|
||||
if (!StrictlyEqual<EqualityKind::Equal>(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::StrictNe:
|
||||
if (!StrictlyEqual<EqualityKind::NotEqual>(cx, &lhsCopy, &rhsCopy, res)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -80,11 +80,11 @@ void OptimizationInfo::initWasmOptimizationInfo() {
|
|||
uint32_t OptimizationInfo::compilerWarmUpThreshold(JSScript* script,
|
||||
jsbytecode* pc) const {
|
||||
MOZ_ASSERT(pc == nullptr || pc == script->code() ||
|
||||
JSOp(*pc) == JSOP_LOOPHEAD);
|
||||
JSOp(*pc) == JSOp::LoopHead);
|
||||
|
||||
// The script must not start with a LoopHead op or the code below would be
|
||||
// wrong. See bug 1602681.
|
||||
MOZ_ASSERT_IF(pc && JSOp(*pc) == JSOP_LOOPHEAD, pc > script->code());
|
||||
MOZ_ASSERT_IF(pc && JSOp(*pc) == JSOp::LoopHead, pc > script->code());
|
||||
|
||||
if (pc == script->code()) {
|
||||
pc = nullptr;
|
||||
|
@ -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() || JSOp(*pc) == JSOp::LoopHead);
|
||||
|
||||
uint32_t threshold = compilerWarmUpThreshold(script, pc);
|
||||
if (JSOp(*pc) != JSOP_LOOPHEAD || JitOptions.eagerIonCompilation()) {
|
||||
if (JSOp(*pc) != JSOp::LoopHead || JitOptions.eagerIonCompilation()) {
|
||||
return threshold;
|
||||
}
|
||||
|
||||
|
|
|
@ -2011,10 +2011,10 @@ void InlineFrameIterator::findNextFrame() {
|
|||
MOZ_ASSERT(IsIonInlinableOp(JSOp(*pc_)));
|
||||
|
||||
// Recover the number of actual arguments from the script.
|
||||
if (JSOp(*pc_) != JSOP_FUNAPPLY) {
|
||||
if (JSOp(*pc_) != JSOp::FunApply) {
|
||||
numActualArgs_ = GET_ARGC(pc_);
|
||||
}
|
||||
if (JSOp(*pc_) == JSOP_FUNCALL) {
|
||||
if (JSOp(*pc_) == JSOp::FunCall) {
|
||||
MOZ_ASSERT(GET_ARGC(pc_) > 0);
|
||||
numActualArgs_ = GET_ARGC(pc_) - 1;
|
||||
} else if (IsGetPropPC(pc_) || IsGetElemPC(pc_)) {
|
||||
|
|
|
@ -1202,13 +1202,13 @@ void LIRGenerator::visitBitAnd(MBitAnd* ins) {
|
|||
if (CanEmitBitAndAtUses(ins)) {
|
||||
emitAtUses(ins);
|
||||
} else {
|
||||
lowerBitOp(JSOP_BITAND, ins);
|
||||
lowerBitOp(JSOp::BitAnd, ins);
|
||||
}
|
||||
}
|
||||
|
||||
void LIRGenerator::visitBitOr(MBitOr* ins) { lowerBitOp(JSOP_BITOR, ins); }
|
||||
void LIRGenerator::visitBitOr(MBitOr* ins) { lowerBitOp(JSOp::BitOr, ins); }
|
||||
|
||||
void LIRGenerator::visitBitXor(MBitXor* ins) { lowerBitOp(JSOP_BITXOR, ins); }
|
||||
void LIRGenerator::visitBitXor(MBitXor* ins) { lowerBitOp(JSOp::BitXor, ins); }
|
||||
|
||||
void LIRGenerator::lowerShiftOp(JSOp op, MShiftInstruction* ins) {
|
||||
MDefinition* lhs = ins->getOperand(0);
|
||||
|
@ -1218,13 +1218,13 @@ void LIRGenerator::lowerShiftOp(JSOp op, MShiftInstruction* ins) {
|
|||
MOZ_ASSERT(rhs->type() == MIRType::Int32);
|
||||
|
||||
if (ins->type() == MIRType::Double) {
|
||||
MOZ_ASSERT(op == JSOP_URSH);
|
||||
MOZ_ASSERT(op == JSOp::Ursh);
|
||||
lowerUrshD(ins->toUrsh());
|
||||
return;
|
||||
}
|
||||
|
||||
LShiftI* lir = new (alloc()) LShiftI(op);
|
||||
if (op == JSOP_URSH) {
|
||||
if (op == JSOp::Ursh) {
|
||||
if (ins->toUrsh()->fallible()) {
|
||||
assignSnapshot(lir, Bailout_OverflowInvalidate);
|
||||
}
|
||||
|
@ -1243,11 +1243,11 @@ void LIRGenerator::lowerShiftOp(JSOp op, MShiftInstruction* ins) {
|
|||
lowerBinaryV(op, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::visitLsh(MLsh* ins) { lowerShiftOp(JSOP_LSH, ins); }
|
||||
void LIRGenerator::visitLsh(MLsh* ins) { lowerShiftOp(JSOp::Lsh, ins); }
|
||||
|
||||
void LIRGenerator::visitRsh(MRsh* ins) { lowerShiftOp(JSOP_RSH, ins); }
|
||||
void LIRGenerator::visitRsh(MRsh* ins) { lowerShiftOp(JSOp::Rsh, ins); }
|
||||
|
||||
void LIRGenerator::visitUrsh(MUrsh* ins) { lowerShiftOp(JSOP_URSH, ins); }
|
||||
void LIRGenerator::visitUrsh(MUrsh* ins) { lowerShiftOp(JSOp::Ursh, ins); }
|
||||
|
||||
void LIRGenerator::visitSignExtendInt32(MSignExtendInt32* ins) {
|
||||
LInstructionHelper<1, 1, 0>* lir;
|
||||
|
@ -1641,18 +1641,18 @@ void LIRGenerator::visitAdd(MAdd* ins) {
|
|||
if (ins->specialization() == MIRType::Double) {
|
||||
MOZ_ASSERT(lhs->type() == MIRType::Double);
|
||||
ReorderCommutative(&lhs, &rhs, ins);
|
||||
lowerForFPU(new (alloc()) LMathD(JSOP_ADD), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathD(JSOp::Add), ins, lhs, rhs);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ins->specialization() == MIRType::Float32) {
|
||||
MOZ_ASSERT(lhs->type() == MIRType::Float32);
|
||||
ReorderCommutative(&lhs, &rhs, ins);
|
||||
lowerForFPU(new (alloc()) LMathF(JSOP_ADD), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathF(JSOp::Add), ins, lhs, rhs);
|
||||
return;
|
||||
}
|
||||
|
||||
lowerBinaryV(JSOP_ADD, ins);
|
||||
lowerBinaryV(JSOp::Add, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::visitSub(MSub* ins) {
|
||||
|
@ -1683,17 +1683,17 @@ void LIRGenerator::visitSub(MSub* ins) {
|
|||
|
||||
if (ins->specialization() == MIRType::Double) {
|
||||
MOZ_ASSERT(lhs->type() == MIRType::Double);
|
||||
lowerForFPU(new (alloc()) LMathD(JSOP_SUB), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathD(JSOp::Sub), ins, lhs, rhs);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ins->specialization() == MIRType::Float32) {
|
||||
MOZ_ASSERT(lhs->type() == MIRType::Float32);
|
||||
lowerForFPU(new (alloc()) LMathF(JSOP_SUB), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathF(JSOp::Sub), ins, lhs, rhs);
|
||||
return;
|
||||
}
|
||||
|
||||
lowerBinaryV(JSOP_SUB, ins);
|
||||
lowerBinaryV(JSOp::Sub, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::visitMul(MMul* ins) {
|
||||
|
@ -1733,7 +1733,7 @@ void LIRGenerator::visitMul(MMul* ins) {
|
|||
rhs->toConstant()->toDouble() == -1.0) {
|
||||
defineReuseInput(new (alloc()) LNegD(useRegisterAtStart(lhs)), ins, 0);
|
||||
} else {
|
||||
lowerForFPU(new (alloc()) LMathD(JSOP_MUL), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathD(JSOp::Mul), ins, lhs, rhs);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1747,12 +1747,12 @@ void LIRGenerator::visitMul(MMul* ins) {
|
|||
rhs->toConstant()->toFloat32() == -1.0f) {
|
||||
defineReuseInput(new (alloc()) LNegF(useRegisterAtStart(lhs)), ins, 0);
|
||||
} else {
|
||||
lowerForFPU(new (alloc()) LMathF(JSOP_MUL), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathF(JSOp::Mul), ins, lhs, rhs);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
lowerBinaryV(JSOP_MUL, ins);
|
||||
lowerBinaryV(JSOp::Mul, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::visitDiv(MDiv* ins) {
|
||||
|
@ -1774,17 +1774,17 @@ void LIRGenerator::visitDiv(MDiv* ins) {
|
|||
|
||||
if (ins->specialization() == MIRType::Double) {
|
||||
MOZ_ASSERT(lhs->type() == MIRType::Double);
|
||||
lowerForFPU(new (alloc()) LMathD(JSOP_DIV), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathD(JSOp::Div), ins, lhs, rhs);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ins->specialization() == MIRType::Float32) {
|
||||
MOZ_ASSERT(lhs->type() == MIRType::Float32);
|
||||
lowerForFPU(new (alloc()) LMathF(JSOP_DIV), ins, lhs, rhs);
|
||||
lowerForFPU(new (alloc()) LMathF(JSOp::Div), ins, lhs, rhs);
|
||||
return;
|
||||
}
|
||||
|
||||
lowerBinaryV(JSOP_DIV, ins);
|
||||
lowerBinaryV(JSOp::Div, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::visitMod(MMod* ins) {
|
||||
|
@ -1821,7 +1821,7 @@ void LIRGenerator::visitMod(MMod* ins) {
|
|||
return;
|
||||
}
|
||||
|
||||
lowerBinaryV(JSOP_MOD, ins);
|
||||
lowerBinaryV(JSOp::Mod, ins);
|
||||
}
|
||||
|
||||
void LIRGenerator::lowerBinaryV(JSOp op, MBinaryInstruction* ins) {
|
||||
|
@ -2984,7 +2984,7 @@ void LIRGenerator::visitNot(MNot* ins) {
|
|||
case MIRType::Boolean: {
|
||||
MConstant* cons = MConstant::New(alloc(), Int32Value(1));
|
||||
ins->block()->insertBefore(ins, cons);
|
||||
lowerForALU(new (alloc()) LBitOpI(JSOP_BITXOR), ins, op, cons);
|
||||
lowerForALU(new (alloc()) LBitOpI(JSOp::BitXor), ins, op, cons);
|
||||
break;
|
||||
}
|
||||
case MIRType::Int32:
|
||||
|
@ -5106,8 +5106,8 @@ void LIRGenerator::visitWasmSelect(MWasmSelect* ins) {
|
|||
MCompare::CompareType compTy = comp->compareType();
|
||||
// We don't currently generate any other JSOPs for the comparison, and if
|
||||
// that changes, we want to know about it. Hence this assertion.
|
||||
MOZ_ASSERT(jsop == JSOP_EQ || jsop == JSOP_NE || jsop == JSOP_LT ||
|
||||
jsop == JSOP_GT || jsop == JSOP_LE || jsop == JSOP_GE);
|
||||
MOZ_ASSERT(jsop == JSOp::Eq || jsop == JSOp::Ne || jsop == JSOp::Lt ||
|
||||
jsop == JSOp::Gt || jsop == JSOp::Le || jsop == JSOp::Ge);
|
||||
if (compTy == MCompare::Compare_Int32 ||
|
||||
compTy == MCompare::Compare_UInt32) {
|
||||
auto* lir = new (alloc()) LWasmCompareAndSelect(
|
||||
|
|
|
@ -2802,7 +2802,7 @@ IonBuilder::InliningResult IonBuilder::inlineObjectIs(CallInfo& callInfo) {
|
|||
pushConstant(BooleanValue(false));
|
||||
} else if (strictEq) {
|
||||
// Specialize |Object.is(lhs, rhs)| as |lhs === rhs|.
|
||||
MOZ_TRY(jsop_compare(JSOP_STRICTEQ, left, right));
|
||||
MOZ_TRY(jsop_compare(JSOp::StrictEq, left, right));
|
||||
} else {
|
||||
MSameValue* ins = MSameValue::New(alloc(), left, right);
|
||||
|
||||
|
|
|
@ -3432,8 +3432,8 @@ MCompare::CompareType MCompare::determineCompareType(JSOp op, MDefinition* left,
|
|||
MIRType lhs = left->type();
|
||||
MIRType rhs = right->type();
|
||||
|
||||
bool looseEq = op == JSOP_EQ || op == JSOP_NE;
|
||||
bool strictEq = op == JSOP_STRICTEQ || op == JSOP_STRICTNE;
|
||||
bool looseEq = op == JSOp::Eq || op == JSOp::Ne;
|
||||
bool strictEq = op == JSOp::StrictEq || op == JSOp::StrictNe;
|
||||
bool relationalEq = !(looseEq || strictEq);
|
||||
|
||||
// Comparisons on unsigned integers may be treated as UInt32.
|
||||
|
@ -4146,7 +4146,7 @@ bool MCompare::tryFoldEqualOperands(bool* result) {
|
|||
// However NaN !== NaN is true! So we spend some time trying
|
||||
// to eliminate this case.
|
||||
|
||||
if (jsop() != JSOP_STRICTEQ && jsop() != JSOP_STRICTNE) {
|
||||
if (jsop() != JSOp::StrictEq && jsop() != JSOp::StrictNe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -4175,7 +4175,7 @@ bool MCompare::tryFoldEqualOperands(bool* result) {
|
|||
|
||||
lhs()->setGuardRangeBailoutsUnchecked();
|
||||
|
||||
*result = (jsop() == JSOP_STRICTEQ);
|
||||
*result = (jsop() == JSOp::StrictEq);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -4195,8 +4195,8 @@ bool MCompare::tryFoldTypeOf(bool* result) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (jsop() != JSOP_STRICTEQ && jsop() != JSOP_STRICTNE && jsop() != JSOP_EQ &&
|
||||
jsop() != JSOP_NE) {
|
||||
if (jsop() != JSOp::StrictEq && jsop() != JSOp::StrictNe &&
|
||||
jsop() != JSOp::Eq && jsop() != JSOp::Ne) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -4204,45 +4204,45 @@ bool MCompare::tryFoldTypeOf(bool* result) {
|
|||
if (constant->toString() == TypeName(JSTYPE_UNDEFINED, names)) {
|
||||
if (!typeOf->input()->mightBeType(MIRType::Undefined) &&
|
||||
!typeOf->inputMaybeCallableOrEmulatesUndefined()) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
} else if (constant->toString() == TypeName(JSTYPE_BOOLEAN, names)) {
|
||||
if (!typeOf->input()->mightBeType(MIRType::Boolean)) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
} else if (constant->toString() == TypeName(JSTYPE_NUMBER, names)) {
|
||||
if (!typeOf->input()->mightBeType(MIRType::Int32) &&
|
||||
!typeOf->input()->mightBeType(MIRType::Float32) &&
|
||||
!typeOf->input()->mightBeType(MIRType::Double)) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
} else if (constant->toString() == TypeName(JSTYPE_STRING, names)) {
|
||||
if (!typeOf->input()->mightBeType(MIRType::String)) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
} else if (constant->toString() == TypeName(JSTYPE_SYMBOL, names)) {
|
||||
if (!typeOf->input()->mightBeType(MIRType::Symbol)) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
} else if (constant->toString() == TypeName(JSTYPE_BIGINT, names)) {
|
||||
if (!typeOf->input()->mightBeType(MIRType::BigInt)) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
} else if (constant->toString() == TypeName(JSTYPE_OBJECT, names)) {
|
||||
if (!typeOf->input()->mightBeType(MIRType::Object) &&
|
||||
!typeOf->input()->mightBeType(MIRType::Null)) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
} else if (constant->toString() == TypeName(JSTYPE_FUNCTION, names)) {
|
||||
if (!typeOf->inputMaybeCallableOrEmulatesUndefined()) {
|
||||
*result = (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE);
|
||||
*result = (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -4263,26 +4263,26 @@ bool MCompare::tryFold(bool* result) {
|
|||
|
||||
if (compareType_ == Compare_Null || compareType_ == Compare_Undefined) {
|
||||
// The LHS is the value we want to test against null or undefined.
|
||||
if (op == JSOP_STRICTEQ || op == JSOP_STRICTNE) {
|
||||
if (op == JSOp::StrictEq || op == JSOp::StrictNe) {
|
||||
if (lhs()->type() == inputType()) {
|
||||
*result = (op == JSOP_STRICTEQ);
|
||||
*result = (op == JSOp::StrictEq);
|
||||
return true;
|
||||
}
|
||||
if (!lhs()->mightBeType(inputType())) {
|
||||
*result = (op == JSOP_STRICTNE);
|
||||
*result = (op == JSOp::StrictNe);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_EQ || op == JSOP_NE);
|
||||
MOZ_ASSERT(op == JSOp::Eq || op == JSOp::Ne);
|
||||
if (IsNullOrUndefined(lhs()->type())) {
|
||||
*result = (op == JSOP_EQ);
|
||||
*result = (op == JSOp::Eq);
|
||||
return true;
|
||||
}
|
||||
if (!lhs()->mightBeType(MIRType::Null) &&
|
||||
!lhs()->mightBeType(MIRType::Undefined) &&
|
||||
!(lhs()->mightBeType(MIRType::Object) &&
|
||||
operandMightEmulateUndefined())) {
|
||||
*result = (op == JSOP_NE);
|
||||
*result = (op == JSOp::Ne);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -4290,26 +4290,26 @@ bool MCompare::tryFold(bool* result) {
|
|||
}
|
||||
|
||||
if (compareType_ == Compare_Boolean) {
|
||||
MOZ_ASSERT(op == JSOP_STRICTEQ || op == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op == JSOp::StrictEq || op == JSOp::StrictNe);
|
||||
MOZ_ASSERT(rhs()->type() == MIRType::Boolean);
|
||||
MOZ_ASSERT(lhs()->type() != MIRType::Boolean,
|
||||
"Should use Int32 comparison");
|
||||
|
||||
if (!lhs()->mightBeType(MIRType::Boolean)) {
|
||||
*result = (op == JSOP_STRICTNE);
|
||||
*result = (op == JSOp::StrictNe);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (compareType_ == Compare_StrictString) {
|
||||
MOZ_ASSERT(op == JSOP_STRICTEQ || op == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(op == JSOp::StrictEq || op == JSOp::StrictNe);
|
||||
MOZ_ASSERT(rhs()->type() == MIRType::String);
|
||||
MOZ_ASSERT(lhs()->type() != MIRType::String,
|
||||
"Should use String comparison");
|
||||
|
||||
if (!lhs()->mightBeType(MIRType::String)) {
|
||||
*result = (op == JSOP_STRICTNE);
|
||||
*result = (op == JSOp::StrictNe);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -4321,19 +4321,19 @@ bool MCompare::tryFold(bool* result) {
|
|||
template <typename T>
|
||||
static bool FoldComparison(JSOp op, T left, T right) {
|
||||
switch (op) {
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
return left < right;
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
return left <= right;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
return left > right;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
return left >= right;
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOP_EQ:
|
||||
case JSOp::StrictEq:
|
||||
case JSOp::Eq:
|
||||
return left == right;
|
||||
case JSOP_STRICTNE:
|
||||
case JSOP_NE:
|
||||
case JSOp::StrictNe:
|
||||
case JSOp::Ne:
|
||||
return left != right;
|
||||
default:
|
||||
MOZ_CRASH("Unexpected op.");
|
||||
|
@ -4367,13 +4367,13 @@ bool MCompare::evaluateConstantOperands(TempAllocator& alloc, bool* result) {
|
|||
operand->getOperand(0)->type() == MIRType::Int32) {
|
||||
bool replaced = false;
|
||||
switch (jsop_) {
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
if (cte > INT32_MAX || cte < INT32_MIN) {
|
||||
*result = !((constant == lhs()) ^ (cte < INT32_MIN));
|
||||
replaced = true;
|
||||
}
|
||||
break;
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
if (constant == lhs()) {
|
||||
if (cte > INT32_MAX || cte <= INT32_MIN) {
|
||||
*result = (cte <= INT32_MIN);
|
||||
|
@ -4386,13 +4386,13 @@ bool MCompare::evaluateConstantOperands(TempAllocator& alloc, bool* result) {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
if (cte > INT32_MAX || cte < INT32_MIN) {
|
||||
*result = !((constant == rhs()) ^ (cte < INT32_MIN));
|
||||
replaced = true;
|
||||
}
|
||||
break;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
if (constant == lhs()) {
|
||||
if (cte >= INT32_MAX || cte < INT32_MIN) {
|
||||
*result = (cte >= INT32_MAX);
|
||||
|
@ -4405,15 +4405,15 @@ bool MCompare::evaluateConstantOperands(TempAllocator& alloc, bool* result) {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case JSOP_STRICTEQ: // Fall through.
|
||||
case JSOP_EQ:
|
||||
case JSOp::StrictEq: // Fall through.
|
||||
case JSOp::Eq:
|
||||
if (cte > INT32_MAX || cte < INT32_MIN) {
|
||||
*result = false;
|
||||
replaced = true;
|
||||
}
|
||||
break;
|
||||
case JSOP_STRICTNE: // Fall through.
|
||||
case JSOP_NE:
|
||||
case JSOp::StrictNe: // Fall through.
|
||||
case JSOp::Ne:
|
||||
if (cte > INT32_MAX || cte < INT32_MIN) {
|
||||
*result = true;
|
||||
replaced = true;
|
||||
|
@ -4519,20 +4519,20 @@ void MCompare::filtersUndefinedOrNull(bool trueBranch, MDefinition** subject,
|
|||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(jsop() == JSOP_STRICTNE || jsop() == JSOP_NE ||
|
||||
jsop() == JSOP_STRICTEQ || jsop() == JSOP_EQ);
|
||||
MOZ_ASSERT(jsop() == JSOp::StrictNe || jsop() == JSOp::Ne ||
|
||||
jsop() == JSOp::StrictEq || jsop() == JSOp::Eq);
|
||||
|
||||
// JSOp::*Ne only removes undefined/null from if/true branch
|
||||
if (!trueBranch && (jsop() == JSOP_STRICTNE || jsop() == JSOP_NE)) {
|
||||
if (!trueBranch && (jsop() == JSOp::StrictNe || jsop() == JSOp::Ne)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// JSOp::*Eq only removes undefined/null from else/false branch
|
||||
if (trueBranch && (jsop() == JSOP_STRICTEQ || jsop() == JSOP_EQ)) {
|
||||
if (trueBranch && (jsop() == JSOp::StrictEq || jsop() == JSOp::Eq)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (jsop() == JSOP_STRICTEQ || jsop() == JSOP_STRICTNE) {
|
||||
if (jsop() == JSOp::StrictEq || jsop() == JSOp::StrictNe) {
|
||||
*filtersUndefined = compareType() == Compare_Undefined;
|
||||
*filtersNull = compareType() == Compare_Null;
|
||||
} else {
|
||||
|
|
|
@ -3225,7 +3225,7 @@ class MCompare : public MBinaryInstruction, public ComparePolicy::Data {
|
|||
bool operandsAreNeverNaN() const { return operandsAreNeverNaN_; }
|
||||
AliasSet getAliasSet() const override {
|
||||
// Strict equality is never effectful.
|
||||
if (jsop_ == JSOP_STRICTEQ || jsop_ == JSOP_STRICTNE) {
|
||||
if (jsop_ == JSOp::StrictEq || jsop_ == JSOp::StrictNe) {
|
||||
return AliasSet::None();
|
||||
}
|
||||
if (compareType_ == Compare_Unknown) {
|
||||
|
|
|
@ -1239,8 +1239,8 @@ void MacroAssembler::compareStrings(JSOp op, Register left, Register right,
|
|||
// If operands point to the same instance, the strings are trivially equal.
|
||||
branchPtr(Assembler::NotEqual, left, right,
|
||||
IsEqualityOp(op) ? ¬PointerEqual : fail);
|
||||
move32(Imm32(op == JSOP_EQ || op == JSOP_STRICTEQ || op == JSOP_LE ||
|
||||
op == JSOP_GE),
|
||||
move32(Imm32(op == JSOp::Eq || op == JSOp::StrictEq || op == JSOp::Le ||
|
||||
op == JSOp::Ge),
|
||||
result);
|
||||
|
||||
if (IsEqualityOp(op)) {
|
||||
|
@ -1265,7 +1265,7 @@ void MacroAssembler::compareStrings(JSOp op, Register left, Register right,
|
|||
result, fail);
|
||||
|
||||
bind(&setNotEqualResult);
|
||||
move32(Imm32(op == JSOP_NE || op == JSOP_STRICTNE), result);
|
||||
move32(Imm32(op == JSOp::Ne || op == JSOp::StrictNe), result);
|
||||
|
||||
bind(&done);
|
||||
}
|
||||
|
|
|
@ -3265,19 +3265,19 @@ inline void MacroAssembler::implicitPop(uint32_t bytes) {
|
|||
|
||||
static inline Assembler::DoubleCondition JSOpToDoubleCondition(JSOp op) {
|
||||
switch (op) {
|
||||
case JSOP_EQ:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOp::Eq:
|
||||
case JSOp::StrictEq:
|
||||
return Assembler::DoubleEqual;
|
||||
case JSOP_NE:
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::Ne:
|
||||
case JSOp::StrictNe:
|
||||
return Assembler::DoubleNotEqualOrUnordered;
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
return Assembler::DoubleLessThan;
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
return Assembler::DoubleLessThanOrEqual;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
return Assembler::DoubleGreaterThan;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
return Assembler::DoubleGreaterThanOrEqual;
|
||||
default:
|
||||
MOZ_CRASH("Unexpected comparison operation");
|
||||
|
@ -3290,38 +3290,38 @@ static inline Assembler::DoubleCondition JSOpToDoubleCondition(JSOp op) {
|
|||
static inline Assembler::Condition JSOpToCondition(JSOp op, bool isSigned) {
|
||||
if (isSigned) {
|
||||
switch (op) {
|
||||
case JSOP_EQ:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOp::Eq:
|
||||
case JSOp::StrictEq:
|
||||
return Assembler::Equal;
|
||||
case JSOP_NE:
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::Ne:
|
||||
case JSOp::StrictNe:
|
||||
return Assembler::NotEqual;
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
return Assembler::LessThan;
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
return Assembler::LessThanOrEqual;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
return Assembler::GreaterThan;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
return Assembler::GreaterThanOrEqual;
|
||||
default:
|
||||
MOZ_CRASH("Unrecognized comparison operation");
|
||||
}
|
||||
} else {
|
||||
switch (op) {
|
||||
case JSOP_EQ:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOp::Eq:
|
||||
case JSOp::StrictEq:
|
||||
return Assembler::Equal;
|
||||
case JSOP_NE:
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::Ne:
|
||||
case JSOp::StrictNe:
|
||||
return Assembler::NotEqual;
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
return Assembler::Below;
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
return Assembler::BelowOrEqual;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
return Assembler::Above;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
return Assembler::AboveOrEqual;
|
||||
default:
|
||||
MOZ_CRASH("Unrecognized comparison operation");
|
||||
|
|
|
@ -209,10 +209,10 @@ bool RangeAnalysis::addBetaNodes() {
|
|||
right->type() == MIRType::Int32) {
|
||||
MDefinition* smaller = nullptr;
|
||||
MDefinition* greater = nullptr;
|
||||
if (jsop == JSOP_LT) {
|
||||
if (jsop == JSOp::Lt) {
|
||||
smaller = left;
|
||||
greater = right;
|
||||
} else if (jsop == JSOP_GT) {
|
||||
} else if (jsop == JSOp::Gt) {
|
||||
smaller = right;
|
||||
greater = left;
|
||||
}
|
||||
|
@ -248,10 +248,10 @@ bool RangeAnalysis::addBetaNodes() {
|
|||
|
||||
Range comp;
|
||||
switch (jsop) {
|
||||
case JSOP_LE:
|
||||
case JSOp::Le:
|
||||
comp.setDouble(conservativeLower, bound);
|
||||
break;
|
||||
case JSOP_LT:
|
||||
case JSOp::Lt:
|
||||
// For integers, if x < c, the upper bound of x is c-1.
|
||||
if (val->type() == MIRType::Int32) {
|
||||
int32_t intbound;
|
||||
|
@ -267,10 +267,10 @@ bool RangeAnalysis::addBetaNodes() {
|
|||
comp.refineToExcludeNegativeZero();
|
||||
}
|
||||
break;
|
||||
case JSOP_GE:
|
||||
case JSOp::Ge:
|
||||
comp.setDouble(bound, conservativeUpper);
|
||||
break;
|
||||
case JSOP_GT:
|
||||
case JSOp::Gt:
|
||||
// For integers, if x > c, the lower bound of x is c+1.
|
||||
if (val->type() == MIRType::Int32) {
|
||||
int32_t intbound;
|
||||
|
@ -286,24 +286,24 @@ bool RangeAnalysis::addBetaNodes() {
|
|||
comp.refineToExcludeNegativeZero();
|
||||
}
|
||||
break;
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOp::StrictEq:
|
||||
// A strict comparison can test for things other than numeric value.
|
||||
if (!compare->isNumericComparison()) {
|
||||
continue;
|
||||
}
|
||||
// Otherwise fall through to handle JSOp::StrictEq the same as JSOp::Eq.
|
||||
[[fallthrough]];
|
||||
case JSOP_EQ:
|
||||
case JSOp::Eq:
|
||||
comp.setDouble(bound, bound);
|
||||
break;
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::StrictNe:
|
||||
// A strict comparison can test for things other than numeric value.
|
||||
if (!compare->isNumericComparison()) {
|
||||
continue;
|
||||
}
|
||||
// Otherwise fall through to handle JSOp::StrictNe the same as JSOp::Ne.
|
||||
[[fallthrough]];
|
||||
case JSOP_NE:
|
||||
case JSOp::Ne:
|
||||
// Negative zero is not not-equal to zero.
|
||||
if (bound == 0) {
|
||||
comp.refineToExcludeNegativeZero();
|
||||
|
|
|
@ -83,12 +83,12 @@ bool MResumePoint::writeRecoverData(CompactBufferWriter& writer) const {
|
|||
|
||||
if (reachablePC) {
|
||||
JSOp bailOp = JSOp(*bailPC);
|
||||
if (bailOp == JSOP_FUNCALL) {
|
||||
if (bailOp == JSOp::FunCall) {
|
||||
// For fun.call(this, ...); the reconstructStackDepth will
|
||||
// include the this. When inlining that is not included. So the
|
||||
// exprStackSlots will be one less.
|
||||
MOZ_ASSERT(stackDepth - exprStack <= 1);
|
||||
} else if (bailOp != JSOP_FUNAPPLY &&
|
||||
} else if (bailOp != JSOp::FunApply &&
|
||||
!IsIonInlinableGetterOrSetterOp(bailOp)) {
|
||||
// For fun.apply({}, arguments) the reconstructStackDepth will
|
||||
// have stackdepth 4, but it could be that we inlined the
|
||||
|
|
|
@ -594,7 +594,7 @@ bool SetProperty(JSContext* cx, HandleObject obj, HandlePropertyName name,
|
|||
|
||||
JSOp op = JSOp(*pc);
|
||||
|
||||
if (op == JSOP_SETALIASEDVAR || op == JSOP_INITALIASEDLEXICAL) {
|
||||
if (op == JSOp::SetAliasedVar || op == JSOp::InitAliasedLexical) {
|
||||
// Aliased var assigns ignore readonly attributes on the property, as
|
||||
// required for initializing 'const' closure variables.
|
||||
Shape* shape = obj->as<NativeObject>().lookup(cx, name);
|
||||
|
@ -606,8 +606,8 @@ bool SetProperty(JSContext* cx, HandleObject obj, HandlePropertyName name,
|
|||
RootedValue receiver(cx, ObjectValue(*obj));
|
||||
ObjectOpResult result;
|
||||
if (MOZ_LIKELY(!obj->getOpsSetProperty())) {
|
||||
if (op == JSOP_SETNAME || op == JSOP_STRICTSETNAME || op == JSOP_SETGNAME ||
|
||||
op == JSOP_STRICTSETGNAME) {
|
||||
if (op == JSOp::SetName || op == JSOp::StrictSetName ||
|
||||
op == JSOp::SetGName || op == JSOp::StrictSetGName) {
|
||||
if (!NativeSetProperty<Unqualified>(cx, obj.as<NativeObject>(), id, value,
|
||||
receiver, result)) {
|
||||
return false;
|
||||
|
@ -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(JSOp(*pc) == JSOp::Yield || JSOp(*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(JSOp(*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 (JSOp(*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.
|
||||
|
|
|
@ -898,7 +898,7 @@ void CodeGenerator::visitBitOpI(LBitOpI* ins) {
|
|||
|
||||
// All of these bitops should be either imm32's, or integer registers.
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
if (rhs->isConstant()) {
|
||||
masm.ma_orr(Imm32(ToInt32(rhs)), ToRegister(lhs), ToRegister(dest),
|
||||
scratch);
|
||||
|
@ -906,7 +906,7 @@ void CodeGenerator::visitBitOpI(LBitOpI* ins) {
|
|||
masm.ma_orr(ToRegister(rhs), ToRegister(lhs), ToRegister(dest));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
if (rhs->isConstant()) {
|
||||
masm.ma_eor(Imm32(ToInt32(rhs)), ToRegister(lhs), ToRegister(dest),
|
||||
scratch);
|
||||
|
@ -914,7 +914,7 @@ void CodeGenerator::visitBitOpI(LBitOpI* ins) {
|
|||
masm.ma_eor(ToRegister(rhs), ToRegister(lhs), ToRegister(dest));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
if (rhs->isConstant()) {
|
||||
masm.ma_and(Imm32(ToInt32(rhs)), ToRegister(lhs), ToRegister(dest),
|
||||
scratch);
|
||||
|
@ -935,21 +935,21 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
if (rhs->isConstant()) {
|
||||
int32_t shift = ToInt32(rhs) & 0x1F;
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
if (shift) {
|
||||
masm.ma_lsl(Imm32(shift), lhs, dest);
|
||||
} else {
|
||||
masm.ma_mov(lhs, dest);
|
||||
}
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
if (shift) {
|
||||
masm.ma_asr(Imm32(shift), lhs, dest);
|
||||
} else {
|
||||
masm.ma_mov(lhs, dest);
|
||||
}
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
if (shift) {
|
||||
masm.ma_lsr(Imm32(shift), lhs, dest);
|
||||
} else {
|
||||
|
@ -971,13 +971,13 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
masm.as_and(dest, ToRegister(rhs), Imm8(0x1F));
|
||||
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.ma_lsl(dest, lhs, dest);
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.ma_asr(dest, lhs, dest);
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
masm.ma_lsr(dest, lhs, dest);
|
||||
if (ins->mir()->toUrsh()->fallible()) {
|
||||
// x >>> 0 can overflow.
|
||||
|
@ -1171,16 +1171,16 @@ void CodeGenerator::visitMathD(LMathD* math) {
|
|||
FloatRegister output = ToFloatRegister(math->getDef(0));
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.ma_vadd(src1, src2, output);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.ma_vsub(src1, src2, output);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.ma_vmul(src1, src2, output);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.ma_vdiv(src1, src2, output);
|
||||
break;
|
||||
default:
|
||||
|
@ -1194,16 +1194,16 @@ void CodeGenerator::visitMathF(LMathF* math) {
|
|||
FloatRegister output = ToFloatRegister(math->getDef(0));
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.ma_vadd_f32(src1, src2, output);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.ma_vsub_f32(src1, src2, output);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.ma_vmul_f32(src1, src2, output);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.ma_vdiv_f32(src1, src2, output);
|
||||
break;
|
||||
default:
|
||||
|
@ -1477,7 +1477,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
const LAllocation* rhs = lir->rhs();
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
Label notBoolean, done;
|
||||
masm.branchTestBoolean(Assembler::NotEqual, lhs, ¬Boolean);
|
||||
|
@ -1492,7 +1492,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
}
|
||||
|
||||
masm.bind(¬Boolean);
|
||||
{ masm.move32(Imm32(mir->jsop() == JSOP_STRICTNE), output); }
|
||||
{ masm.move32(Imm32(mir->jsop() == JSOp::StrictNe), output); }
|
||||
|
||||
masm.bind(&done);
|
||||
}
|
||||
|
@ -1502,10 +1502,10 @@ void CodeGenerator::visitCompareBAndBranch(LCompareBAndBranch* lir) {
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBAndBranch::Lhs);
|
||||
const LAllocation* rhs = lir->rhs();
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
Assembler::Condition cond = masm.testBoolean(Assembler::NotEqual, lhs);
|
||||
jumpToBlock((mir->jsop() == JSOP_STRICTEQ) ? lir->ifFalse() : lir->ifTrue(),
|
||||
jumpToBlock((mir->jsop() == JSOp::StrictEq) ? lir->ifFalse() : lir->ifTrue(),
|
||||
cond);
|
||||
|
||||
if (rhs->isConstant()) {
|
||||
|
@ -1524,8 +1524,8 @@ void CodeGenerator::visitCompareBitwise(LCompareBitwise* lir) {
|
|||
const ValueOperand rhs = ToValue(lir, LCompareBitwise::RhsInput);
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::Eq || mir->jsop() == JSOp::StrictEq ||
|
||||
mir->jsop() == JSOp::Ne || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
Label notEqual, done;
|
||||
masm.cmp32(lhs.typeReg(), rhs.typeReg());
|
||||
|
@ -1548,8 +1548,8 @@ void CodeGenerator::visitCompareBitwiseAndBranch(
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::Eq || mir->jsop() == JSOp::StrictEq ||
|
||||
mir->jsop() == JSOp::Ne || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
MBasicBlock* notEqual =
|
||||
(cond == Assembler::Equal) ? lir->ifFalse() : lir->ifTrue();
|
||||
|
@ -2796,17 +2796,17 @@ void CodeGenerator::visitShiftI64(LShiftI64* lir) {
|
|||
if (rhs->isConstant()) {
|
||||
int32_t shift = int32_t(rhs->toConstant()->toInt64() & 0x3F);
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
if (shift) {
|
||||
masm.lshift64(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
if (shift) {
|
||||
masm.rshift64Arithmetic(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
if (shift) {
|
||||
masm.rshift64(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
|
@ -2818,13 +2818,13 @@ void CodeGenerator::visitShiftI64(LShiftI64* lir) {
|
|||
}
|
||||
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.lshift64(ToRegister(rhs), ToRegister64(lhs));
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.rshift64Arithmetic(ToRegister(rhs), ToRegister64(lhs));
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
masm.rshift64(ToRegister(rhs), ToRegister64(lhs));
|
||||
break;
|
||||
default:
|
||||
|
@ -2839,21 +2839,21 @@ void CodeGenerator::visitBitOpI64(LBitOpI64* lir) {
|
|||
MOZ_ASSERT(ToOutRegister64(lir) == ToRegister64(lhs));
|
||||
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.or64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
masm.or64(ToOperandOrRegister64(rhs), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.xor64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
masm.xor64(ToOperandOrRegister64(rhs), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.and64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
|
|
|
@ -877,13 +877,13 @@ void CodeGenerator::visitBitOpI(LBitOpI* ins) {
|
|||
const ARMRegister dest = toWRegister(ins->getDef(0));
|
||||
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
masm.Orr(dest, lhs, rhs);
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
masm.Eor(dest, lhs, rhs);
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
masm.And(dest, lhs, rhs);
|
||||
break;
|
||||
default:
|
||||
|
@ -899,13 +899,13 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
if (rhs->isConstant()) {
|
||||
int32_t shift = ToInt32(rhs) & 0x1F;
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.Lsl(dest, lhs, shift);
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.Asr(dest, lhs, shift);
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
if (shift) {
|
||||
masm.Lsr(dest, lhs, shift);
|
||||
} else if (ins->mir()->toUrsh()->fallible()) {
|
||||
|
@ -922,13 +922,13 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
} else {
|
||||
const ARMRegister rhsreg = toWRegister(rhs);
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.Lsl(dest, lhs, rhsreg);
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.Asr(dest, lhs, rhsreg);
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
masm.Lsr(dest, lhs, rhsreg);
|
||||
if (ins->mir()->toUrsh()->fallible()) {
|
||||
/// x >>> 0 can overflow.
|
||||
|
@ -1093,16 +1093,16 @@ void CodeGenerator::visitMathD(LMathD* math) {
|
|||
ARMFPRegister output(ToFloatRegister(math->output()), 64);
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.Fadd(output, lhs, rhs);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.Fsub(output, lhs, rhs);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.Fmul(output, lhs, rhs);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.Fdiv(output, lhs, rhs);
|
||||
break;
|
||||
default:
|
||||
|
@ -1116,16 +1116,16 @@ void CodeGenerator::visitMathF(LMathF* math) {
|
|||
ARMFPRegister output(ToFloatRegister(math->output()), 32);
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.Fadd(output, lhs, rhs);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.Fsub(output, lhs, rhs);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.Fmul(output, lhs, rhs);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.Fdiv(output, lhs, rhs);
|
||||
break;
|
||||
default:
|
||||
|
@ -1629,7 +1629,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
vixl::UseScratchRegisterScope temps(&masm.asVIXL());
|
||||
const Register scratch = temps.AcquireX().asUnsized();
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
// Load boxed boolean into scratch.
|
||||
if (rhs->isConstant()) {
|
||||
|
@ -1652,7 +1652,7 @@ void CodeGenerator::visitCompareBAndBranch(LCompareBAndBranch* lir) {
|
|||
vixl::UseScratchRegisterScope temps(&masm.asVIXL());
|
||||
const Register scratch = temps.AcquireX().asUnsized();
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
// Load boxed boolean into scratch.
|
||||
if (rhs->isConstant()) {
|
||||
|
@ -1685,8 +1685,8 @@ void CodeGenerator::visitCompareBitwiseAndBranch(
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::Eq || mir->jsop() == JSOp::StrictEq ||
|
||||
mir->jsop() == JSOp::Ne || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
masm.cmpPtr(lhs.valueReg(), rhs.valueReg());
|
||||
emitBranch(cond, lir->ifTrue(), lir->ifFalse());
|
||||
|
|
|
@ -817,21 +817,21 @@ void CodeGenerator::visitBitOpI(LBitOpI* ins) {
|
|||
const LDefinition* dest = ins->getDef(0);
|
||||
// all of these bitops should be either imm32's, or integer registers.
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
if (rhs->isConstant()) {
|
||||
masm.ma_or(ToRegister(dest), ToRegister(lhs), Imm32(ToInt32(rhs)));
|
||||
} else {
|
||||
masm.as_or(ToRegister(dest), ToRegister(lhs), ToRegister(rhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
if (rhs->isConstant()) {
|
||||
masm.ma_xor(ToRegister(dest), ToRegister(lhs), Imm32(ToInt32(rhs)));
|
||||
} else {
|
||||
masm.as_xor(ToRegister(dest), ToRegister(lhs), ToRegister(rhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
if (rhs->isConstant()) {
|
||||
masm.ma_and(ToRegister(dest), ToRegister(lhs), Imm32(ToInt32(rhs)));
|
||||
} else {
|
||||
|
@ -850,21 +850,21 @@ void CodeGenerator::visitBitOpI64(LBitOpI64* lir) {
|
|||
MOZ_ASSERT(ToOutRegister64(lir) == ToRegister64(lhs));
|
||||
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.or64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
masm.or64(ToOperandOrRegister64(rhs), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.xor64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
masm.xor64(ToOperandOrRegister64(rhs), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.and64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
|
@ -884,21 +884,21 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
if (rhs->isConstant()) {
|
||||
int32_t shift = ToInt32(rhs) & 0x1F;
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
if (shift) {
|
||||
masm.ma_sll(dest, lhs, Imm32(shift));
|
||||
} else {
|
||||
masm.move32(lhs, dest);
|
||||
}
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
if (shift) {
|
||||
masm.ma_sra(dest, lhs, Imm32(shift));
|
||||
} else {
|
||||
masm.move32(lhs, dest);
|
||||
}
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
if (shift) {
|
||||
masm.ma_srl(dest, lhs, Imm32(shift));
|
||||
} else {
|
||||
|
@ -917,13 +917,13 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
masm.ma_and(dest, ToRegister(rhs), Imm32(0x1F));
|
||||
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.ma_sll(dest, lhs, dest);
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.ma_sra(dest, lhs, dest);
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
masm.ma_srl(dest, lhs, dest);
|
||||
if (ins->mir()->toUrsh()->fallible()) {
|
||||
// x >>> 0 can overflow.
|
||||
|
@ -945,17 +945,17 @@ void CodeGenerator::visitShiftI64(LShiftI64* lir) {
|
|||
if (rhs->isConstant()) {
|
||||
int32_t shift = int32_t(rhs->toConstant()->toInt64() & 0x3F);
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
if (shift) {
|
||||
masm.lshift64(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
if (shift) {
|
||||
masm.rshift64Arithmetic(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
if (shift) {
|
||||
masm.rshift64(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
|
@ -967,13 +967,13 @@ void CodeGenerator::visitShiftI64(LShiftI64* lir) {
|
|||
}
|
||||
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.lshift64(ToRegister(rhs), ToRegister64(lhs));
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.rshift64Arithmetic(ToRegister(rhs), ToRegister64(lhs));
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
masm.rshift64(ToRegister(rhs), ToRegister64(lhs));
|
||||
break;
|
||||
default:
|
||||
|
@ -1103,16 +1103,16 @@ void CodeGenerator::visitMathD(LMathD* math) {
|
|||
FloatRegister output = ToFloatRegister(math->getDef(0));
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.as_addd(output, src1, src2);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.as_subd(output, src1, src2);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.as_muld(output, src1, src2);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.as_divd(output, src1, src2);
|
||||
break;
|
||||
default:
|
||||
|
@ -1126,16 +1126,16 @@ void CodeGenerator::visitMathF(LMathF* math) {
|
|||
FloatRegister output = ToFloatRegister(math->getDef(0));
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.as_adds(output, src1, src2);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.as_subs(output, src1, src2);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.as_muls(output, src1, src2);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.as_divs(output, src1, src2);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -77,7 +77,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
const LAllocation* rhs = lir->rhs();
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
|
||||
Label notBoolean, done;
|
||||
|
@ -93,7 +93,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
}
|
||||
|
||||
masm.bind(¬Boolean);
|
||||
{ masm.move32(Imm32(mir->jsop() == JSOP_STRICTNE), output); }
|
||||
{ masm.move32(Imm32(mir->jsop() == JSOp::StrictNe), output); }
|
||||
|
||||
masm.bind(&done);
|
||||
}
|
||||
|
@ -103,10 +103,10 @@ void CodeGenerator::visitCompareBAndBranch(LCompareBAndBranch* lir) {
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBAndBranch::Lhs);
|
||||
const LAllocation* rhs = lir->rhs();
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
MBasicBlock* mirNotBoolean =
|
||||
(mir->jsop() == JSOP_STRICTEQ) ? lir->ifFalse() : lir->ifTrue();
|
||||
(mir->jsop() == JSOp::StrictEq) ? lir->ifFalse() : lir->ifTrue();
|
||||
branchToBlock(lhs.typeReg(), ImmType(JSVAL_TYPE_BOOLEAN), mirNotBoolean,
|
||||
Assembler::NotEqual);
|
||||
|
||||
|
@ -149,8 +149,8 @@ void CodeGenerator::visitCompareBitwiseAndBranch(
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::Eq || mir->jsop() == JSOp::StrictEq ||
|
||||
mir->jsop() == JSOp::Ne || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
MBasicBlock* notEqual =
|
||||
(cond == Assembler::Equal) ? lir->ifFalse() : lir->ifTrue();
|
||||
|
|
|
@ -114,7 +114,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
const LAllocation* rhs = lir->rhs();
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
|
||||
// Load boxed boolean in ScratchRegister.
|
||||
|
@ -134,7 +134,7 @@ void CodeGenerator::visitCompareBAndBranch(LCompareBAndBranch* lir) {
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBAndBranch::Lhs);
|
||||
const LAllocation* rhs = lir->rhs();
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
// Load boxed boolean in ScratchRegister.
|
||||
if (rhs->isConstant()) {
|
||||
|
@ -169,8 +169,8 @@ void CodeGenerator::visitCompareBitwiseAndBranch(
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::Eq || mir->jsop() == JSOp::StrictEq ||
|
||||
mir->jsop() == JSOp::Ne || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
emitBranch(lhs.valueReg(), rhs.valueReg(), cond, lir->ifTrue(),
|
||||
lir->ifFalse());
|
||||
|
|
|
@ -2086,7 +2086,7 @@ class LBitOpI : public LInstructionHelper<1, 2, 0> {
|
|||
explicit LBitOpI(JSOp op) : LInstructionHelper(classOpcode), op_(op) {}
|
||||
|
||||
const char* extraName() const {
|
||||
if (bitop() == JSOP_URSH && mir_->toUrsh()->bailoutsDisabled()) {
|
||||
if (bitop() == JSOp::Ursh && mir_->toUrsh()->bailoutsDisabled()) {
|
||||
return "ursh:BailoutsDisabled";
|
||||
}
|
||||
return CodeName(op_);
|
||||
|
|
|
@ -137,7 +137,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
const LAllocation* rhs = lir->rhs();
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
// Load boxed boolean in ScratchReg.
|
||||
ScratchRegisterScope scratch(masm);
|
||||
|
@ -158,7 +158,7 @@ void CodeGenerator::visitCompareBAndBranch(LCompareBAndBranch* lir) {
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBAndBranch::Lhs);
|
||||
const LAllocation* rhs = lir->rhs();
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
// Load boxed boolean in ScratchReg.
|
||||
ScratchRegisterScope scratch(masm);
|
||||
|
@ -193,8 +193,8 @@ void CodeGenerator::visitCompareBitwiseAndBranch(
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::Eq || mir->jsop() == JSOp::StrictEq ||
|
||||
mir->jsop() == JSOp::Ne || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
masm.cmpPtr(lhs.valueReg(), rhs.valueReg());
|
||||
emitBranch(JSOpToCondition(mir->compareType(), mir->jsop()), lir->ifTrue(),
|
||||
|
|
|
@ -1623,21 +1623,21 @@ void CodeGenerator::visitBitOpI(LBitOpI* ins) {
|
|||
const LAllocation* rhs = ins->getOperand(1);
|
||||
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
if (rhs->isConstant()) {
|
||||
masm.orl(Imm32(ToInt32(rhs)), ToOperand(lhs));
|
||||
} else {
|
||||
masm.orl(ToOperand(rhs), ToRegister(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
if (rhs->isConstant()) {
|
||||
masm.xorl(Imm32(ToInt32(rhs)), ToOperand(lhs));
|
||||
} else {
|
||||
masm.xorl(ToOperand(rhs), ToRegister(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
if (rhs->isConstant()) {
|
||||
masm.andl(Imm32(ToInt32(rhs)), ToOperand(lhs));
|
||||
} else {
|
||||
|
@ -1656,21 +1656,21 @@ void CodeGenerator::visitBitOpI64(LBitOpI64* lir) {
|
|||
MOZ_ASSERT(ToOutRegister64(lir) == ToRegister64(lhs));
|
||||
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_BITOR:
|
||||
case JSOp::BitOr:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.or64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
masm.or64(ToOperandOrRegister64(rhs), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITXOR:
|
||||
case JSOp::BitXor:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.xor64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
masm.xor64(ToOperandOrRegister64(rhs), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_BITAND:
|
||||
case JSOp::BitAnd:
|
||||
if (IsConstant(rhs)) {
|
||||
masm.and64(Imm64(ToInt64(rhs)), ToRegister64(lhs));
|
||||
} else {
|
||||
|
@ -1689,17 +1689,17 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
if (rhs->isConstant()) {
|
||||
int32_t shift = ToInt32(rhs) & 0x1F;
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
if (shift) {
|
||||
masm.shll(Imm32(shift), lhs);
|
||||
}
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
if (shift) {
|
||||
masm.sarl(Imm32(shift), lhs);
|
||||
}
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
if (shift) {
|
||||
masm.shrl(Imm32(shift), lhs);
|
||||
} else if (ins->mir()->toUrsh()->fallible()) {
|
||||
|
@ -1714,13 +1714,13 @@ void CodeGenerator::visitShiftI(LShiftI* ins) {
|
|||
} else {
|
||||
MOZ_ASSERT(ToRegister(rhs) == ecx);
|
||||
switch (ins->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.shll_cl(lhs);
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.sarl_cl(lhs);
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
masm.shrl_cl(lhs);
|
||||
if (ins->mir()->toUrsh()->fallible()) {
|
||||
// x >>> 0 can overflow.
|
||||
|
@ -1743,17 +1743,17 @@ void CodeGenerator::visitShiftI64(LShiftI64* lir) {
|
|||
if (rhs->isConstant()) {
|
||||
int32_t shift = int32_t(rhs->toConstant()->toInt64() & 0x3F);
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
if (shift) {
|
||||
masm.lshift64(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
if (shift) {
|
||||
masm.rshift64Arithmetic(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
if (shift) {
|
||||
masm.rshift64(Imm32(shift), ToRegister64(lhs));
|
||||
}
|
||||
|
@ -1766,13 +1766,13 @@ void CodeGenerator::visitShiftI64(LShiftI64* lir) {
|
|||
|
||||
MOZ_ASSERT(ToRegister(rhs) == ecx);
|
||||
switch (lir->bitop()) {
|
||||
case JSOP_LSH:
|
||||
case JSOp::Lsh:
|
||||
masm.lshift64(ecx, ToRegister64(lhs));
|
||||
break;
|
||||
case JSOP_RSH:
|
||||
case JSOp::Rsh:
|
||||
masm.rshift64Arithmetic(ecx, ToRegister64(lhs));
|
||||
break;
|
||||
case JSOP_URSH:
|
||||
case JSOp::Ursh:
|
||||
masm.rshift64(ecx, ToRegister64(lhs));
|
||||
break;
|
||||
default:
|
||||
|
@ -1901,16 +1901,16 @@ void CodeGenerator::visitMathD(LMathD* math) {
|
|||
FloatRegister output = ToFloatRegister(math->output());
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.vaddsd(rhs, lhs, output);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.vsubsd(rhs, lhs, output);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.vmulsd(rhs, lhs, output);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.vdivsd(rhs, lhs, output);
|
||||
break;
|
||||
default:
|
||||
|
@ -1924,16 +1924,16 @@ void CodeGenerator::visitMathF(LMathF* math) {
|
|||
FloatRegister output = ToFloatRegister(math->output());
|
||||
|
||||
switch (math->jsop()) {
|
||||
case JSOP_ADD:
|
||||
case JSOp::Add:
|
||||
masm.vaddss(rhs, lhs, output);
|
||||
break;
|
||||
case JSOP_SUB:
|
||||
case JSOp::Sub:
|
||||
masm.vsubss(rhs, lhs, output);
|
||||
break;
|
||||
case JSOP_MUL:
|
||||
case JSOp::Mul:
|
||||
masm.vmulss(rhs, lhs, output);
|
||||
break;
|
||||
case JSOP_DIV:
|
||||
case JSOp::Div:
|
||||
masm.vdivss(rhs, lhs, output);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -127,7 +127,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
const LAllocation* rhs = lir->rhs();
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
Label notBoolean, done;
|
||||
masm.branchTestBoolean(Assembler::NotEqual, lhs, ¬Boolean);
|
||||
|
@ -141,7 +141,7 @@ void CodeGenerator::visitCompareB(LCompareB* lir) {
|
|||
masm.jump(&done);
|
||||
}
|
||||
masm.bind(¬Boolean);
|
||||
{ masm.move32(Imm32(mir->jsop() == JSOP_STRICTNE), output); }
|
||||
{ masm.move32(Imm32(mir->jsop() == JSOp::StrictNe), output); }
|
||||
|
||||
masm.bind(&done);
|
||||
}
|
||||
|
@ -151,10 +151,10 @@ void CodeGenerator::visitCompareBAndBranch(LCompareBAndBranch* lir) {
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBAndBranch::Lhs);
|
||||
const LAllocation* rhs = lir->rhs();
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_STRICTEQ || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::StrictEq || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
Assembler::Condition cond = masm.testBoolean(Assembler::NotEqual, lhs);
|
||||
jumpToBlock((mir->jsop() == JSOP_STRICTEQ) ? lir->ifFalse() : lir->ifTrue(),
|
||||
jumpToBlock((mir->jsop() == JSOp::StrictEq) ? lir->ifFalse() : lir->ifTrue(),
|
||||
cond);
|
||||
|
||||
if (rhs->isConstant()) {
|
||||
|
@ -196,8 +196,8 @@ void CodeGenerator::visitCompareBitwiseAndBranch(
|
|||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
MOZ_ASSERT(mir->jsop() == JSOp::Eq || mir->jsop() == JSOp::StrictEq ||
|
||||
mir->jsop() == JSOp::Ne || mir->jsop() == JSOp::StrictNe);
|
||||
|
||||
MBasicBlock* notEqual =
|
||||
(cond == Assembler::Equal) ? lir->ifFalse() : lir->ifTrue();
|
||||
|
|
|
@ -141,7 +141,7 @@ BEGIN_TEST(testJitRangeAnalysis_MathSignBeta) {
|
|||
entry->add(c0);
|
||||
MConstant* cm0 = MConstant::New(func.alloc, DoubleValue(-0.0));
|
||||
entry->add(cm0);
|
||||
MCompare* cmp = MCompare::New(func.alloc, p, c0, JSOP_LT);
|
||||
MCompare* cmp = MCompare::New(func.alloc, p, c0, JSOp::Lt);
|
||||
cmp->setCompareType(MCompare::Compare_Double);
|
||||
entry->add(cmp);
|
||||
entry->end(MTest::New(func.alloc, cmp, thenBlock, elseBlock));
|
||||
|
@ -159,7 +159,7 @@ BEGIN_TEST(testJitRangeAnalysis_MathSignBeta) {
|
|||
// else
|
||||
// {
|
||||
// if (p >= 0)
|
||||
MCompare* elseCmp = MCompare::New(func.alloc, p, c0, JSOP_GE);
|
||||
MCompare* elseCmp = MCompare::New(func.alloc, p, c0, JSOp::Ge);
|
||||
elseCmp->setCompareType(MCompare::Compare_Double);
|
||||
elseBlock->add(elseCmp);
|
||||
elseBlock->end(MTest::New(func.alloc, elseCmp, elseThenBlock, elseElseBlock));
|
||||
|
@ -242,7 +242,7 @@ BEGIN_TEST(testJitRangeAnalysis_StrictCompareBeta) {
|
|||
entry->add(p);
|
||||
MConstant* c0 = MConstant::New(func.alloc, DoubleValue(0.0));
|
||||
entry->add(c0);
|
||||
MCompare* cmp = MCompare::New(func.alloc, p, c0, JSOP_STRICTEQ);
|
||||
MCompare* cmp = MCompare::New(func.alloc, p, c0, JSOp::StrictEq);
|
||||
entry->add(cmp);
|
||||
entry->end(MTest::New(func.alloc, cmp, thenBlock, elseBlock));
|
||||
|
||||
|
|
|
@ -48,13 +48,13 @@ inline uint32_t BytecodeLocation::tableSwitchCaseOffset(
|
|||
|
||||
inline uint32_t BytecodeLocation::getJumpTargetOffset(
|
||||
const JSScript* script) const {
|
||||
MOZ_ASSERT(this->isJump() || this->is(JSOP_TABLESWITCH));
|
||||
MOZ_ASSERT(this->isJump() || this->is(JSOp::TableSwitch));
|
||||
return this->bytecodeToOffset(script) + GET_JUMP_OFFSET(this->rawBytecode_);
|
||||
}
|
||||
|
||||
inline uint32_t BytecodeLocation::getTableSwitchDefaultOffset(
|
||||
const JSScript* script) const {
|
||||
MOZ_ASSERT(this->is(JSOP_TABLESWITCH));
|
||||
MOZ_ASSERT(this->is(JSOp::TableSwitch));
|
||||
return this->bytecodeToOffset(script) + GET_JUMP_OFFSET(this->rawBytecode_);
|
||||
}
|
||||
|
||||
|
|
|
@ -175,20 +175,20 @@ class BytecodeLocation {
|
|||
|
||||
BytecodeLocation getJumpTarget() const {
|
||||
// The default target of a JSOp::TableSwitch also follows this format.
|
||||
MOZ_ASSERT(isJump() || is(JSOP_TABLESWITCH));
|
||||
MOZ_ASSERT(isJump() || is(JSOp::TableSwitch));
|
||||
return BytecodeLocation(*this,
|
||||
rawBytecode_ + GET_JUMP_OFFSET(rawBytecode_));
|
||||
}
|
||||
|
||||
// Return the 'low' parameter to the tableswitch opcode
|
||||
int32_t getTableSwitchLow() const {
|
||||
MOZ_ASSERT(is(JSOP_TABLESWITCH));
|
||||
MOZ_ASSERT(is(JSOp::TableSwitch));
|
||||
return GET_JUMP_OFFSET(rawBytecode_ + JUMP_OFFSET_LEN);
|
||||
}
|
||||
|
||||
// Return the 'high' parameter to the tableswitch opcode
|
||||
int32_t getTableSwitchHigh() const {
|
||||
MOZ_ASSERT(is(JSOP_TABLESWITCH));
|
||||
MOZ_ASSERT(is(JSOp::TableSwitch));
|
||||
return GET_JUMP_OFFSET(rawBytecode_ + (2 * JUMP_OFFSET_LEN));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ static inline unsigned GetDefCount(jsbytecode* pc) {
|
|||
* in the pushed array of stack values for type inference.
|
||||
*/
|
||||
switch (JSOp(*pc)) {
|
||||
case JSOP_OR:
|
||||
case JSOP_AND:
|
||||
case JSOP_COALESCE:
|
||||
case JSOp::Or:
|
||||
case JSOp::And:
|
||||
case JSOp::Coalesce:
|
||||
return 1;
|
||||
case JSOP_PICK:
|
||||
case JSOP_UNPICK:
|
||||
case JSOp::Pick:
|
||||
case JSOp::Unpick:
|
||||
/*
|
||||
* Pick pops and pushes how deep it looks in the stack + 1
|
||||
* items. i.e. if the stack were |a b[2] c[1] d[0]|, pick 2
|
||||
|
@ -39,7 +39,7 @@ static inline unsigned GetDefCount(jsbytecode* pc) {
|
|||
}
|
||||
|
||||
static inline unsigned GetUseCount(jsbytecode* pc) {
|
||||
if (JSOp(*pc) == JSOP_PICK || JSOp(*pc) == JSOP_UNPICK) {
|
||||
if (JSOp(*pc) == JSOp::Pick || JSOp(*pc) == JSOp::Unpick) {
|
||||
return pc[1] + 1;
|
||||
}
|
||||
|
||||
|
@ -48,18 +48,18 @@ static inline unsigned GetUseCount(jsbytecode* pc) {
|
|||
|
||||
static inline JSOp ReverseCompareOp(JSOp op) {
|
||||
switch (op) {
|
||||
case JSOP_GT:
|
||||
return JSOP_LT;
|
||||
case JSOP_GE:
|
||||
return JSOP_LE;
|
||||
case JSOP_LT:
|
||||
return JSOP_GT;
|
||||
case JSOP_LE:
|
||||
return JSOP_GE;
|
||||
case JSOP_EQ:
|
||||
case JSOP_NE:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOP_STRICTNE:
|
||||
case JSOp::Gt:
|
||||
return JSOp::Lt;
|
||||
case JSOp::Ge:
|
||||
return JSOp::Le;
|
||||
case JSOp::Lt:
|
||||
return JSOp::Gt;
|
||||
case JSOp::Le:
|
||||
return JSOp::Ge;
|
||||
case JSOp::Eq:
|
||||
case JSOp::Ne:
|
||||
case JSOp::StrictEq:
|
||||
case JSOp::StrictNe:
|
||||
return op;
|
||||
default:
|
||||
MOZ_CRASH("unrecognized op");
|
||||
|
@ -68,22 +68,22 @@ static inline JSOp ReverseCompareOp(JSOp op) {
|
|||
|
||||
static inline JSOp NegateCompareOp(JSOp op) {
|
||||
switch (op) {
|
||||
case JSOP_GT:
|
||||
return JSOP_LE;
|
||||
case JSOP_GE:
|
||||
return JSOP_LT;
|
||||
case JSOP_LT:
|
||||
return JSOP_GE;
|
||||
case JSOP_LE:
|
||||
return JSOP_GT;
|
||||
case JSOP_EQ:
|
||||
return JSOP_NE;
|
||||
case JSOP_NE:
|
||||
return JSOP_EQ;
|
||||
case JSOP_STRICTNE:
|
||||
return JSOP_STRICTEQ;
|
||||
case JSOP_STRICTEQ:
|
||||
return JSOP_STRICTNE;
|
||||
case JSOp::Gt:
|
||||
return JSOp::Le;
|
||||
case JSOp::Ge:
|
||||
return JSOp::Lt;
|
||||
case JSOp::Lt:
|
||||
return JSOp::Ge;
|
||||
case JSOp::Le:
|
||||
return JSOp::Gt;
|
||||
case JSOp::Eq:
|
||||
return JSOp::Ne;
|
||||
case JSOp::Ne:
|
||||
return JSOp::Eq;
|
||||
case JSOp::StrictNe:
|
||||
return JSOp::StrictEq;
|
||||
case JSOp::StrictEq:
|
||||
return JSOp::StrictNe;
|
||||
default:
|
||||
MOZ_CRASH("unrecognized op");
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ class BytecodeRangeWithPosition : private BytecodeRange {
|
|||
popFront();
|
||||
}
|
||||
|
||||
if (frontOpcode() != JSOP_JUMPTARGET) {
|
||||
if (frontOpcode() != JSOp::JumpTarget) {
|
||||
isEntryPoint = true;
|
||||
} else {
|
||||
wasArtifactEntryPoint = true;
|
||||
|
@ -153,7 +153,7 @@ class BytecodeRangeWithPosition : private BytecodeRange {
|
|||
isEntryPoint = true;
|
||||
}
|
||||
|
||||
if (isEntryPoint && frontOpcode() == JSOP_JUMPTARGET) {
|
||||
if (isEntryPoint && frontOpcode() == JSOp::JumpTarget) {
|
||||
wasArtifactEntryPoint = isEntryPoint;
|
||||
isEntryPoint = false;
|
||||
}
|
||||
|
|
|
@ -572,25 +572,25 @@ uint32_t BytecodeParser::simulateOp(JSOp op, uint32_t offset,
|
|||
// after adding properties.
|
||||
// For stack dump, keeping the input is better.
|
||||
switch (op) {
|
||||
case JSOP_INITHIDDENPROP:
|
||||
case JSOP_INITHIDDENPROP_GETTER:
|
||||
case JSOP_INITHIDDENPROP_SETTER:
|
||||
case JSOP_INITLOCKEDPROP:
|
||||
case JSOP_INITPROP:
|
||||
case JSOP_INITPROP_GETTER:
|
||||
case JSOP_INITPROP_SETTER:
|
||||
case JSOP_SETFUNNAME:
|
||||
case JSOp::InitHiddenProp:
|
||||
case JSOp::InitHiddenPropGetter:
|
||||
case JSOp::InitHiddenPropSetter:
|
||||
case JSOp::InitLockedProp:
|
||||
case JSOp::InitProp:
|
||||
case JSOp::InitPropGetter:
|
||||
case JSOp::InitPropSetter:
|
||||
case JSOp::SetFunName:
|
||||
// Keep the second value.
|
||||
MOZ_ASSERT(nuses == 2);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
goto end;
|
||||
|
||||
case JSOP_INITELEM:
|
||||
case JSOP_INITELEM_GETTER:
|
||||
case JSOP_INITELEM_SETTER:
|
||||
case JSOP_INITHIDDENELEM:
|
||||
case JSOP_INITHIDDENELEM_GETTER:
|
||||
case JSOP_INITHIDDENELEM_SETTER:
|
||||
case JSOp::InitElem:
|
||||
case JSOp::InitElemGetter:
|
||||
case JSOp::InitElemSetter:
|
||||
case JSOp::InitHiddenElem:
|
||||
case JSOp::InitHiddenElemGetter:
|
||||
case JSOp::InitHiddenElemSetter:
|
||||
// Keep the third value.
|
||||
MOZ_ASSERT(nuses == 3);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
|
@ -612,28 +612,28 @@ uint32_t BytecodeParser::simulateOp(JSOp op, uint32_t offset,
|
|||
}
|
||||
break;
|
||||
|
||||
case JSOP_NOP_DESTRUCTURING:
|
||||
case JSOp::NopDestructuring:
|
||||
// Poison the last offset to not obfuscate the error message.
|
||||
offsetStack[stackDepth - 1].setIgnored();
|
||||
break;
|
||||
|
||||
case JSOP_CASE:
|
||||
case JSOp::Case:
|
||||
// Keep the switch value.
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
break;
|
||||
|
||||
case JSOP_DUP:
|
||||
case JSOp::Dup:
|
||||
MOZ_ASSERT(ndefs == 2);
|
||||
offsetStack[stackDepth + 1] = offsetStack[stackDepth];
|
||||
break;
|
||||
|
||||
case JSOP_DUP2:
|
||||
case JSOp::Dup2:
|
||||
MOZ_ASSERT(ndefs == 4);
|
||||
offsetStack[stackDepth + 2] = offsetStack[stackDepth];
|
||||
offsetStack[stackDepth + 3] = offsetStack[stackDepth + 1];
|
||||
break;
|
||||
|
||||
case JSOP_DUPAT: {
|
||||
case JSOp::DupAt: {
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
unsigned n = GET_UINT24(pc);
|
||||
MOZ_ASSERT(n < stackDepth);
|
||||
|
@ -641,7 +641,7 @@ uint32_t BytecodeParser::simulateOp(JSOp op, uint32_t offset,
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_SWAP: {
|
||||
case JSOp::Swap: {
|
||||
MOZ_ASSERT(ndefs == 2);
|
||||
OffsetAndDefIndex tmp = offsetStack[stackDepth + 1];
|
||||
offsetStack[stackDepth + 1] = offsetStack[stackDepth];
|
||||
|
@ -649,7 +649,7 @@ uint32_t BytecodeParser::simulateOp(JSOp op, uint32_t offset,
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_PICK: {
|
||||
case JSOp::Pick: {
|
||||
unsigned n = GET_UINT8(pc);
|
||||
MOZ_ASSERT(ndefs == n + 1);
|
||||
uint32_t top = stackDepth + n;
|
||||
|
@ -661,7 +661,7 @@ uint32_t BytecodeParser::simulateOp(JSOp op, uint32_t offset,
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_UNPICK: {
|
||||
case JSOp::Unpick: {
|
||||
unsigned n = GET_UINT8(pc);
|
||||
MOZ_ASSERT(ndefs == n + 1);
|
||||
uint32_t top = stackDepth + n;
|
||||
|
@ -673,76 +673,76 @@ uint32_t BytecodeParser::simulateOp(JSOp op, uint32_t offset,
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_AND:
|
||||
case JSOP_CHECKISOBJ:
|
||||
case JSOP_CHECKISCALLABLE:
|
||||
case JSOP_CHECKOBJCOERCIBLE:
|
||||
case JSOP_CHECKTHIS:
|
||||
case JSOP_CHECKTHISREINIT:
|
||||
case JSOP_CHECKCLASSHERITAGE:
|
||||
case JSOP_DEBUGCHECKSELFHOSTED:
|
||||
case JSOP_INITGLEXICAL:
|
||||
case JSOP_INITLEXICAL:
|
||||
case JSOP_OR:
|
||||
case JSOP_COALESCE:
|
||||
case JSOP_SETALIASEDVAR:
|
||||
case JSOP_SETARG:
|
||||
case JSOP_SETINTRINSIC:
|
||||
case JSOP_SETLOCAL:
|
||||
case JSOP_THROWSETALIASEDCONST:
|
||||
case JSOP_THROWSETCALLEE:
|
||||
case JSOP_THROWSETCONST:
|
||||
case JSOP_INITALIASEDLEXICAL:
|
||||
case JSOP_ITERNEXT:
|
||||
case JSOp::And:
|
||||
case JSOp::CheckIsObj:
|
||||
case JSOp::CheckIsCallable:
|
||||
case JSOp::CheckObjCoercible:
|
||||
case JSOp::CheckThis:
|
||||
case JSOp::CheckThisReinit:
|
||||
case JSOp::CheckClassHeritage:
|
||||
case JSOp::DebugCheckSelfHosted:
|
||||
case JSOp::InitGLexical:
|
||||
case JSOp::InitLexical:
|
||||
case JSOp::Or:
|
||||
case JSOp::Coalesce:
|
||||
case JSOp::SetAliasedVar:
|
||||
case JSOp::SetArg:
|
||||
case JSOp::SetIntrinsic:
|
||||
case JSOp::SetLocal:
|
||||
case JSOp::ThrowSetAliasedConst:
|
||||
case JSOp::ThrowSetCallee:
|
||||
case JSOp::ThrowSetConst:
|
||||
case JSOp::InitAliasedLexical:
|
||||
case JSOp::IterNext:
|
||||
// Keep the top value.
|
||||
MOZ_ASSERT(nuses == 1);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
break;
|
||||
|
||||
case JSOP_INITHOMEOBJECT:
|
||||
case JSOp::InitHomeObject:
|
||||
// Pop the top value, keep the other value.
|
||||
MOZ_ASSERT(nuses == 2);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
break;
|
||||
|
||||
case JSOP_CHECK_RESUMEKIND:
|
||||
case JSOp::CheckResumeKind:
|
||||
// Pop the top two values, keep the other value.
|
||||
MOZ_ASSERT(nuses == 3);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
break;
|
||||
|
||||
case JSOP_SETGNAME:
|
||||
case JSOP_SETNAME:
|
||||
case JSOP_SETPROP:
|
||||
case JSOP_STRICTSETGNAME:
|
||||
case JSOP_STRICTSETNAME:
|
||||
case JSOP_STRICTSETPROP:
|
||||
case JSOp::SetGName:
|
||||
case JSOp::SetName:
|
||||
case JSOp::SetProp:
|
||||
case JSOp::StrictSetGName:
|
||||
case JSOp::StrictSetName:
|
||||
case JSOp::StrictSetProp:
|
||||
// Keep the top value, removing other 1 value.
|
||||
MOZ_ASSERT(nuses == 2);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
offsetStack[stackDepth] = offsetStack[stackDepth + 1];
|
||||
break;
|
||||
|
||||
case JSOP_SETPROP_SUPER:
|
||||
case JSOP_STRICTSETPROP_SUPER:
|
||||
case JSOp::SetPropSuper:
|
||||
case JSOp::StrictSetPropSuper:
|
||||
// Keep the top value, removing other 2 values.
|
||||
MOZ_ASSERT(nuses == 3);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
offsetStack[stackDepth] = offsetStack[stackDepth + 2];
|
||||
break;
|
||||
|
||||
case JSOP_SETELEM_SUPER:
|
||||
case JSOP_STRICTSETELEM_SUPER:
|
||||
case JSOp::SetElemSuper:
|
||||
case JSOp::StrictSetElemSuper:
|
||||
// Keep the top value, removing other 3 values.
|
||||
MOZ_ASSERT(nuses == 4);
|
||||
MOZ_ASSERT(ndefs == 1);
|
||||
offsetStack[stackDepth] = offsetStack[stackDepth + 3];
|
||||
break;
|
||||
|
||||
case JSOP_ISGENCLOSING:
|
||||
case JSOP_ISNOITER:
|
||||
case JSOP_MOREITER:
|
||||
case JSOP_OPTIMIZE_SPREADCALL:
|
||||
case JSOp::IsGenClosing:
|
||||
case JSOp::IsNoIter:
|
||||
case JSOp::MoreIter:
|
||||
case JSOp::OptimizeSpreadCall:
|
||||
// Keep the top value and push one more value.
|
||||
MOZ_ASSERT(nuses == 1);
|
||||
MOZ_ASSERT(ndefs == 2);
|
||||
|
@ -875,7 +875,7 @@ bool BytecodeParser::parse() {
|
|||
#endif /* DEBUG */
|
||||
|
||||
switch (op) {
|
||||
case JSOP_TABLESWITCH: {
|
||||
case JSOp::TableSwitch: {
|
||||
uint32_t defaultOffset = offset + GET_JUMP_OFFSET(pc);
|
||||
jsbytecode* pc2 = pc + JUMP_OFFSET_LEN;
|
||||
int32_t low = GET_JUMP_OFFSET(pc2);
|
||||
|
@ -902,7 +902,7 @@ bool BytecodeParser::parse() {
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_TRY: {
|
||||
case JSOp::Try: {
|
||||
// Everything between a try and corresponding catch or finally is
|
||||
// conditional. Note that there is no problem with code which is skipped
|
||||
// by a thrown exception but is not caught by a later handler in the
|
||||
|
@ -935,7 +935,7 @@ bool BytecodeParser::parse() {
|
|||
if (IsJumpOpcode(op)) {
|
||||
// Case instructions do not push the lvalue back when branching.
|
||||
uint32_t newStackDepth = stackDepth;
|
||||
if (op == JSOP_CASE) {
|
||||
if (op == JSOp::Case) {
|
||||
newStackDepth--;
|
||||
}
|
||||
|
||||
|
@ -1613,7 +1613,7 @@ static unsigned Disassemble1(JSContext* cx, HandleScript script, jsbytecode* pc,
|
|||
goto print_int;
|
||||
|
||||
case JOF_INT32:
|
||||
MOZ_ASSERT(op == JSOP_INT32);
|
||||
MOZ_ASSERT(op == JSOp::Int32);
|
||||
i = GET_INT32(pc);
|
||||
print_int:
|
||||
if (!sp->jsprintf(" %d", i)) {
|
||||
|
@ -1753,14 +1753,14 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
}
|
||||
|
||||
switch (op) {
|
||||
case JSOP_DELNAME:
|
||||
case JSOp::DelName:
|
||||
return write("(delete ") && write(loadAtom(pc)) && write(")");
|
||||
|
||||
case JSOP_GETGNAME:
|
||||
case JSOP_GETNAME:
|
||||
case JSOP_GETINTRINSIC:
|
||||
case JSOp::GetGName:
|
||||
case JSOp::GetName:
|
||||
case JSOp::GetIntrinsic:
|
||||
return write(loadAtom(pc));
|
||||
case JSOP_GETARG: {
|
||||
case JSOp::GetArg: {
|
||||
unsigned slot = GET_ARGNO(pc);
|
||||
|
||||
// For self-hosted scripts that are called from non-self-hosted code,
|
||||
|
@ -1790,26 +1790,26 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
}
|
||||
return write(atom);
|
||||
}
|
||||
case JSOP_GETLOCAL: {
|
||||
case JSOp::GetLocal: {
|
||||
JSAtom* atom = FrameSlotName(script, pc);
|
||||
MOZ_ASSERT(atom);
|
||||
return write(atom);
|
||||
}
|
||||
case JSOP_GETALIASEDVAR: {
|
||||
case JSOp::GetAliasedVar: {
|
||||
JSAtom* atom = EnvironmentCoordinateNameSlow(script, pc);
|
||||
MOZ_ASSERT(atom);
|
||||
return write(atom);
|
||||
}
|
||||
|
||||
case JSOP_DELPROP:
|
||||
case JSOP_STRICTDELPROP:
|
||||
case JSOP_LENGTH:
|
||||
case JSOP_GETPROP:
|
||||
case JSOP_GETBOUNDNAME:
|
||||
case JSOP_CALLPROP: {
|
||||
bool hasDelete = op == JSOP_DELPROP || op == JSOP_STRICTDELPROP;
|
||||
case JSOp::DelProp:
|
||||
case JSOp::StrictDelProp:
|
||||
case JSOp::Length:
|
||||
case JSOp::GetProp:
|
||||
case JSOp::GetBoundName:
|
||||
case JSOp::CallProp: {
|
||||
bool hasDelete = op == JSOp::DelProp || op == JSOp::StrictDelProp;
|
||||
RootedAtom prop(cx,
|
||||
(op == JSOP_LENGTH) ? cx->names().length : loadAtom(pc));
|
||||
(op == JSOp::Length) ? cx->names().length : loadAtom(pc));
|
||||
MOZ_ASSERT(prop);
|
||||
return (hasDelete ? write("(delete ") : true) &&
|
||||
decompilePCForStackOperand(pc, -1) &&
|
||||
|
@ -1818,12 +1818,12 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
: write("[") && quote(prop, '\'') && write("]")) &&
|
||||
(hasDelete ? write(")") : true);
|
||||
}
|
||||
case JSOP_GETPROP_SUPER: {
|
||||
case JSOp::GetPropSuper: {
|
||||
RootedAtom prop(cx, loadAtom(pc));
|
||||
return write("super.") && quote(prop, '\0');
|
||||
}
|
||||
case JSOP_SETELEM:
|
||||
case JSOP_STRICTSETELEM:
|
||||
case JSOp::SetElem:
|
||||
case JSOp::StrictSetElem:
|
||||
// NOTE: We don't show the right hand side of the operation because
|
||||
// it's used in error messages like: "a[0] is not readable".
|
||||
//
|
||||
|
@ -1831,36 +1831,36 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
return decompilePCForStackOperand(pc, -3) && write("[") &&
|
||||
decompilePCForStackOperand(pc, -2) && write("]");
|
||||
|
||||
case JSOP_DELELEM:
|
||||
case JSOP_STRICTDELELEM:
|
||||
case JSOP_GETELEM:
|
||||
case JSOP_CALLELEM: {
|
||||
bool hasDelete = (op == JSOP_DELELEM || op == JSOP_STRICTDELELEM);
|
||||
case JSOp::DelElem:
|
||||
case JSOp::StrictDelElem:
|
||||
case JSOp::GetElem:
|
||||
case JSOp::CallElem: {
|
||||
bool hasDelete = (op == JSOp::DelElem || op == JSOp::StrictDelElem);
|
||||
return (hasDelete ? write("(delete ") : true) &&
|
||||
decompilePCForStackOperand(pc, -2) && write("[") &&
|
||||
decompilePCForStackOperand(pc, -1) && write("]") &&
|
||||
(hasDelete ? write(")") : true);
|
||||
}
|
||||
|
||||
case JSOP_GETELEM_SUPER:
|
||||
case JSOp::GetElemSuper:
|
||||
return write("super[") && decompilePCForStackOperand(pc, -2) &&
|
||||
write("]");
|
||||
case JSOP_NULL:
|
||||
case JSOp::Null:
|
||||
return write(js_null_str);
|
||||
case JSOP_TRUE:
|
||||
case JSOp::True:
|
||||
return write(js_true_str);
|
||||
case JSOP_FALSE:
|
||||
case JSOp::False:
|
||||
return write(js_false_str);
|
||||
case JSOP_ZERO:
|
||||
case JSOP_ONE:
|
||||
case JSOP_INT8:
|
||||
case JSOP_UINT16:
|
||||
case JSOP_UINT24:
|
||||
case JSOP_INT32:
|
||||
case JSOp::Zero:
|
||||
case JSOp::One:
|
||||
case JSOp::Int8:
|
||||
case JSOp::Uint16:
|
||||
case JSOp::Uint24:
|
||||
case JSOp::Int32:
|
||||
return sprinter.printf("%d", GetBytecodeInteger(pc));
|
||||
case JSOP_STRING:
|
||||
case JSOp::String:
|
||||
return quote(loadAtom(pc), '"');
|
||||
case JSOP_SYMBOL: {
|
||||
case JSOp::Symbol: {
|
||||
unsigned i = uint8_t(pc[1]);
|
||||
MOZ_ASSERT(i < JS::WellKnownSymbolLimit);
|
||||
if (i < JS::WellKnownSymbolLimit) {
|
||||
|
@ -1868,26 +1868,26 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case JSOP_UNDEFINED:
|
||||
case JSOp::Undefined:
|
||||
return write(js_undefined_str);
|
||||
case JSOP_GLOBALTHIS:
|
||||
case JSOp::GlobalThis:
|
||||
// |this| could convert to a very long object initialiser, so cite it by
|
||||
// its keyword name.
|
||||
return write(js_this_str);
|
||||
case JSOP_NEWTARGET:
|
||||
case JSOp::NewTarget:
|
||||
return write("new.target");
|
||||
case JSOP_CALL:
|
||||
case JSOP_CALL_IGNORES_RV:
|
||||
case JSOP_CALLITER:
|
||||
case JSOP_FUNCALL:
|
||||
case JSOP_FUNAPPLY:
|
||||
case JSOp::Call:
|
||||
case JSOp::CallIgnoresRv:
|
||||
case JSOp::CallIter:
|
||||
case JSOp::FunCall:
|
||||
case JSOp::FunApply:
|
||||
return decompilePCForStackOperand(pc, -int32_t(GET_ARGC(pc) + 2)) &&
|
||||
write("(...)");
|
||||
case JSOP_SPREADCALL:
|
||||
case JSOp::SpreadCall:
|
||||
return decompilePCForStackOperand(pc, -3) && write("(...)");
|
||||
case JSOP_NEWARRAY:
|
||||
case JSOp::NewArray:
|
||||
return write("[]");
|
||||
case JSOP_REGEXP: {
|
||||
case JSOp::RegExp: {
|
||||
RootedObject obj(cx, script->getObject(GET_UINT32_INDEX(pc)));
|
||||
JSString* str = obj->as<RegExpObject>().toString(cx);
|
||||
if (!str) {
|
||||
|
@ -1895,7 +1895,7 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
}
|
||||
return write(str);
|
||||
}
|
||||
case JSOP_NEWARRAY_COPYONWRITE: {
|
||||
case JSOp::NewArrayCopyOnWrite: {
|
||||
RootedObject obj(cx, script->getObject(GET_UINT32_INDEX(pc)));
|
||||
Handle<ArrayObject*> aobj = obj.as<ArrayObject>();
|
||||
if (!write("[")) {
|
||||
|
@ -1916,7 +1916,7 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
}
|
||||
return write("]");
|
||||
}
|
||||
case JSOP_OBJECT: {
|
||||
case JSOp::Object: {
|
||||
JSObject* obj = script->getObject(GET_UINT32_INDEX(pc));
|
||||
RootedValue objv(cx, ObjectValue(*obj));
|
||||
JSString* str = ValueToSource(cx, objv);
|
||||
|
@ -1925,40 +1925,40 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
}
|
||||
return write(str);
|
||||
}
|
||||
case JSOP_VOID:
|
||||
case JSOp::Void:
|
||||
return write("(void ") && decompilePCForStackOperand(pc, -1) &&
|
||||
write(")");
|
||||
|
||||
case JSOP_SUPERCALL:
|
||||
case JSOP_SPREADSUPERCALL:
|
||||
case JSOp::SuperCall:
|
||||
case JSOp::SpreadSuperCall:
|
||||
return write("super(...)");
|
||||
case JSOP_SUPERFUN:
|
||||
case JSOp::SuperFun:
|
||||
return write("super");
|
||||
|
||||
case JSOP_EVAL:
|
||||
case JSOP_SPREADEVAL:
|
||||
case JSOP_STRICTEVAL:
|
||||
case JSOP_STRICTSPREADEVAL:
|
||||
case JSOp::Eval:
|
||||
case JSOp::SpreadEval:
|
||||
case JSOp::StrictEval:
|
||||
case JSOp::StrictSpreadEval:
|
||||
return write("eval(...)");
|
||||
|
||||
case JSOP_NEW:
|
||||
case JSOp::New:
|
||||
return write("(new ") &&
|
||||
decompilePCForStackOperand(pc, -int32_t(GET_ARGC(pc) + 3)) &&
|
||||
write("(...))");
|
||||
|
||||
case JSOP_SPREADNEW:
|
||||
case JSOp::SpreadNew:
|
||||
return write("(new ") && decompilePCForStackOperand(pc, -4) &&
|
||||
write("(...))");
|
||||
|
||||
case JSOP_TYPEOF:
|
||||
case JSOP_TYPEOFEXPR:
|
||||
case JSOp::Typeof:
|
||||
case JSOp::TypeofExpr:
|
||||
return write("(typeof ") && decompilePCForStackOperand(pc, -1) &&
|
||||
write(")");
|
||||
|
||||
case JSOP_INITELEM_ARRAY:
|
||||
case JSOp::InitElemArray:
|
||||
return write("[...]");
|
||||
|
||||
case JSOP_INITELEM_INC:
|
||||
case JSOp::InitElemInc:
|
||||
if (defIndex == 0) {
|
||||
return write("[...]");
|
||||
}
|
||||
|
@ -1971,17 +1971,17 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
#endif
|
||||
break;
|
||||
|
||||
case JSOP_TONUMERIC:
|
||||
case JSOp::ToNumeric:
|
||||
return write("(tonumeric ") && decompilePCForStackOperand(pc, -1) &&
|
||||
write(")");
|
||||
|
||||
case JSOP_INC:
|
||||
case JSOp::Inc:
|
||||
return write("(inc ") && decompilePCForStackOperand(pc, -1) && write(")");
|
||||
|
||||
case JSOP_DEC:
|
||||
case JSOp::Dec:
|
||||
return write("(dec ") && decompilePCForStackOperand(pc, -1) && write(")");
|
||||
|
||||
case JSOP_BIGINT:
|
||||
case JSOp::BigInt:
|
||||
#if defined(DEBUG) || defined(JS_JITSPEW)
|
||||
// BigInt::dump() only available in this configuration.
|
||||
script->getBigInt(pc)->dump(sprinter);
|
||||
|
@ -1998,126 +1998,126 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
if (isStackDump) {
|
||||
// Special decompilation for stack dump.
|
||||
switch (op) {
|
||||
case JSOP_ARGUMENTS:
|
||||
case JSOp::Arguments:
|
||||
return write("arguments");
|
||||
|
||||
case JSOP_BINDGNAME:
|
||||
case JSOp::BindGName:
|
||||
return write("GLOBAL");
|
||||
|
||||
case JSOP_BINDNAME:
|
||||
case JSOP_BINDVAR:
|
||||
case JSOp::BindName:
|
||||
case JSOp::BindVar:
|
||||
return write("ENV");
|
||||
|
||||
case JSOP_CALLEE:
|
||||
case JSOp::Callee:
|
||||
return write("CALLEE");
|
||||
|
||||
case JSOP_ENVCALLEE:
|
||||
case JSOp::EnvCallee:
|
||||
return write("ENVCALLEE");
|
||||
|
||||
case JSOP_CALLSITEOBJ:
|
||||
case JSOp::CallSiteObj:
|
||||
return write("OBJ");
|
||||
|
||||
case JSOP_CLASSCONSTRUCTOR:
|
||||
case JSOP_DERIVEDCONSTRUCTOR:
|
||||
case JSOp::ClassConstructor:
|
||||
case JSOp::DerivedConstructor:
|
||||
return write("CONSTRUCTOR");
|
||||
|
||||
case JSOP_DOUBLE:
|
||||
case JSOp::Double:
|
||||
return sprinter.printf("%lf", GET_INLINE_VALUE(pc).toDouble());
|
||||
|
||||
case JSOP_EXCEPTION:
|
||||
case JSOp::Exception:
|
||||
return write("EXCEPTION");
|
||||
|
||||
case JSOP_FINALLY:
|
||||
case JSOp::Finally:
|
||||
if (defIndex == 0) {
|
||||
return write("THROWING");
|
||||
}
|
||||
MOZ_ASSERT(defIndex == 1);
|
||||
return write("PC");
|
||||
|
||||
case JSOP_GIMPLICITTHIS:
|
||||
case JSOP_FUNCTIONTHIS:
|
||||
case JSOP_IMPLICITTHIS:
|
||||
case JSOp::GImplicitThis:
|
||||
case JSOp::FunctionThis:
|
||||
case JSOp::ImplicitThis:
|
||||
return write("THIS");
|
||||
|
||||
case JSOP_FUNWITHPROTO:
|
||||
case JSOp::FunWithProto:
|
||||
return write("FUN");
|
||||
|
||||
case JSOP_GENERATOR:
|
||||
case JSOp::Generator:
|
||||
return write("GENERATOR");
|
||||
|
||||
case JSOP_GETIMPORT:
|
||||
case JSOp::GetImport:
|
||||
return write("VAL");
|
||||
|
||||
case JSOP_GETRVAL:
|
||||
case JSOp::GetRval:
|
||||
return write("RVAL");
|
||||
|
||||
case JSOP_HOLE:
|
||||
case JSOp::Hole:
|
||||
return write("HOLE");
|
||||
|
||||
case JSOP_ISGENCLOSING:
|
||||
case JSOp::IsGenClosing:
|
||||
// For stack dump, defIndex == 0 is not used.
|
||||
MOZ_ASSERT(defIndex == 1);
|
||||
return write("ISGENCLOSING");
|
||||
|
||||
case JSOP_ISNOITER:
|
||||
case JSOp::IsNoIter:
|
||||
// For stack dump, defIndex == 0 is not used.
|
||||
MOZ_ASSERT(defIndex == 1);
|
||||
return write("ISNOITER");
|
||||
|
||||
case JSOP_IS_CONSTRUCTING:
|
||||
case JSOp::IsConstructing:
|
||||
return write("JS_IS_CONSTRUCTING");
|
||||
|
||||
case JSOP_ITER:
|
||||
case JSOp::Iter:
|
||||
return write("ITER");
|
||||
|
||||
case JSOP_LAMBDA:
|
||||
case JSOP_LAMBDA_ARROW:
|
||||
case JSOp::Lambda:
|
||||
case JSOp::LambdaArrow:
|
||||
return write("FUN");
|
||||
|
||||
case JSOP_TOASYNCITER:
|
||||
case JSOp::ToAsyncIter:
|
||||
return write("ASYNCITER");
|
||||
|
||||
case JSOP_MOREITER:
|
||||
case JSOp::MoreIter:
|
||||
// For stack dump, defIndex == 0 is not used.
|
||||
MOZ_ASSERT(defIndex == 1);
|
||||
return write("MOREITER");
|
||||
|
||||
case JSOP_MUTATEPROTO:
|
||||
case JSOp::MutateProto:
|
||||
return write("SUCCEEDED");
|
||||
|
||||
case JSOP_NEWINIT:
|
||||
case JSOP_NEWOBJECT:
|
||||
case JSOP_NEWOBJECT_WITHGROUP:
|
||||
case JSOP_OBJWITHPROTO:
|
||||
case JSOp::NewInit:
|
||||
case JSOp::NewObject:
|
||||
case JSOp::NewObjectWithGroup:
|
||||
case JSOp::ObjWithProto:
|
||||
return write("OBJ");
|
||||
|
||||
case JSOP_OPTIMIZE_SPREADCALL:
|
||||
case JSOp::OptimizeSpreadCall:
|
||||
// For stack dump, defIndex == 0 is not used.
|
||||
MOZ_ASSERT(defIndex == 1);
|
||||
return write("OPTIMIZED");
|
||||
|
||||
case JSOP_REST:
|
||||
case JSOp::Rest:
|
||||
return write("REST");
|
||||
|
||||
case JSOP_RESUME:
|
||||
case JSOp::Resume:
|
||||
return write("RVAL");
|
||||
|
||||
case JSOP_SUPERBASE:
|
||||
case JSOp::SuperBase:
|
||||
return write("HOMEOBJECTPROTO");
|
||||
|
||||
case JSOP_TOID:
|
||||
case JSOp::ToId:
|
||||
return write("TOID(") && decompilePCForStackOperand(pc, -1) &&
|
||||
write(")");
|
||||
case JSOP_TOSTRING:
|
||||
case JSOp::ToString:
|
||||
return write("TOSTRING(") && decompilePCForStackOperand(pc, -1) &&
|
||||
write(")");
|
||||
|
||||
case JSOP_UNINITIALIZED:
|
||||
case JSOp::Uninitialized:
|
||||
return write("UNINITIALIZED");
|
||||
|
||||
case JSOP_INITIALYIELD:
|
||||
case JSOP_AWAIT:
|
||||
case JSOP_YIELD:
|
||||
case JSOp::InitialYield:
|
||||
case JSOp::Await:
|
||||
case JSOp::Yield:
|
||||
// Printing "yield SOMETHING" is confusing since the operand doesn't
|
||||
// match to the syntax, since the stack operand for "yield 10" is
|
||||
// the result object, not 10.
|
||||
|
@ -2130,11 +2130,11 @@ bool ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex) {
|
|||
MOZ_ASSERT(defIndex == 2);
|
||||
return write("RESUMEKIND");
|
||||
|
||||
case JSOP_RESUMEKIND:
|
||||
case JSOp::ResumeKind:
|
||||
return write("RESUMEKIND");
|
||||
|
||||
case JSOP_ASYNCAWAIT:
|
||||
case JSOP_ASYNCRESOLVE:
|
||||
case JSOp::AsyncAwait:
|
||||
case JSOp::AsyncResolve:
|
||||
return write("PROMISE");
|
||||
|
||||
default:
|
||||
|
@ -2458,7 +2458,7 @@ static bool DecompileArgumentFromStack(JSContext* cx, int formalIndex,
|
|||
|
||||
/* Don't handle getters, setters or calls from fun.call/fun.apply. */
|
||||
JSOp op = JSOp(*current);
|
||||
if (op != JSOP_CALL && op != JSOP_CALL_IGNORES_RV && op != JSOP_NEW) {
|
||||
if (op != JSOp::Call && op != JSOp::CallIgnoresRv && op != JSOp::New) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2472,7 +2472,7 @@ static bool DecompileArgumentFromStack(JSContext* cx, int formalIndex,
|
|||
return false;
|
||||
}
|
||||
|
||||
bool pushedNewTarget = op == JSOP_NEW;
|
||||
bool pushedNewTarget = op == JSOp::New;
|
||||
int formalStackIndex = parser.stackDepthAtPC(current) - GET_ARGC(current) -
|
||||
pushedNewTarget + formalIndex;
|
||||
MOZ_ASSERT(formalStackIndex >= 0);
|
||||
|
@ -3040,7 +3040,7 @@ bool js::GetSuccessorBytecodes(JSScript* script, jsbytecode* pc,
|
|||
if (!successors.append(pc + GET_JUMP_OFFSET(pc))) {
|
||||
return false;
|
||||
}
|
||||
} else if (op == JSOP_TABLESWITCH) {
|
||||
} else if (op == JSOp::TableSwitch) {
|
||||
if (!successors.append(pc + GET_JUMP_OFFSET(pc))) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -267,20 +267,20 @@ static inline void SET_ICINDEX(jsbytecode* pc, uint32_t icIndex) {
|
|||
}
|
||||
|
||||
static inline unsigned LoopHeadDepthHint(jsbytecode* pc) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::LoopHead);
|
||||
return GET_UINT8(pc + 4);
|
||||
}
|
||||
|
||||
static inline void SetLoopHeadDepthHint(jsbytecode* pc, unsigned loopDepth) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::LoopHead);
|
||||
uint8_t data = std::min(loopDepth, unsigned(UINT8_MAX));
|
||||
SET_UINT8(pc + 4, data);
|
||||
}
|
||||
|
||||
static inline bool IsBackedgePC(jsbytecode* pc) {
|
||||
switch (JSOp(*pc)) {
|
||||
case JSOP_GOTO:
|
||||
case JSOP_IFNE:
|
||||
case JSOp::Goto:
|
||||
case JSOp::IfNe:
|
||||
return GET_JUMP_OFFSET(pc) < 0;
|
||||
default:
|
||||
return false;
|
||||
|
@ -288,7 +288,7 @@ static inline bool IsBackedgePC(jsbytecode* pc) {
|
|||
}
|
||||
|
||||
static inline bool IsBackedgeForLoopHead(jsbytecode* pc, jsbytecode* loopHead) {
|
||||
MOZ_ASSERT(JSOp(*loopHead) == JSOP_LOOPHEAD);
|
||||
MOZ_ASSERT(JSOp(*loopHead) == JSOp::LoopHead);
|
||||
return IsBackedgePC(pc) && pc + GET_JUMP_OFFSET(pc) == loopHead;
|
||||
}
|
||||
|
||||
|
@ -296,8 +296,8 @@ 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(JSOp(*pc) == JSOp::ClassConstructor ||
|
||||
JSOp(*pc) == JSOp::DerivedConstructor);
|
||||
SET_UINT32(pc, atomIndex);
|
||||
SET_UINT32(pc + 4, sourceStart);
|
||||
SET_UINT32(pc + 8, sourceEnd);
|
||||
|
@ -307,8 +307,8 @@ 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(JSOp(*pc) == JSOp::ClassConstructor ||
|
||||
JSOp(*pc) == JSOp::DerivedConstructor);
|
||||
*atomIndex = GET_UINT32(pc);
|
||||
*sourceStart = GET_UINT32(pc + 4);
|
||||
*sourceEnd = GET_UINT32(pc + 8);
|
||||
|
@ -380,16 +380,16 @@ static inline bool IsJumpOpcode(JSOp op) { return JOF_OPTYPE(op) == JOF_JUMP; }
|
|||
|
||||
static inline bool BytecodeFallsThrough(JSOp op) {
|
||||
switch (op) {
|
||||
case JSOP_GOTO:
|
||||
case JSOP_DEFAULT:
|
||||
case JSOP_RETURN:
|
||||
case JSOP_RETRVAL:
|
||||
case JSOP_FINALYIELDRVAL:
|
||||
case JSOP_THROW:
|
||||
case JSOP_THROWMSG:
|
||||
case JSOP_TABLESWITCH:
|
||||
case JSOp::Goto:
|
||||
case JSOp::Default:
|
||||
case JSOp::Return:
|
||||
case JSOp::RetRval:
|
||||
case JSOp::FinalYieldRval:
|
||||
case JSOp::Throw:
|
||||
case JSOp::ThrowMsg:
|
||||
case JSOp::TableSwitch:
|
||||
return false;
|
||||
case JSOP_GOSUB:
|
||||
case JSOp::Gosub:
|
||||
/* These fall through indirectly, after executing a 'finally'. */
|
||||
return true;
|
||||
default:
|
||||
|
@ -399,9 +399,9 @@ static inline bool BytecodeFallsThrough(JSOp op) {
|
|||
|
||||
static inline bool BytecodeIsJumpTarget(JSOp op) {
|
||||
switch (op) {
|
||||
case JSOP_JUMPTARGET:
|
||||
case JSOP_LOOPHEAD:
|
||||
case JSOP_AFTERYIELD:
|
||||
case JSOp::JumpTarget:
|
||||
case JSOp::LoopHead:
|
||||
case JSOp::AfterYield:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@ -417,17 +417,17 @@ MOZ_ALWAYS_INLINE unsigned StackUses(jsbytecode* pc) {
|
|||
|
||||
MOZ_ASSERT(nuses == -1);
|
||||
switch (op) {
|
||||
case JSOP_POPN:
|
||||
case JSOp::PopN:
|
||||
return GET_UINT16(pc);
|
||||
case JSOP_NEW:
|
||||
case JSOP_SUPERCALL:
|
||||
case JSOp::New:
|
||||
case JSOp::SuperCall:
|
||||
return 2 + GET_ARGC(pc) + 1;
|
||||
default:
|
||||
/* stack: fun, this, [argc arguments] */
|
||||
MOZ_ASSERT(op == JSOP_CALL || op == JSOP_CALL_IGNORES_RV ||
|
||||
op == JSOP_EVAL || op == JSOP_CALLITER ||
|
||||
op == JSOP_STRICTEVAL || op == JSOP_FUNCALL ||
|
||||
op == JSOP_FUNAPPLY);
|
||||
MOZ_ASSERT(op == JSOp::Call || op == JSOp::CallIgnoresRv ||
|
||||
op == JSOp::Eval || op == JSOp::CallIter ||
|
||||
op == JSOp::StrictEval || op == JSOp::FunCall ||
|
||||
op == JSOp::FunApply);
|
||||
return 2 + GET_ARGC(pc);
|
||||
}
|
||||
}
|
||||
|
@ -496,35 +496,35 @@ static inline unsigned GetBytecodeLength(jsbytecode* pc) {
|
|||
|
||||
static inline bool BytecodeIsPopped(jsbytecode* pc) {
|
||||
jsbytecode* next = pc + GetBytecodeLength(pc);
|
||||
return JSOp(*next) == JSOP_POP;
|
||||
return JSOp(*next) == JSOp::Pop;
|
||||
}
|
||||
|
||||
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 (JSOp(*next) == JSOp::BitOr || JSOp(*next) == JSOp::BitAnd) {
|
||||
return true;
|
||||
}
|
||||
if (JSOp(*next) == JSOP_INT8 && GET_INT8(next) == -1) {
|
||||
if (JSOp(*next) == JSOp::Int8 && GET_INT8(next) == -1) {
|
||||
next += GetBytecodeLength(next);
|
||||
if (JSOp(*next) == JSOP_BITAND) {
|
||||
if (JSOp(*next) == JSOp::BitAnd) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (JSOp(*next) == JSOP_ONE) {
|
||||
if (JSOp(*next) == JSOp::One) {
|
||||
next += GetBytecodeLength(next);
|
||||
if (JSOp(*next) == JSOP_NEG) {
|
||||
if (JSOp(*next) == JSOp::Neg) {
|
||||
next += GetBytecodeLength(next);
|
||||
if (JSOp(*next) == JSOP_BITAND) {
|
||||
if (JSOp(*next) == JSOp::BitAnd) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (JSOp(*next) == JSOP_ZERO) {
|
||||
if (JSOp(*next) == JSOp::Zero) {
|
||||
next += GetBytecodeLength(next);
|
||||
if (JSOp(*next) == JSOP_BITOR) {
|
||||
if (JSOp(*next) == JSOp::BitOr) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -539,12 +539,12 @@ inline bool FlowsIntoNext(JSOp op) {
|
|||
// JSOp::Yield/JSOp::Await is considered to flow into the next instruction,
|
||||
// like JSOp::Call.
|
||||
switch (op) {
|
||||
case JSOP_RETRVAL:
|
||||
case JSOP_RETURN:
|
||||
case JSOP_THROW:
|
||||
case JSOP_GOTO:
|
||||
case JSOP_RETSUB:
|
||||
case JSOP_FINALYIELDRVAL:
|
||||
case JSOp::RetRval:
|
||||
case JSOp::Return:
|
||||
case JSOp::Throw:
|
||||
case JSOp::Goto:
|
||||
case JSOp::Retsub:
|
||||
case JSOp::FinalYieldRval:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
|
@ -568,11 +568,11 @@ inline bool IsPropertyInitOp(JSOp op) {
|
|||
}
|
||||
|
||||
inline bool IsLooseEqualityOp(JSOp op) {
|
||||
return op == JSOP_EQ || op == JSOP_NE;
|
||||
return op == JSOp::Eq || op == JSOp::Ne;
|
||||
}
|
||||
|
||||
inline bool IsStrictEqualityOp(JSOp op) {
|
||||
return op == JSOP_STRICTEQ || op == JSOP_STRICTNE;
|
||||
return op == JSOp::StrictEq || op == JSOp::StrictNe;
|
||||
}
|
||||
|
||||
inline bool IsEqualityOp(JSOp op) {
|
||||
|
@ -580,7 +580,7 @@ inline bool IsEqualityOp(JSOp op) {
|
|||
}
|
||||
|
||||
inline bool IsRelationalOp(JSOp op) {
|
||||
return op == JSOP_LT || op == JSOP_LE || op == JSOP_GT || op == JSOP_GE;
|
||||
return op == JSOp::Lt || op == JSOp::Le || op == JSOp::Gt || op == JSOp::Ge;
|
||||
}
|
||||
|
||||
inline bool IsCheckStrictOp(JSOp op) {
|
||||
|
@ -600,39 +600,39 @@ inline bool IsCheckSloppyOp(JSOp op) {
|
|||
inline bool IsAtomOp(JSOp op) { return JOF_OPTYPE(op) == JOF_ATOM; }
|
||||
|
||||
inline bool IsGetPropOp(JSOp op) {
|
||||
return op == JSOP_LENGTH || op == JSOP_GETPROP || op == JSOP_CALLPROP;
|
||||
return op == JSOp::Length || op == JSOp::GetProp || op == JSOp::CallProp;
|
||||
}
|
||||
|
||||
inline bool IsGetPropPC(const jsbytecode* pc) { return IsGetPropOp(JSOp(*pc)); }
|
||||
|
||||
inline bool IsHiddenInitOp(JSOp op) {
|
||||
return op == JSOP_INITHIDDENPROP || op == JSOP_INITHIDDENELEM ||
|
||||
op == JSOP_INITHIDDENPROP_GETTER || op == JSOP_INITHIDDENELEM_GETTER ||
|
||||
op == JSOP_INITHIDDENPROP_SETTER || op == JSOP_INITHIDDENELEM_SETTER;
|
||||
return op == JSOp::InitHiddenProp || op == JSOp::InitHiddenElem ||
|
||||
op == JSOp::InitHiddenPropGetter || op == JSOp::InitHiddenElemGetter ||
|
||||
op == JSOp::InitHiddenPropSetter || op == JSOp::InitHiddenElemSetter;
|
||||
}
|
||||
|
||||
inline bool IsStrictSetPC(jsbytecode* pc) {
|
||||
JSOp op = JSOp(*pc);
|
||||
return op == JSOP_STRICTSETPROP || op == JSOP_STRICTSETNAME ||
|
||||
op == JSOP_STRICTSETGNAME || op == JSOP_STRICTSETELEM;
|
||||
return op == JSOp::StrictSetProp || op == JSOp::StrictSetName ||
|
||||
op == JSOp::StrictSetGName || op == JSOp::StrictSetElem;
|
||||
}
|
||||
|
||||
inline bool IsSetPropOp(JSOp op) {
|
||||
return op == JSOP_SETPROP || op == JSOP_STRICTSETPROP || op == JSOP_SETNAME ||
|
||||
op == JSOP_STRICTSETNAME || op == JSOP_SETGNAME ||
|
||||
op == JSOP_STRICTSETGNAME;
|
||||
return op == JSOp::SetProp || op == JSOp::StrictSetProp ||
|
||||
op == JSOp::SetName || op == JSOp::StrictSetName ||
|
||||
op == JSOp::SetGName || op == JSOp::StrictSetGName;
|
||||
}
|
||||
|
||||
inline bool IsSetPropPC(const jsbytecode* pc) { return IsSetPropOp(JSOp(*pc)); }
|
||||
|
||||
inline bool IsGetElemOp(JSOp op) {
|
||||
return op == JSOP_GETELEM || op == JSOP_CALLELEM;
|
||||
return op == JSOp::GetElem || op == JSOp::CallElem;
|
||||
}
|
||||
|
||||
inline bool IsGetElemPC(const jsbytecode* pc) { return IsGetElemOp(JSOp(*pc)); }
|
||||
|
||||
inline bool IsSetElemOp(JSOp op) {
|
||||
return op == JSOP_SETELEM || op == JSOP_STRICTSETELEM;
|
||||
return op == JSOp::SetElem || op == JSOp::StrictSetElem;
|
||||
}
|
||||
|
||||
inline bool IsSetElemPC(const jsbytecode* pc) { return IsSetElemOp(JSOp(*pc)); }
|
||||
|
@ -647,7 +647,7 @@ inline bool IsInvokePC(jsbytecode* pc) { return IsInvokeOp(JSOp(*pc)); }
|
|||
|
||||
inline bool IsStrictEvalPC(jsbytecode* pc) {
|
||||
JSOp op = JSOp(*pc);
|
||||
return op == JSOP_STRICTEVAL || op == JSOP_STRICTSPREADEVAL;
|
||||
return op == JSOp::StrictEval || op == JSOp::StrictSpreadEval;
|
||||
}
|
||||
|
||||
inline bool IsConstructOp(JSOp op) {
|
||||
|
@ -663,17 +663,17 @@ inline bool IsSpreadPC(const jsbytecode* pc) { return IsSpreadOp(JSOp(*pc)); }
|
|||
|
||||
static inline int32_t GetBytecodeInteger(jsbytecode* pc) {
|
||||
switch (JSOp(*pc)) {
|
||||
case JSOP_ZERO:
|
||||
case JSOp::Zero:
|
||||
return 0;
|
||||
case JSOP_ONE:
|
||||
case JSOp::One:
|
||||
return 1;
|
||||
case JSOP_UINT16:
|
||||
case JSOp::Uint16:
|
||||
return GET_UINT16(pc);
|
||||
case JSOP_UINT24:
|
||||
case JSOp::Uint24:
|
||||
return GET_UINT24(pc);
|
||||
case JSOP_INT8:
|
||||
case JSOp::Int8:
|
||||
return GET_INT8(pc);
|
||||
case JSOP_INT32:
|
||||
case JSOp::Int32:
|
||||
return GET_INT32(pc);
|
||||
default:
|
||||
MOZ_CRASH("Bad op");
|
||||
|
|
|
@ -157,8 +157,8 @@ void LCovSource::writeScript(JSScript* script, const char* scriptName) {
|
|||
for (jsbytecode* pc = script->code(); pc != end; pc = GetNextPc(pc)) {
|
||||
MOZ_ASSERT(script->code() <= pc && pc < end);
|
||||
JSOp op = JSOp(*pc);
|
||||
bool jump = IsJumpOpcode(op) || op == JSOP_TABLESWITCH;
|
||||
bool fallsthrough = BytecodeFallsThrough(op) && op != JSOP_GOSUB;
|
||||
bool jump = IsJumpOpcode(op) || op == JSOp::TableSwitch;
|
||||
bool fallsthrough = BytecodeFallsThrough(op) && op != JSOp::Gosub;
|
||||
|
||||
// If the current script & pc has a hit-count report, then update the
|
||||
// current number of hits.
|
||||
|
@ -256,7 +256,7 @@ void LCovSource::writeScript(JSScript* script, const char* scriptName) {
|
|||
|
||||
// If the current pc corresponds to a pre-computed switch case, then
|
||||
// reports branch hits for each case statement.
|
||||
if (jump && op == JSOP_TABLESWITCH) {
|
||||
if (jump && op == JSOp::TableSwitch) {
|
||||
// Get the default pc.
|
||||
jsbytecode* defaultpc = pc + GET_JUMP_OFFSET(pc);
|
||||
MOZ_ASSERT(script->code() <= defaultpc && defaultpc < end);
|
||||
|
|
|
@ -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 (JSOp(*it) == JSOp::FunctionThis) {
|
||||
// The next op after JSOp::FunctionThis always sets it.
|
||||
executedInitThisOp = pc > GetNextPc(it);
|
||||
break;
|
||||
|
@ -3845,15 +3845,15 @@ static bool RemoveReferencedNames(JSContext* cx, HandleScript script,
|
|||
PropertyName* name;
|
||||
|
||||
switch (loc.getOp()) {
|
||||
case JSOP_GETNAME:
|
||||
case JSOP_SETNAME:
|
||||
case JSOP_STRICTSETNAME:
|
||||
case JSOp::GetName:
|
||||
case JSOp::SetName:
|
||||
case JSOp::StrictSetName:
|
||||
name = script->getName(loc.toRawBytecode());
|
||||
break;
|
||||
|
||||
case JSOP_GETGNAME:
|
||||
case JSOP_SETGNAME:
|
||||
case JSOP_STRICTSETGNAME:
|
||||
case JSOp::GetGName:
|
||||
case JSOp::SetGName:
|
||||
case JSOp::StrictSetGName:
|
||||
if (script->hasNonSyntacticScope()) {
|
||||
name = script->getName(loc.toRawBytecode());
|
||||
} else {
|
||||
|
@ -3861,8 +3861,8 @@ static bool RemoveReferencedNames(JSContext* cx, HandleScript script,
|
|||
}
|
||||
break;
|
||||
|
||||
case JSOP_GETALIASEDVAR:
|
||||
case JSOP_SETALIASEDVAR:
|
||||
case JSOp::GetAliasedVar:
|
||||
case JSOp::SetAliasedVar:
|
||||
name = EnvironmentCoordinateNameSlow(script, loc.toRawBytecode());
|
||||
break;
|
||||
|
||||
|
|
|
@ -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(JSOp(*pc) == JSOp::InitialYield || JSOp(*pc) == JSOp::Yield ||
|
||||
JSOp(*pc) == JSOp::Await);
|
||||
|
||||
auto genObj = obj.as<AbstractGeneratorObject>();
|
||||
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(JSOp(*pc) == JSOp::Await, genObj->callee().isAsync());
|
||||
MOZ_ASSERT_IF(JSOp(*pc) == JSOp::Yield, genObj->callee().isGenerator());
|
||||
|
||||
ArrayObject* stack = nullptr;
|
||||
if (nvalues > 0) {
|
||||
|
@ -343,11 +343,11 @@ const JSClass js::GeneratorFunctionClass = {
|
|||
"GeneratorFunction", 0, JS_NULL_CLASS_OPS, &GeneratorFunctionClassSpec};
|
||||
|
||||
bool AbstractGeneratorObject::isAfterYield() {
|
||||
return isAfterYieldOrAwait(JSOP_YIELD);
|
||||
return isAfterYieldOrAwait(JSOp::Yield);
|
||||
}
|
||||
|
||||
bool AbstractGeneratorObject::isAfterAwait() {
|
||||
return isAfterYieldOrAwait(JSOP_AWAIT);
|
||||
return isAfterYieldOrAwait(JSOp::Await);
|
||||
}
|
||||
|
||||
bool AbstractGeneratorObject::isAfterYieldOrAwait(JSOp op) {
|
||||
|
@ -358,19 +358,19 @@ 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 (JSOp(code[nextOffset]) != JSOp::AfterYield) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static_assert(JSOpLength_Yield == JSOpLength_InitialYield,
|
||||
"JSOP_YIELD and JSOP_INITIALYIELD must have the same length");
|
||||
"JSOp::Yield and JSOp::InitialYield must have the same length");
|
||||
static_assert(JSOpLength_Yield == JSOpLength_Await,
|
||||
"JSOP_YIELD and JSOP_AWAIT must have the same length");
|
||||
"JSOp::Yield and JSOp::Await must have the same length");
|
||||
|
||||
uint32_t offset = nextOffset - JSOpLength_Yield;
|
||||
JSOp prevOp = JSOp(code[offset]);
|
||||
MOZ_ASSERT(prevOp == JSOP_INITIALYIELD || prevOp == JSOP_YIELD ||
|
||||
prevOp == JSOP_AWAIT);
|
||||
MOZ_ASSERT(prevOp == JSOp::InitialYield || prevOp == JSOp::Yield ||
|
||||
prevOp == JSOp::Await);
|
||||
|
||||
return prevOp == op;
|
||||
}
|
||||
|
|
|
@ -125,12 +125,12 @@ 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(JSOp(*pc) == JSOp::InitialYield || JSOp(*pc) == JSOp::Yield ||
|
||||
JSOp(*pc) == JSOp::Await);
|
||||
|
||||
MOZ_ASSERT_IF(JSOp(*pc) == JSOP_INITIALYIELD,
|
||||
MOZ_ASSERT_IF(JSOp(*pc) == JSOp::InitialYield,
|
||||
getFixedSlot(RESUME_INDEX_SLOT).isUndefined());
|
||||
MOZ_ASSERT_IF(JSOp(*pc) != JSOP_INITIALYIELD, isRunning());
|
||||
MOZ_ASSERT_IF(JSOp(*pc) != JSOp::InitialYield, isRunning());
|
||||
|
||||
uint32_t resumeIndex = GET_UINT24(pc);
|
||||
MOZ_ASSERT(resumeIndex < uint32_t(RESUME_INDEX_RUNNING));
|
||||
|
@ -217,7 +217,7 @@ inline GeneratorResumeKind IntToResumeKind(int32_t value) {
|
|||
}
|
||||
|
||||
inline GeneratorResumeKind ResumeKindFromPC(jsbytecode* pc) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_RESUMEKIND);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::ResumeKind);
|
||||
return IntToResumeKind(GET_UINT8(pc));
|
||||
}
|
||||
|
||||
|
|
|
@ -306,16 +306,16 @@ 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(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) &&
|
||||
(JSOp(*pc) == JSOp::SetGName || JSOp(*pc) == JSOp::StrictSetGName) &&
|
||||
!script->hasNonSyntacticScope(),
|
||||
env == cx->global() || env == &cx->global()->lexicalEnvironment() ||
|
||||
env->is<RuntimeLexicalErrorObject>());
|
||||
|
||||
bool strict =
|
||||
JSOp(*pc) == JSOP_STRICTSETNAME || JSOp(*pc) == JSOP_STRICTSETGNAME;
|
||||
JSOp(*pc) == JSOp::StrictSetName || JSOp(*pc) == JSOp::StrictSetGName;
|
||||
RootedPropertyName name(cx, script->getName(pc));
|
||||
|
||||
// In strict mode, assigning to an undeclared global variable is an
|
||||
|
@ -347,7 +347,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(JSOp(*pc) == JSOp::InitGLexical);
|
||||
Rooted<LexicalEnvironmentObject*> lexicalEnv(cx, lexicalEnvArg);
|
||||
RootedShape shape(cx, lexicalEnv->lookup(cx, script->getName(pc)));
|
||||
MOZ_ASSERT(shape);
|
||||
|
@ -403,7 +403,7 @@ static MOZ_ALWAYS_INLINE bool IncOperation(JSContext* cx,
|
|||
return true;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(val.isBigInt(), "+1 only callable on result of JSOP_TONUMERIC");
|
||||
MOZ_ASSERT(val.isBigInt(), "+1 only callable on result of JSOp::ToNumeric");
|
||||
return BigInt::incValue(cx, val, res);
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ static MOZ_ALWAYS_INLINE bool DecOperation(JSContext* cx,
|
|||
return true;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(val.isBigInt(), "-1 only callable on result of JSOP_TONUMERIC");
|
||||
MOZ_ASSERT(val.isBigInt(), "-1 only callable on result of JSOp::ToNumeric");
|
||||
return BigInt::decValue(cx, val, res);
|
||||
}
|
||||
|
||||
|
@ -444,9 +444,9 @@ static MOZ_ALWAYS_INLINE bool ToIdOperation(JSContext* cx, HandleValue idval,
|
|||
static MOZ_ALWAYS_INLINE bool GetObjectElementOperation(
|
||||
JSContext* cx, JSOp op, JS::HandleObject obj, JS::HandleValue receiver,
|
||||
HandleValue key, MutableHandleValue res) {
|
||||
MOZ_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM ||
|
||||
op == JSOP_GETELEM_SUPER);
|
||||
MOZ_ASSERT_IF(op == JSOP_GETELEM || op == JSOP_CALLELEM,
|
||||
MOZ_ASSERT(op == JSOp::GetElem || op == JSOp::CallElem ||
|
||||
op == JSOp::GetElemSuper);
|
||||
MOZ_ASSERT_IF(op == JSOp::GetElem || op == JSOp::CallElem,
|
||||
obj == &receiver.toObject());
|
||||
|
||||
do {
|
||||
|
@ -496,7 +496,7 @@ static MOZ_ALWAYS_INLINE bool GetObjectElementOperation(
|
|||
static MOZ_ALWAYS_INLINE bool GetPrimitiveElementOperation(
|
||||
JSContext* cx, JSOp op, JS::HandleValue receiver, HandleValue key,
|
||||
MutableHandleValue res) {
|
||||
MOZ_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM);
|
||||
MOZ_ASSERT(op == JSOp::GetElem || op == JSOp::CallElem);
|
||||
|
||||
// FIXME: Bug 1234324 We shouldn't be boxing here.
|
||||
RootedObject boxed(cx, ToObjectFromStackForPropertyAccess(cx, receiver, key));
|
||||
|
@ -576,7 +576,7 @@ static MOZ_ALWAYS_INLINE bool GetElementOperation(JSContext* cx, JSOp op,
|
|||
HandleValue lref,
|
||||
HandleValue rref,
|
||||
MutableHandleValue res) {
|
||||
MOZ_ASSERT(op == JSOP_GETELEM || op == JSOP_CALLELEM);
|
||||
MOZ_ASSERT(op == JSOp::GetElem || op == JSOp::CallElem);
|
||||
|
||||
uint32_t index;
|
||||
if (lref.isString() && IsDefinitelyIndex(rref, &index)) {
|
||||
|
@ -628,11 +628,11 @@ static MOZ_ALWAYS_INLINE bool InitArrayElemOperation(JSContext* cx,
|
|||
uint32_t index,
|
||||
HandleValue val) {
|
||||
JSOp op = JSOp(*pc);
|
||||
MOZ_ASSERT(op == JSOP_INITELEM_ARRAY || op == JSOP_INITELEM_INC);
|
||||
MOZ_ASSERT(op == JSOp::InitElemArray || op == JSOp::InitElemInc);
|
||||
|
||||
MOZ_ASSERT(obj->is<ArrayObject>());
|
||||
|
||||
if (op == JSOP_INITELEM_INC && index == INT32_MAX) {
|
||||
if (op == JSOp::InitElemInc && index == INT32_MAX) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_SPREAD_TOO_LARGE);
|
||||
return false;
|
||||
|
@ -651,7 +651,7 @@ static MOZ_ALWAYS_INLINE bool InitArrayElemOperation(JSContext* cx,
|
|||
* cannot follow SpreadElements.
|
||||
*/
|
||||
if (val.isMagic(JS_ELEMENTS_HOLE)) {
|
||||
if (op == JSOP_INITELEM_INC) {
|
||||
if (op == JSOp::InitElemInc) {
|
||||
if (!SetLengthProperty(cx, obj, index + 1)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -668,7 +668,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(JSOp(*pc) == JSOp::CallSiteObj);
|
||||
|
||||
RootedArrayObject cso(cx, &script->getObject(pc)->as<ArrayObject>());
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ static inline bool GetPropertyOperation(JSContext* cx, InterpreterFrame* fp,
|
|||
MutableHandleValue vp) {
|
||||
JSOp op = JSOp(*pc);
|
||||
|
||||
if (op == JSOP_LENGTH) {
|
||||
if (op == JSOp::Length) {
|
||||
if (IsOptimizedArguments(fp, lval)) {
|
||||
vp.setInt32(fp->numActualArgs());
|
||||
return true;
|
||||
|
@ -239,7 +239,7 @@ static inline bool GetNameOperation(JSContext* cx, InterpreterFrame* fp,
|
|||
|
||||
/* Kludge to allow (typeof foo == "undefined") tests. */
|
||||
JSOp op2 = JSOp(pc[JSOpLength_GetName]);
|
||||
if (op2 == JSOP_TYPEOF) {
|
||||
if (op2 == JSOp::Typeof) {
|
||||
return GetEnvironmentName<GetNameMode::TypeOf>(cx, envChain, name, vp);
|
||||
}
|
||||
return GetEnvironmentName<GetNameMode::Normal>(cx, envChain, name, vp);
|
||||
|
@ -260,7 +260,7 @@ bool js::GetImportOperation(JSContext* cx, HandleObject envChain,
|
|||
|
||||
static bool SetPropertyOperation(JSContext* cx, JSOp op, HandleValue lval,
|
||||
HandleId id, HandleValue rval) {
|
||||
MOZ_ASSERT(op == JSOP_SETPROP || op == JSOP_STRICTSETPROP);
|
||||
MOZ_ASSERT(op == JSOp::SetProp || op == JSOp::StrictSetProp);
|
||||
|
||||
RootedObject obj(cx, ToObjectFromStackForPropertyAccess(cx, lval, id));
|
||||
if (!obj) {
|
||||
|
@ -270,13 +270,13 @@ static bool SetPropertyOperation(JSContext* cx, JSOp op, HandleValue lval,
|
|||
ObjectOpResult result;
|
||||
return SetProperty(cx, obj, id, rval, lval, result) &&
|
||||
result.checkStrictErrorOrWarning(cx, obj, id,
|
||||
op == JSOP_STRICTSETPROP);
|
||||
op == JSOp::StrictSetProp);
|
||||
}
|
||||
|
||||
JSFunction* js::MakeDefaultConstructor(JSContext* cx, HandleScript script,
|
||||
jsbytecode* pc, HandleObject proto) {
|
||||
JSOp op = JSOp(*pc);
|
||||
bool derived = op == JSOP_DERIVEDCONSTRUCTOR;
|
||||
bool derived = op == JSOp::DerivedConstructor;
|
||||
MOZ_ASSERT(derived == !!proto);
|
||||
|
||||
uint32_t atomIndex = 0;
|
||||
|
@ -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 -= JSOpLength_Try;
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_TRY);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::Try);
|
||||
} else if (tn->kind == JSTRY_DESTRUCTURING) {
|
||||
pc -= JSOpLength_TryDestructuring;
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_TRY_DESTRUCTURING);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::TryDestructuring);
|
||||
}
|
||||
return pc;
|
||||
}
|
||||
|
@ -1340,7 +1340,7 @@ JS_STATIC_ASSERT(JSOpLength_SetName == JSOpLength_SetProp);
|
|||
|
||||
/* See TRY_BRANCH_AFTER_COND. */
|
||||
JS_STATIC_ASSERT(JSOpLength_IfNe == JSOpLength_IfEq);
|
||||
JS_STATIC_ASSERT(uint8_t(JSOP_IFNE) == uint8_t(JSOP_IFEQ) + 1);
|
||||
JS_STATIC_ASSERT(uint8_t(JSOp::IfNe) == uint8_t(JSOp::IfEq) + 1);
|
||||
|
||||
/*
|
||||
* Compute the implicit |this| value used by a call expression with an
|
||||
|
@ -2067,7 +2067,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
|
||||
/* Resume execution in the calling frame. */
|
||||
if (MOZ_LIKELY(interpReturnOK)) {
|
||||
if (JSOp(*REGS.pc) == JSOP_RESUME) {
|
||||
if (JSOp(*REGS.pc) == JSOp::Resume) {
|
||||
ADVANCE_AND_DISPATCH(JSOpLength_Resume);
|
||||
}
|
||||
|
||||
|
@ -2080,9 +2080,9 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
} else {
|
||||
// Stack should be empty for the outer frame, unless we executed the
|
||||
// first |await| expression in an async function.
|
||||
MOZ_ASSERT(
|
||||
REGS.stackDepth() == 0 ||
|
||||
(JSOp(*REGS.pc) == JSOP_AWAIT && !REGS.fp()->isResumedGenerator()));
|
||||
MOZ_ASSERT(REGS.stackDepth() == 0 ||
|
||||
(JSOp(*REGS.pc) == JSOp::Await &&
|
||||
!REGS.fp()->isResumedGenerator()));
|
||||
}
|
||||
goto exit;
|
||||
}
|
||||
|
@ -2141,18 +2141,18 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
if (!ToPropertyKey(cx, REGS.stackHandleAt(n), &(id))) goto error; \
|
||||
JS_END_MACRO
|
||||
|
||||
#define TRY_BRANCH_AFTER_COND(cond, spdec) \
|
||||
JS_BEGIN_MACRO \
|
||||
MOZ_ASSERT(GetBytecodeLength(REGS.pc) == 1); \
|
||||
unsigned diff_ = (unsigned)GET_UINT8(REGS.pc) - (unsigned)JSOP_IFEQ; \
|
||||
if (diff_ <= 1) { \
|
||||
REGS.sp -= (spdec); \
|
||||
if ((cond) == (diff_ != 0)) { \
|
||||
++REGS.pc; \
|
||||
BRANCH(GET_JUMP_OFFSET(REGS.pc)); \
|
||||
} \
|
||||
ADVANCE_AND_DISPATCH(1 + JSOpLength_IfEq); \
|
||||
} \
|
||||
#define TRY_BRANCH_AFTER_COND(cond, spdec) \
|
||||
JS_BEGIN_MACRO \
|
||||
MOZ_ASSERT(GetBytecodeLength(REGS.pc) == 1); \
|
||||
unsigned diff_ = (unsigned)GET_UINT8(REGS.pc) - (unsigned)JSOp::IfEq; \
|
||||
if (diff_ <= 1) { \
|
||||
REGS.sp -= (spdec); \
|
||||
if ((cond) == (diff_ != 0)) { \
|
||||
++REGS.pc; \
|
||||
BRANCH(GET_JUMP_OFFSET(REGS.pc)); \
|
||||
} \
|
||||
ADVANCE_AND_DISPATCH(1 + JSOpLength_IfEq); \
|
||||
} \
|
||||
JS_END_MACRO
|
||||
|
||||
CASE(In) {
|
||||
|
@ -2281,7 +2281,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
CASE(BindName) {
|
||||
JSOp op = JSOp(*REGS.pc);
|
||||
ReservedRooted<JSObject*> envChain(&rootObject0);
|
||||
if (op == JSOP_BINDNAME || script->hasNonSyntacticScope()) {
|
||||
if (op == JSOp::BindName || script->hasNonSyntacticScope()) {
|
||||
envChain.set(REGS.fp()->environmentChain());
|
||||
} else {
|
||||
envChain.set(®S.fp()->global().lexicalEnvironment());
|
||||
|
@ -2600,7 +2600,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
if (!DeleteProperty(cx, obj, id, result)) {
|
||||
goto error;
|
||||
}
|
||||
if (!result && JSOp(*REGS.pc) == JSOP_STRICTDELPROP) {
|
||||
if (!result && JSOp(*REGS.pc) == JSOp::StrictDelProp) {
|
||||
result.reportError(cx, obj, id);
|
||||
goto error;
|
||||
}
|
||||
|
@ -2627,7 +2627,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
if (!DeleteProperty(cx, obj, id, result)) {
|
||||
goto error;
|
||||
}
|
||||
if (!result && JSOp(*REGS.pc) == JSOP_STRICTDELELEM) {
|
||||
if (!result && JSOp(*REGS.pc) == JSOp::StrictDelElem) {
|
||||
result.reportError(cx, obj, id);
|
||||
goto error;
|
||||
}
|
||||
|
@ -2824,7 +2824,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
ReservedRooted<Value> rval(&rootValue1, REGS.sp[-1]);
|
||||
ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS.pc));
|
||||
|
||||
bool strict = JSOp(*REGS.pc) == JSOP_STRICTSETPROP_SUPER;
|
||||
bool strict = JSOp(*REGS.pc) == JSOp::StrictSetPropSuper;
|
||||
|
||||
if (!SetPropertySuper(cx, obj, receiver, name, rval, strict)) {
|
||||
goto error;
|
||||
|
@ -2892,7 +2892,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)) {
|
||||
JSOp(*REGS.pc) == JSOp::StrictSetElem)) {
|
||||
goto error;
|
||||
}
|
||||
REGS.sp[-3] = value;
|
||||
|
@ -2911,7 +2911,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
ReservedRooted<JSObject*> obj(&rootObject1, ®S.sp[-2].toObject());
|
||||
HandleValue value = REGS.stackHandleAt(-1);
|
||||
|
||||
bool strict = JSOp(*REGS.pc) == JSOP_STRICTSETELEM_SUPER;
|
||||
bool strict = JSOp(*REGS.pc) == JSOp::StrictSetElemSuper;
|
||||
if (!SetObjectElementWithReceiver(cx, obj, index, value, receiver,
|
||||
strict)) {
|
||||
goto error;
|
||||
|
@ -2955,8 +2955,8 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
CASE(StrictSpreadEval) {
|
||||
static_assert(JSOpLength_SpreadEval == JSOpLength_StrictSpreadEval,
|
||||
"spreadeval and strictspreadeval must be the same size");
|
||||
bool construct = JSOp(*REGS.pc) == JSOP_SPREADNEW ||
|
||||
JSOp(*REGS.pc) == JSOP_SPREADSUPERCALL;
|
||||
bool construct = JSOp(*REGS.pc) == JSOp::SpreadNew ||
|
||||
JSOp(*REGS.pc) == JSOp::SpreadSuperCall;
|
||||
;
|
||||
|
||||
MOZ_ASSERT(REGS.stackDepth() >= 3u + construct);
|
||||
|
@ -3014,8 +3014,8 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
}
|
||||
|
||||
MaybeConstruct construct = MaybeConstruct(
|
||||
JSOp(*REGS.pc) == JSOP_NEW || JSOp(*REGS.pc) == JSOP_SUPERCALL);
|
||||
bool ignoresReturnValue = JSOp(*REGS.pc) == JSOP_CALL_IGNORES_RV;
|
||||
JSOp(*REGS.pc) == JSOp::New || JSOp(*REGS.pc) == JSOp::SuperCall);
|
||||
bool ignoresReturnValue = JSOp(*REGS.pc) == JSOp::CallIgnoresRv;
|
||||
unsigned argStackSlots = GET_ARGC(REGS.pc) + construct;
|
||||
|
||||
MOZ_ASSERT(REGS.stackDepth() >= 2u + GET_ARGC(REGS.pc));
|
||||
|
@ -3037,7 +3037,8 @@ 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 (JSOp(*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;
|
||||
|
@ -3157,7 +3158,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
CASE(ImplicitThis)
|
||||
CASE(GImplicitThis) {
|
||||
JSOp op = JSOp(*REGS.pc);
|
||||
if (op == JSOP_IMPLICITTHIS || script->hasNonSyntacticScope()) {
|
||||
if (op == JSOp::ImplicitThis || script->hasNonSyntacticScope()) {
|
||||
ReservedRooted<PropertyName*> name(&rootName0,
|
||||
script->getName(REGS.pc));
|
||||
ReservedRooted<JSObject*> envObj(&rootObject0,
|
||||
|
@ -3368,8 +3369,8 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
PropertyName* name = EnvironmentCoordinateNameSlow(script, REGS.pc);
|
||||
MOZ_ASSERT(name == cx->names().dotThis);
|
||||
JSOp next = JSOp(*GetNextPc(REGS.pc));
|
||||
MOZ_ASSERT(next == JSOP_CHECKTHIS || next == JSOP_CHECKRETURN ||
|
||||
next == JSOP_CHECKTHISREINIT);
|
||||
MOZ_ASSERT(next == JSOp::CheckThis || next == JSOp::CheckReturn ||
|
||||
next == JSOp::CheckThisReinit);
|
||||
}
|
||||
#endif
|
||||
PUSH_COPY(val);
|
||||
|
@ -3471,8 +3472,8 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
|||
if (IsUninitializedLexical(REGS.sp[-1])) {
|
||||
MOZ_ASSERT(script->isDerivedClassConstructor());
|
||||
JSOp next = JSOp(*GetNextPc(REGS.pc));
|
||||
MOZ_ASSERT(next == JSOP_CHECKTHIS || next == JSOP_CHECKRETURN ||
|
||||
next == JSOP_CHECKTHISREINIT);
|
||||
MOZ_ASSERT(next == JSOp::CheckThis || next == JSOp::CheckReturn ||
|
||||
next == JSOp::CheckThisReinit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3482,7 +3483,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[JSOpLength_GetLocal]) != JSOP_POP) {
|
||||
if (JSOp(REGS.pc[JSOpLength_GetLocal]) != JSOp::Pop) {
|
||||
cx->debugOnlyCheck(REGS.sp[-1]);
|
||||
}
|
||||
}
|
||||
|
@ -4504,7 +4505,7 @@ JSObject* js::BindVarOperation(JSContext* cx, JSObject* envChain) {
|
|||
|
||||
bool js::DefVarOperation(JSContext* cx, HandleObject envChain,
|
||||
HandleScript script, jsbytecode* pc) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_DEFVAR);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::DefVar);
|
||||
|
||||
RootedObject varobj(cx, &GetVariablesObject(envChain));
|
||||
MOZ_ASSERT(varobj->isQualifiedVarObj());
|
||||
|
@ -4551,10 +4552,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(JSOp(*pc) == JSOp::DefLet || JSOp(*pc) == JSOp::DefConst);
|
||||
|
||||
unsigned attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT;
|
||||
if (JSOp(*pc) == JSOP_DEFCONST) {
|
||||
if (JSOp(*pc) == JSOp::DefConst) {
|
||||
attrs |= JSPROP_READONLY;
|
||||
}
|
||||
|
||||
|
@ -4674,7 +4675,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(JSOp(*pc) == JSOp::Object);
|
||||
|
||||
RootedObject obj(cx, script->getObject(pc));
|
||||
if (cx->realm()->creationOptions().cloneSingletons()) {
|
||||
|
@ -4692,7 +4693,7 @@ JSObject* js::ImportMetaOperation(JSContext* cx, HandleScript script) {
|
|||
}
|
||||
|
||||
JSObject* js::BuiltinProtoOperation(JSContext* cx, jsbytecode* pc) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_BUILTINPROTO);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::BuiltinProto);
|
||||
MOZ_ASSERT(GET_UINT8(pc) < JSProto_LIMIT);
|
||||
|
||||
JSProtoKey key = static_cast<JSProtoKey>(GET_UINT8(pc));
|
||||
|
@ -4912,13 +4913,13 @@ bool js::ImplicitThisOperation(JSContext* cx, HandleObject scopeObj,
|
|||
|
||||
unsigned js::GetInitDataPropAttrs(JSOp op) {
|
||||
switch (op) {
|
||||
case JSOP_INITPROP:
|
||||
case JSOP_INITELEM:
|
||||
case JSOp::InitProp:
|
||||
case JSOp::InitElem:
|
||||
return JSPROP_ENUMERATE;
|
||||
case JSOP_INITLOCKEDPROP:
|
||||
case JSOp::InitLockedProp:
|
||||
return JSPROP_PERMANENT | JSPROP_READONLY;
|
||||
case JSOP_INITHIDDENPROP:
|
||||
case JSOP_INITHIDDENELEM:
|
||||
case JSOp::InitHiddenProp:
|
||||
case JSOp::InitHiddenElem:
|
||||
// Non-enumerable, but writable and configurable
|
||||
return 0;
|
||||
default:;
|
||||
|
@ -4938,15 +4939,15 @@ static bool InitGetterSetterOperation(JSContext* cx, jsbytecode* pc,
|
|||
attrs |= JSPROP_ENUMERATE;
|
||||
}
|
||||
|
||||
if (op == JSOP_INITPROP_GETTER || op == JSOP_INITELEM_GETTER ||
|
||||
op == JSOP_INITHIDDENPROP_GETTER || op == JSOP_INITHIDDENELEM_GETTER) {
|
||||
if (op == JSOp::InitPropGetter || op == JSOp::InitElemGetter ||
|
||||
op == JSOp::InitHiddenPropGetter || op == JSOp::InitHiddenElemGetter) {
|
||||
attrs |= JSPROP_GETTER;
|
||||
return DefineAccessorProperty(cx, obj, id, val, nullptr, attrs);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(op == JSOP_INITPROP_SETTER || op == JSOP_INITELEM_SETTER ||
|
||||
op == JSOP_INITHIDDENPROP_SETTER ||
|
||||
op == JSOP_INITHIDDENELEM_SETTER);
|
||||
MOZ_ASSERT(op == JSOp::InitPropSetter || op == JSOp::InitElemSetter ||
|
||||
op == JSOp::InitHiddenPropSetter ||
|
||||
op == JSOp::InitHiddenElemSetter);
|
||||
attrs |= JSPROP_SETTER;
|
||||
return DefineAccessorProperty(cx, obj, id, nullptr, val, attrs);
|
||||
}
|
||||
|
@ -4977,7 +4978,7 @@ bool js::SpreadCallOperation(JSContext* cx, HandleScript script, jsbytecode* pc,
|
|||
RootedArrayObject aobj(cx, &arr.toObject().as<ArrayObject>());
|
||||
uint32_t length = aobj->length();
|
||||
JSOp op = JSOp(*pc);
|
||||
bool constructing = op == JSOP_SPREADNEW || op == JSOP_SPREADSUPERCALL;
|
||||
bool constructing = op == JSOp::SpreadNew || op == JSOp::SpreadSuperCall;
|
||||
|
||||
// {Construct,Invoke}Args::init does this too, but this gives us a better
|
||||
// error message.
|
||||
|
@ -5041,14 +5042,14 @@ bool js::SpreadCallOperation(JSContext* cx, HandleScript script, jsbytecode* pc,
|
|||
return false;
|
||||
}
|
||||
|
||||
if ((op == JSOP_SPREADEVAL || op == JSOP_STRICTSPREADEVAL) &&
|
||||
if ((op == JSOp::SpreadEval || op == JSOp::StrictSpreadEval) &&
|
||||
cx->global()->valueIsEval(callee)) {
|
||||
if (!DirectEval(cx, args.get(0), res)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
MOZ_ASSERT(op == JSOP_SPREADCALL || op == JSOP_SPREADEVAL ||
|
||||
op == JSOP_STRICTSPREADEVAL,
|
||||
MOZ_ASSERT(op == JSOp::SpreadCall || op == JSOp::SpreadEval ||
|
||||
op == JSOp::StrictSpreadEval,
|
||||
"bad spread opcode");
|
||||
|
||||
if (!Call(cx, callee, thisv, args, res)) {
|
||||
|
@ -5094,8 +5095,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);
|
||||
(JSOp(*pc) == JSOp::NewObject || JSOp(*pc) == JSOp::NewObjectWithGroup);
|
||||
bool withTemplateGroup = (JSOp(*pc) == JSOp::NewObjectWithGroup);
|
||||
|
||||
RootedObjectGroup group(cx);
|
||||
RootedPlainObject baseObject(cx);
|
||||
|
@ -5142,7 +5143,7 @@ JSObject* js::NewObjectOperation(JSContext* cx, HandleScript script,
|
|||
if (withTemplate) {
|
||||
obj = CopyInitializerObject(cx, baseObject, newKind);
|
||||
} else {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_NEWINIT);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::NewInit);
|
||||
obj = NewBuiltinClassInstance<PlainObject>(cx, newKind);
|
||||
}
|
||||
|
||||
|
@ -5206,7 +5207,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(JSOp(*pc) == JSOp::NewArray);
|
||||
MOZ_ASSERT(newKind != SingletonObject);
|
||||
|
||||
RootedObjectGroup group(cx);
|
||||
|
@ -5264,7 +5265,7 @@ JSObject* js::NewArrayOperationWithTemplate(JSContext* cx,
|
|||
ArrayObject* js::NewArrayCopyOnWriteOperation(JSContext* cx,
|
||||
HandleScript script,
|
||||
jsbytecode* pc) {
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_NEWARRAY_COPYONWRITE);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::NewArrayCopyOnWrite);
|
||||
|
||||
RootedArrayObject baseobj(
|
||||
cx, ObjectGroup::getOrFixupCopyOnWriteObject(cx, script, pc));
|
||||
|
@ -5295,13 +5296,13 @@ void js::ReportRuntimeLexicalError(JSContext* cx, unsigned errorNumber,
|
|||
void js::ReportRuntimeLexicalError(JSContext* cx, unsigned errorNumber,
|
||||
HandleScript script, jsbytecode* pc) {
|
||||
JSOp op = JSOp(*pc);
|
||||
MOZ_ASSERT(op == JSOP_CHECKLEXICAL || op == JSOP_CHECKALIASEDLEXICAL ||
|
||||
op == JSOP_THROWSETCONST || op == JSOP_THROWSETALIASEDCONST ||
|
||||
op == JSOP_THROWSETCALLEE || op == JSOP_GETIMPORT);
|
||||
MOZ_ASSERT(op == JSOp::CheckLexical || op == JSOp::CheckAliasedLexical ||
|
||||
op == JSOp::ThrowSetConst || op == JSOp::ThrowSetAliasedConst ||
|
||||
op == JSOp::ThrowSetCallee || op == JSOp::GetImport);
|
||||
|
||||
RootedPropertyName name(cx);
|
||||
|
||||
if (op == JSOP_THROWSETCALLEE) {
|
||||
if (op == JSOp::ThrowSetCallee) {
|
||||
name = script->function()->explicitName()->asPropertyName();
|
||||
} else if (IsLocalOp(op)) {
|
||||
name = FrameSlotName(script, pc)->asPropertyName();
|
||||
|
|
|
@ -4591,11 +4591,11 @@ void JSScript::assertValidJumpTargets() const {
|
|||
|
||||
// All backward jumps must be to a JSOp::LoopHead op. This is an invariant
|
||||
// we want to maintain to simplify JIT compilation and bytecode analysis.
|
||||
MOZ_ASSERT_IF(target < loc, target.is(JSOP_LOOPHEAD));
|
||||
MOZ_ASSERT_IF(target < loc, target.is(JSOp::LoopHead));
|
||||
MOZ_ASSERT_IF(target < loc, IsBackedgePC(loc.toRawBytecode()));
|
||||
|
||||
// All forward jumps must be to a JSOp::JumpTarget op.
|
||||
MOZ_ASSERT_IF(target > loc, target.is(JSOP_JUMPTARGET));
|
||||
MOZ_ASSERT_IF(target > loc, target.is(JSOp::JumpTarget));
|
||||
|
||||
// Jumps must not cross scope boundaries.
|
||||
MOZ_ASSERT(loc.innermostScope(this) == target.innermostScope(this));
|
||||
|
@ -4609,12 +4609,12 @@ void JSScript::assertValidJumpTargets() const {
|
|||
}
|
||||
|
||||
// Check table switch case labels.
|
||||
if (loc.is(JSOP_TABLESWITCH)) {
|
||||
if (loc.is(JSOp::TableSwitch)) {
|
||||
BytecodeLocation target = loc.getJumpTarget();
|
||||
|
||||
// Default target.
|
||||
MOZ_ASSERT(mainLoc <= target && target < endLoc);
|
||||
MOZ_ASSERT(target.is(JSOP_JUMPTARGET));
|
||||
MOZ_ASSERT(target.is(JSOp::JumpTarget));
|
||||
|
||||
int32_t low = loc.getTableSwitchLow();
|
||||
int32_t high = loc.getTableSwitchHigh();
|
||||
|
@ -4623,7 +4623,7 @@ void JSScript::assertValidJumpTargets() const {
|
|||
BytecodeLocation switchCase(this,
|
||||
tableSwitchCasePC(loc.toRawBytecode(), i));
|
||||
MOZ_ASSERT(mainLoc <= switchCase && switchCase < endLoc);
|
||||
MOZ_ASSERT(switchCase.is(JSOP_JUMPTARGET));
|
||||
MOZ_ASSERT(switchCase.is(JSOp::JumpTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4636,7 +4636,7 @@ void JSScript::assertValidJumpTargets() const {
|
|||
|
||||
jsbytecode* tryStart = offsetToPC(tn.start);
|
||||
jsbytecode* tryPc = tryStart - JSOpLength_Try;
|
||||
MOZ_ASSERT(JSOp(*tryPc) == JSOP_TRY);
|
||||
MOZ_ASSERT(JSOp(*tryPc) == JSOp::Try);
|
||||
|
||||
jsbytecode* tryTarget = tryStart + tn.length;
|
||||
MOZ_ASSERT(main() <= tryTarget && tryTarget < codeEnd());
|
||||
|
@ -4846,15 +4846,15 @@ void js::DescribeScriptedCallerForDirectEval(JSContext* cx, HandleScript script,
|
|||
static_assert(JSOpLength_Eval == JSOpLength_StrictEval,
|
||||
"next op after a direct eval must be at consistent offset");
|
||||
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_EVAL || JSOp(*pc) == JSOP_STRICTEVAL ||
|
||||
JSOp(*pc) == JSOP_SPREADEVAL ||
|
||||
JSOp(*pc) == JSOP_STRICTSPREADEVAL);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::Eval || JSOp(*pc) == JSOp::StrictEval ||
|
||||
JSOp(*pc) == JSOp::SpreadEval ||
|
||||
JSOp(*pc) == JSOp::StrictSpreadEval);
|
||||
|
||||
bool isSpread =
|
||||
(JSOp(*pc) == JSOP_SPREADEVAL || JSOp(*pc) == JSOP_STRICTSPREADEVAL);
|
||||
(JSOp(*pc) == JSOp::SpreadEval || JSOp(*pc) == JSOp::StrictSpreadEval);
|
||||
jsbytecode* nextpc =
|
||||
pc + (isSpread ? JSOpLength_SpreadEval : JSOpLength_Eval);
|
||||
MOZ_ASSERT(JSOp(*nextpc) == JSOP_LINENO);
|
||||
MOZ_ASSERT(JSOp(*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 (JSOp(*pc) != JSOp::Arguments) {
|
||||
pc += GetBytecodeLength(pc);
|
||||
}
|
||||
pc += JSOpLength_Arguments;
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_SETALIASEDVAR);
|
||||
MOZ_ASSERT(JSOp(*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
|
||||
|
|
|
@ -2703,7 +2703,7 @@ class JSScript : public js::BaseScript {
|
|||
bool hasForceInterpreterOp() const {
|
||||
// JSOp::ForceInterpreter, if present, must be the first op.
|
||||
MOZ_ASSERT(length() >= 1);
|
||||
return JSOp(*code()) == JSOP_FORCEINTERPRETER;
|
||||
return JSOp(*code()) == JSOp::ForceInterpreter;
|
||||
}
|
||||
|
||||
js::AllBytecodesIterable allLocations() {
|
||||
|
@ -2727,7 +2727,7 @@ class JSScript : public js::BaseScript {
|
|||
|
||||
jsbytecode* lastPC() const {
|
||||
jsbytecode* pc = codeEnd() - js::JSOpLength_RetRval;
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_RETRVAL);
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOp::RetRval);
|
||||
return pc;
|
||||
}
|
||||
|
||||
|
@ -3102,7 +3102,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(JSOp(*pc) == JSOp::TableSwitch);
|
||||
uint32_t firstResumeIndex = GET_RESUMEINDEX(pc + 3 * JUMP_OFFSET_LEN);
|
||||
return resumeOffsets()[firstResumeIndex + caseIndex];
|
||||
}
|
||||
|
@ -3209,10 +3209,10 @@ class JSScript : public js::BaseScript {
|
|||
}
|
||||
|
||||
jsbytecode* pc = code();
|
||||
if (noScriptRval() && JSOp(*pc) == JSOP_FALSE) {
|
||||
if (noScriptRval() && JSOp(*pc) == JSOp::False) {
|
||||
++pc;
|
||||
}
|
||||
return JSOp(*pc) == JSOP_RETRVAL;
|
||||
return JSOp(*pc) == JSOp::RetRval;
|
||||
}
|
||||
|
||||
bool formalIsAliased(unsigned argSlot);
|
||||
|
|
|
@ -2316,9 +2316,9 @@ static MOZ_ALWAYS_INLINE bool GetExistingProperty(
|
|||
JSScript* script = cx->currentScript(&pc);
|
||||
if (script && script->hasJitScript()) {
|
||||
switch (JSOp(*pc)) {
|
||||
case JSOP_GETPROP:
|
||||
case JSOP_CALLPROP:
|
||||
case JSOP_LENGTH:
|
||||
case JSOp::GetProp:
|
||||
case JSOp::CallProp:
|
||||
case JSOp::Length:
|
||||
script->jitScript()->noteAccessedGetter(script->pcToOffset(pc));
|
||||
break;
|
||||
default:
|
||||
|
@ -2365,7 +2365,7 @@ static bool Detecting(JSContext* cx, JSScript* script, jsbytecode* pc) {
|
|||
BytecodeIterator endIter = BytecodeIterator(script->endLocation());
|
||||
|
||||
// Skip over jump targets and duplication operations.
|
||||
while (scriptIterator->isJumpTarget() || scriptIterator->is(JSOP_DUP)) {
|
||||
while (scriptIterator->isJumpTarget() || scriptIterator->is(JSOp::Dup)) {
|
||||
if (++scriptIterator == endIter) {
|
||||
// If we are at the end of the script, we cannot be detecting
|
||||
// the property.
|
||||
|
@ -2380,7 +2380,7 @@ static bool Detecting(JSContext* cx, JSScript* script, jsbytecode* pc) {
|
|||
}
|
||||
|
||||
// Special case: Do not warn if we are checking whether the property is null.
|
||||
if (scriptIterator->is(JSOP_NULL)) {
|
||||
if (scriptIterator->is(JSOp::Null)) {
|
||||
if (++scriptIterator == endIter) {
|
||||
return false;
|
||||
}
|
||||
|
@ -2390,8 +2390,8 @@ static bool Detecting(JSContext* cx, JSScript* script, jsbytecode* pc) {
|
|||
|
||||
// Special case #2: Do not warn if we are checking whether the property is
|
||||
// undefined.
|
||||
if (scriptIterator->is(JSOP_GETGNAME) || scriptIterator->is(JSOP_GETNAME) ||
|
||||
scriptIterator->is(JSOP_UNDEFINED)) {
|
||||
if (scriptIterator->is(JSOp::GetGName) || scriptIterator->is(JSOp::GetName) ||
|
||||
scriptIterator->is(JSOp::Undefined)) {
|
||||
// If we using the result of a variable lookup to use in the comparison
|
||||
// against the property and that lookup does not result in 'undefined',
|
||||
// the type of subsequent operations do not matter -- we always warn.
|
||||
|
@ -2453,7 +2453,7 @@ static bool GetNonexistentProperty(JSContext* cx, HandleId id,
|
|||
return true;
|
||||
}
|
||||
|
||||
if (JSOp(*pc) != JSOP_GETPROP && JSOp(*pc) != JSOP_GETELEM) {
|
||||
if (JSOp(*pc) != JSOp::GetProp && JSOp(*pc) != JSOp::GetElem) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -206,11 +206,11 @@ bool ObjectGroup::useSingletonForNewObject(JSContext* cx, JSScript* script,
|
|||
if (script->isGenerator() || script->isAsync()) {
|
||||
return false;
|
||||
}
|
||||
if (JSOp(*pc) != JSOP_NEW) {
|
||||
if (JSOp(*pc) != JSOp::New) {
|
||||
return false;
|
||||
}
|
||||
pc += JSOpLength_New;
|
||||
if (JSOp(*pc) != JSOP_SETPROP) {
|
||||
if (JSOp(*pc) != JSOp::SetProp) {
|
||||
return false;
|
||||
}
|
||||
return script->getName(pc) == cx->names().prototype;
|
||||
|
@ -1454,7 +1454,7 @@ ObjectGroup* ObjectGroup::allocationSiteGroup(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (JSOp(*pc) == JSOP_NEWOBJECT) {
|
||||
if (JSOp(*pc) == JSOp::NewObject) {
|
||||
// Keep track of the preliminary objects with this group, so we can try
|
||||
// to use an unboxed layout for the object once some are allocated.
|
||||
Shape* shape = script->getObject(pc)->as<PlainObject>().lastProperty();
|
||||
|
|
|
@ -2691,7 +2691,7 @@ static bool VerifyGlobalNames(JSContext* cx, Handle<GlobalObject*> shg) {
|
|||
for (BytecodeLocation loc : AllBytecodesIterable(script)) {
|
||||
JSOp op = loc.getOp();
|
||||
|
||||
if (op == JSOP_GETINTRINSIC) {
|
||||
if (op == JSOp::GetIntrinsic) {
|
||||
PropertyName* name = loc.getPropertyName(script);
|
||||
id = NameToId(name);
|
||||
|
||||
|
|
|
@ -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(JSOp(*GetNextPc(pc)) == JSOp::CheckThis ||
|
||||
JSOp(*GetNextPc(pc)) == JSOp::CheckThisReinit ||
|
||||
JSOp(*GetNextPc(pc)) == JSOp::CheckReturn);
|
||||
|
||||
MonitorBytecodeType(cx, script, pc, TypeSet::UnknownType());
|
||||
}
|
||||
|
|
|
@ -3668,7 +3668,7 @@ static bool EmitRefIsNull(FunctionCompiler& f) {
|
|||
return false;
|
||||
}
|
||||
f.iter().setResult(
|
||||
f.compare(input, nullVal, JSOP_EQ, MCompare::Compare_RefOrNull));
|
||||
f.compare(input, nullVal, JSOp::Eq, MCompare::Compare_RefOrNull));
|
||||
return true;
|
||||
}
|
||||
#endif // ENABLE_WASM_REFTYPES
|
||||
|
@ -3826,102 +3826,102 @@ static bool EmitBodyExprs(FunctionCompiler& f) {
|
|||
CHECK(EmitConversion<MNot>(f, ValType::I32, ValType::I32));
|
||||
case uint16_t(Op::I32Eq):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_EQ, MCompare::Compare_Int32));
|
||||
EmitComparison(f, ValType::I32, JSOp::Eq, MCompare::Compare_Int32));
|
||||
case uint16_t(Op::I32Ne):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_NE, MCompare::Compare_Int32));
|
||||
EmitComparison(f, ValType::I32, JSOp::Ne, MCompare::Compare_Int32));
|
||||
case uint16_t(Op::I32LtS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_LT, MCompare::Compare_Int32));
|
||||
EmitComparison(f, ValType::I32, JSOp::Lt, MCompare::Compare_Int32));
|
||||
case uint16_t(Op::I32LtU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_LT, MCompare::Compare_UInt32));
|
||||
CHECK(EmitComparison(f, ValType::I32, JSOp::Lt,
|
||||
MCompare::Compare_UInt32));
|
||||
case uint16_t(Op::I32GtS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_GT, MCompare::Compare_Int32));
|
||||
EmitComparison(f, ValType::I32, JSOp::Gt, MCompare::Compare_Int32));
|
||||
case uint16_t(Op::I32GtU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_GT, MCompare::Compare_UInt32));
|
||||
CHECK(EmitComparison(f, ValType::I32, JSOp::Gt,
|
||||
MCompare::Compare_UInt32));
|
||||
case uint16_t(Op::I32LeS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_LE, MCompare::Compare_Int32));
|
||||
EmitComparison(f, ValType::I32, JSOp::Le, MCompare::Compare_Int32));
|
||||
case uint16_t(Op::I32LeU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_LE, MCompare::Compare_UInt32));
|
||||
CHECK(EmitComparison(f, ValType::I32, JSOp::Le,
|
||||
MCompare::Compare_UInt32));
|
||||
case uint16_t(Op::I32GeS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_GE, MCompare::Compare_Int32));
|
||||
EmitComparison(f, ValType::I32, JSOp::Ge, MCompare::Compare_Int32));
|
||||
case uint16_t(Op::I32GeU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I32, JSOP_GE, MCompare::Compare_UInt32));
|
||||
CHECK(EmitComparison(f, ValType::I32, JSOp::Ge,
|
||||
MCompare::Compare_UInt32));
|
||||
case uint16_t(Op::I64Eqz):
|
||||
CHECK(EmitConversion<MNot>(f, ValType::I64, ValType::I32));
|
||||
case uint16_t(Op::I64Eq):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_EQ, MCompare::Compare_Int64));
|
||||
EmitComparison(f, ValType::I64, JSOp::Eq, MCompare::Compare_Int64));
|
||||
case uint16_t(Op::I64Ne):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_NE, MCompare::Compare_Int64));
|
||||
EmitComparison(f, ValType::I64, JSOp::Ne, MCompare::Compare_Int64));
|
||||
case uint16_t(Op::I64LtS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_LT, MCompare::Compare_Int64));
|
||||
EmitComparison(f, ValType::I64, JSOp::Lt, MCompare::Compare_Int64));
|
||||
case uint16_t(Op::I64LtU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_LT, MCompare::Compare_UInt64));
|
||||
CHECK(EmitComparison(f, ValType::I64, JSOp::Lt,
|
||||
MCompare::Compare_UInt64));
|
||||
case uint16_t(Op::I64GtS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_GT, MCompare::Compare_Int64));
|
||||
EmitComparison(f, ValType::I64, JSOp::Gt, MCompare::Compare_Int64));
|
||||
case uint16_t(Op::I64GtU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_GT, MCompare::Compare_UInt64));
|
||||
CHECK(EmitComparison(f, ValType::I64, JSOp::Gt,
|
||||
MCompare::Compare_UInt64));
|
||||
case uint16_t(Op::I64LeS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_LE, MCompare::Compare_Int64));
|
||||
EmitComparison(f, ValType::I64, JSOp::Le, MCompare::Compare_Int64));
|
||||
case uint16_t(Op::I64LeU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_LE, MCompare::Compare_UInt64));
|
||||
CHECK(EmitComparison(f, ValType::I64, JSOp::Le,
|
||||
MCompare::Compare_UInt64));
|
||||
case uint16_t(Op::I64GeS):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_GE, MCompare::Compare_Int64));
|
||||
EmitComparison(f, ValType::I64, JSOp::Ge, MCompare::Compare_Int64));
|
||||
case uint16_t(Op::I64GeU):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::I64, JSOP_GE, MCompare::Compare_UInt64));
|
||||
CHECK(EmitComparison(f, ValType::I64, JSOp::Ge,
|
||||
MCompare::Compare_UInt64));
|
||||
case uint16_t(Op::F32Eq):
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOP_EQ,
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOp::Eq,
|
||||
MCompare::Compare_Float32));
|
||||
case uint16_t(Op::F32Ne):
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOP_NE,
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOp::Ne,
|
||||
MCompare::Compare_Float32));
|
||||
case uint16_t(Op::F32Lt):
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOP_LT,
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOp::Lt,
|
||||
MCompare::Compare_Float32));
|
||||
case uint16_t(Op::F32Gt):
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOP_GT,
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOp::Gt,
|
||||
MCompare::Compare_Float32));
|
||||
case uint16_t(Op::F32Le):
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOP_LE,
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOp::Le,
|
||||
MCompare::Compare_Float32));
|
||||
case uint16_t(Op::F32Ge):
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOP_GE,
|
||||
CHECK(EmitComparison(f, ValType::F32, JSOp::Ge,
|
||||
MCompare::Compare_Float32));
|
||||
case uint16_t(Op::F64Eq):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::F64, JSOP_EQ, MCompare::Compare_Double));
|
||||
CHECK(EmitComparison(f, ValType::F64, JSOp::Eq,
|
||||
MCompare::Compare_Double));
|
||||
case uint16_t(Op::F64Ne):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::F64, JSOP_NE, MCompare::Compare_Double));
|
||||
CHECK(EmitComparison(f, ValType::F64, JSOp::Ne,
|
||||
MCompare::Compare_Double));
|
||||
case uint16_t(Op::F64Lt):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::F64, JSOP_LT, MCompare::Compare_Double));
|
||||
CHECK(EmitComparison(f, ValType::F64, JSOp::Lt,
|
||||
MCompare::Compare_Double));
|
||||
case uint16_t(Op::F64Gt):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::F64, JSOP_GT, MCompare::Compare_Double));
|
||||
CHECK(EmitComparison(f, ValType::F64, JSOp::Gt,
|
||||
MCompare::Compare_Double));
|
||||
case uint16_t(Op::F64Le):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::F64, JSOP_LE, MCompare::Compare_Double));
|
||||
CHECK(EmitComparison(f, ValType::F64, JSOp::Le,
|
||||
MCompare::Compare_Double));
|
||||
case uint16_t(Op::F64Ge):
|
||||
CHECK(
|
||||
EmitComparison(f, ValType::F64, JSOP_GE, MCompare::Compare_Double));
|
||||
CHECK(EmitComparison(f, ValType::F64, JSOp::Ge,
|
||||
MCompare::Compare_Double));
|
||||
|
||||
// Numeric operators
|
||||
case uint16_t(Op::I32Clz):
|
||||
|
@ -4113,7 +4113,7 @@ static bool EmitBodyExprs(FunctionCompiler& f) {
|
|||
if (!f.env().gcTypesEnabled()) {
|
||||
return f.iter().unrecognizedOpcode(&op);
|
||||
}
|
||||
CHECK(EmitComparison(f, RefType::any(), JSOP_EQ,
|
||||
CHECK(EmitComparison(f, RefType::any(), JSOp::Eq,
|
||||
MCompare::Compare_RefOrNull));
|
||||
#endif
|
||||
#ifdef ENABLE_WASM_REFTYPES
|
||||
|
|
Загрузка…
Ссылка в новой задаче