mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
Issue #2173 - Remove unused case/code from function node ops
CodeNodes only ever use 3 JSOPs at this point in time. Based-on: 1518391/1
This commit is contained in:
parent
661b1c534c
commit
f21340f1a8
2 changed files with 5 additions and 13 deletions
|
|
@ -5755,15 +5755,11 @@ BytecodeEmitter::emitFunction(CodeNode* funNode, bool needsProto)
|
||||||
|
|
||||||
if (needsProto) {
|
if (needsProto) {
|
||||||
MOZ_ASSERT(funNode->getOp() == JSOP_LAMBDA);
|
MOZ_ASSERT(funNode->getOp() == JSOP_LAMBDA);
|
||||||
funNode->setOp(JSOP_FUNWITHPROTO);
|
return emitIndex32(JSOP_FUNWITHPROTO, index);
|
||||||
}
|
|
||||||
|
|
||||||
if (funNode->getOp() == JSOP_DEFFUN) {
|
|
||||||
if (!emitIndex32(JSOP_LAMBDA, index))
|
|
||||||
return false;
|
|
||||||
return emit1(JSOP_DEFFUN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is a FunctionExpression, ArrowFunctionExpression, or class
|
||||||
|
// constructor. Emit the single instruction (without location info).
|
||||||
return emitIndex32(funNode->getOp(), index);
|
return emitIndex32(funNode->getOp(), index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1468,12 +1468,8 @@ class CodeNode : public ParseNode
|
||||||
MOZ_ASSERT(isKind(PNK_FUNCTION));
|
MOZ_ASSERT(isKind(PNK_FUNCTION));
|
||||||
MOZ_ASSERT(isOp(JSOP_LAMBDA) || // lambda
|
MOZ_ASSERT(isOp(JSOP_LAMBDA) || // lambda
|
||||||
isOp(JSOP_LAMBDA_ARROW) || // arrow function
|
isOp(JSOP_LAMBDA_ARROW) || // arrow function
|
||||||
isOp(JSOP_DEFFUN) || // non-body-level function statement
|
isOp(JSOP_NOP)); // body-level function stmt in global code
|
||||||
isOp(JSOP_NOP) || // body-level function stmt in global code
|
return isOp(JSOP_NOP);
|
||||||
isOp(JSOP_GETLOCAL) || // body-level function stmt in function code
|
|
||||||
isOp(JSOP_GETARG) || // body-level function redeclaring formal
|
|
||||||
isOp(JSOP_INITLEXICAL)); // block-level function stmt
|
|
||||||
return !isOp(JSOP_LAMBDA) && !isOp(JSOP_LAMBDA_ARROW) && !isOp(JSOP_DEFFUN);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue