Issue #2173 - Add accessors to NullaryNode and change LoopControlStatement arity to PN_LOOP

Based-on: m-c 1479659/6
This commit is contained in:
Martok 2023-04-01 01:08:40 +02:00 committed by roytam1
commit a49f4d0483
10 changed files with 166 additions and 68 deletions

View file

@ -1060,7 +1060,7 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer)
case PNK_RAW_UNDEFINED:
case PNK_ELISION:
case PNK_GENERATOR:
MOZ_ASSERT(pn->isArity(PN_NULLARY));
MOZ_ASSERT(pn->is<NullaryNode>());
*answer = false;
return true;
@ -1096,9 +1096,17 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer)
return true;
case PNK_BREAK:
MOZ_ASSERT(pn->is<BreakStatement>());
*answer = true;
return true;
case PNK_CONTINUE:
MOZ_ASSERT(pn->is<ContinueStatement>());
*answer = true;
return true;
case PNK_DEBUGGER:
MOZ_ASSERT(pn->isArity(PN_NULLARY));
MOZ_ASSERT(pn->is<DebuggerStatement>());
*answer = true;
return true;

View file

@ -101,8 +101,12 @@ ContainsHoistedDeclaration(ExclusiveContext* cx, ParseNode* node, bool* result)
// Statements with no sub-components at all.
case PNK_NOP: // induced by function f() {} function f() {}
MOZ_ASSERT(node->is<NullaryNode>());
*result = false;
return true;
case PNK_DEBUGGER:
MOZ_ASSERT(node->isArity(PN_NULLARY));
MOZ_ASSERT(node->is<DebuggerStatement>());
*result = false;
return true;
@ -1655,13 +1659,22 @@ Fold(ExclusiveContext* cx, ParseNode** pnp, Parser<FullParseHandler>& parser, bo
case PNK_NULL:
case PNK_RAW_UNDEFINED:
case PNK_ELISION:
case PNK_DEBUGGER:
case PNK_BREAK:
case PNK_CONTINUE:
case PNK_GENERATOR:
case PNK_EXPORT_BATCH_SPEC:
case PNK_POSHOLDER:
MOZ_ASSERT(pn->isArity(PN_NULLARY));
MOZ_ASSERT(pn->is<NullaryNode>());
return true;
case PNK_DEBUGGER:
MOZ_ASSERT(pn->is<DebuggerStatement>());
return true;
case PNK_BREAK:
MOZ_ASSERT(pn->is<BreakStatement>());
return true;
case PNK_CONTINUE:
MOZ_ASSERT(pn->is<ContinueStatement>());
return true;
case PNK_OBJECT_PROPERTY_NAME:

View file

@ -151,7 +151,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return new_<NumericLiteral>(value, decimalPoint, pos);
}
ParseNode* newBooleanLiteral(bool cond, const TokenPos& pos) {
BooleanLiteralType newBooleanLiteral(bool cond, const TokenPos& pos) {
return new_<BooleanLiteral>(cond, pos);
}
@ -195,11 +195,11 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return new_<ThisLiteral>(pos, thisName);
}
ParseNode* newNullLiteral(const TokenPos& pos) {
NullLiteralType newNullLiteral(const TokenPos& pos) {
return new_<NullLiteral>(pos);
}
ParseNode* newRawUndefinedLiteral(const TokenPos& pos) {
RawUndefinedLiteralType newRawUndefinedLiteral(const TokenPos& pos) {
return new_<RawUndefinedLiteral>(pos);
}
@ -251,7 +251,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return new_<UnaryNode>(kind, JSOP_NOP, pos, kid);
}
ParseNode* newNullary(ParseNodeKind kind, JSOp op, const TokenPos& pos) {
NullaryNodeType newNullary(ParseNodeKind kind, JSOp op, const TokenPos& pos) {
return new_<NullaryNode>(kind, op, pos);
}
@ -311,7 +311,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
}
MOZ_MUST_USE bool addElision(ListNodeType literal, const TokenPos& pos) {
ParseNode* elision = new_<NullaryNode>(PNK_ELISION, pos);
NullaryNode* elision = new_<NullaryNode>(PNK_ELISION, pos);
if (!elision)
return false;
literal->append(elision);
@ -377,10 +377,10 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
ClassNamesType newClassNames(ParseNode* outer, ParseNode* inner, const TokenPos& pos) {
return new_<ClassNames>(outer, inner, pos);
}
BinaryNodeType newNewTarget(ParseNode* newHolder, ParseNode* targetHolder) {
BinaryNodeType newNewTarget(NullaryNodeType newHolder, NullaryNodeType targetHolder) {
return new_<BinaryNode>(PNK_NEWTARGET, JSOP_NOP, newHolder, targetHolder);
}
ParseNode* newPosHolder(const TokenPos& pos) {
NullaryNodeType newPosHolder(const TokenPos& pos) {
return new_<NullaryNode>(PNK_POSHOLDER, pos);
}
UnaryNodeType newSuperBase(Node thisName, const TokenPos& pos) {
@ -536,7 +536,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
MOZ_ASSERT(stmtList->isKind(PNK_STATEMENTLIST));
TokenPos yieldPos(stmtList->pn_pos.begin, stmtList->pn_pos.begin + 1);
ParseNode* makeGen = new_<NullaryNode>(PNK_GENERATOR, yieldPos);
NullaryNode* makeGen = new_<NullaryNode>(PNK_GENERATOR, yieldPos);
if (!makeGen)
return false;
@ -560,7 +560,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return newBinary(PNK_SETTHIS, thisName, val);
}
ParseNode* newEmptyStatement(const TokenPos& pos) {
UnaryNodeType newEmptyStatement(const TokenPos& pos) {
return new_<UnaryNode>(PNK_SEMI, JSOP_NOP, pos, (ParseNode*) nullptr);
}
@ -657,11 +657,11 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return new_<CaseClause>(expr, body, begin);
}
ParseNode* newContinueStatement(PropertyName* label, const TokenPos& pos) {
ContinueStatementType newContinueStatement(PropertyName* label, const TokenPos& pos) {
return new_<ContinueStatement>(label, pos);
}
ParseNode* newBreakStatement(PropertyName* label, const TokenPos& pos) {
BreakStatementType newBreakStatement(PropertyName* label, const TokenPos& pos) {
return new_<BreakStatement>(label, pos);
}
@ -690,7 +690,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return new_<TernaryNode>(PNK_TRY, JSOP_NOP, body, catchList, finallyBlock, pos);
}
ParseNode* newDebuggerStatement(const TokenPos& pos) {
DebuggerStatementType newDebuggerStatement(const TokenPos& pos) {
return new_<DebuggerStatement>(pos);
}

View file

@ -388,12 +388,21 @@ class NameResolver
case PNK_RAW_UNDEFINED:
case PNK_ELISION:
case PNK_GENERATOR:
case PNK_BREAK:
case PNK_CONTINUE:
case PNK_DEBUGGER:
case PNK_EXPORT_BATCH_SPEC:
case PNK_POSHOLDER:
MOZ_ASSERT(cur->isArity(PN_NULLARY));
MOZ_ASSERT(cur->is<NullaryNode>());
break;
case PNK_DEBUGGER:
MOZ_ASSERT(cur->is<DebuggerStatement>());
break;
case PNK_BREAK:
MOZ_ASSERT(cur->is<BreakStatement>());
break;
case PNK_CONTINUE:
MOZ_ASSERT(cur->is<ContinueStatement>());
break;
case PNK_OBJECT_PROPERTY_NAME:
@ -801,7 +810,7 @@ class NameResolver
ListNode* list = &cur->as<ListNode>();
ParseNode* item = list->head();
if (!isImport && item && item->isKind(PNK_EXPORT_BATCH_SPEC)) {
MOZ_ASSERT(item->isArity(PN_NULLARY));
MOZ_ASSERT(item->is<NullaryNode>());
break;
}
for (ParseNode* item : list->contents()) {

View file

@ -183,14 +183,23 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
case PNK_RAW_UNDEFINED:
case PNK_ELISION:
case PNK_GENERATOR:
case PNK_BREAK:
case PNK_CONTINUE:
case PNK_DEBUGGER:
case PNK_EXPORT_BATCH_SPEC:
case PNK_POSHOLDER:
MOZ_ASSERT(pn->isArity(PN_NULLARY));
MOZ_ASSERT(pn->is<NullaryNode>());
return PushResult::Recyclable;
case PNK_DEBUGGER:
MOZ_ASSERT(pn->is<DebuggerStatement>());
return PushResult::Recyclable;
case PNK_BREAK:
MOZ_ASSERT(pn->is<BreakStatement>());
return PushResult::Recyclable;
case PNK_CONTINUE:
MOZ_ASSERT(pn->is<ContinueStatement>());
return PushResult::Recyclable;
case PNK_OBJECT_PROPERTY_NAME:
case PNK_STRING:
case PNK_TEMPLATE_STRING:
@ -662,7 +671,7 @@ ParseNode::dump(int indent)
{
switch (pn_arity) {
case PN_NULLARY:
((NullaryNode*) this)->dump();
as<NullaryNode>().dump();
return;
case PN_UNARY:
as<UnaryNode>().dump(indent);
@ -688,6 +697,9 @@ ParseNode::dump(int indent)
case PN_REGEXP:
as<RegExpLiteral>().dump(indent);
return;
case PN_LOOP:
as<LoopControlStatement>().dump(indent);
return;
case PN_SCOPE:
((LexicalScopeNode*) this)->dump(indent);
return;
@ -731,6 +743,18 @@ RegExpLiteral::dump(int indent)
fprintf(stderr, "(%s)", parseNodeNames[size_t(getKind())]);
}
void
LoopControlStatement::dump(int indent)
{
const char* name = parseNodeNames[size_t(getKind())];
fprintf(stderr, "(%s", name);
if (label()) {
fprintf(stderr, " ");
label()->dumpCharsNoNewline();
}
fprintf(stderr, ")");
}
void
UnaryNode::dump(int indent)
{

View file

@ -321,9 +321,9 @@ IsTypeofKind(ParseNodeKind kind)
* kid2: null or the catch guard expression
* kid3: catch block statements
* PNK_BREAK (BreakStatement)
* atom: label or null
* label: label or null
* PNK_CONTINUE (ContinueStatement)
* atom: label or null
* label: label or null
* PNK_WITH (BinaryNode)
* left: head expr
* right: body
@ -506,10 +506,12 @@ IsTypeofKind(ParseNodeKind kind)
* regexp: RegExp model object
* PNK_NUMBER (NumericLiteral)
* value: double value of numeric literal
* PNK_TRUE, nullary pn_op: JSOp bytecode
* PNK_FALSE,
* PNK_NULL,
* PNK_RAW_UNDEFINED
* PNK_TRUE, PNK_FALSE (BooleanLiteral)
* pn_op: JSOp bytecode
* PNK_NULL (NullLiteral)
* pn_op: JSOp bytecode
* PNK_RAW_UNDEFINED (RawUndefinedLiteral)
* pn_op: JSOp bytecode
*
* PNK_THIS (UnaryNode)
* kid: '.this' Name if function `this`, else nullptr
@ -524,7 +526,7 @@ IsTypeofKind(ParseNodeKind kind)
* right: SuperCall
* PNK_LEXICALSCOPE scope pn_u.scope.bindings: scope bindings
* pn_u.scope.body: scope body
* PNK_GENERATOR nullary
* PNK_GENERATOR (NullaryNode)
* PNK_INITIALYIELD (UnaryNode)
* kid: generator object
* PNK_YIELD, PNK_YIELD_STAR, PNK_AWAIT (UnaryNode)
@ -535,7 +537,7 @@ IsTypeofKind(ParseNodeKind kind)
* if-guarded PNK_ARRAYPUSH
* PNK_ARRAYPUSH unary pn_op: JSOP_ARRAYCOMP
* pn_kid: array comprehension expression
* PNK_NOP nullary
* PNK_NOP (NullaryNode)
*/
enum ParseNodeArity
{
@ -548,6 +550,7 @@ enum ParseNodeArity
PN_NAME, /* name, label, string */
PN_NUMBER, /* numeric literal */
PN_REGEXP, /* regexp literal */
PN_LOOP, /* loop control (break/continue) */
PN_SCOPE /* lexical scope */
};
@ -567,9 +570,19 @@ enum ParseNodeArity
macro(ListNode, ListNodeType, asList) \
macro(CallSiteNode, CallSiteNodeType, asCallSite) \
\
macro(LoopControlStatement, LoopControlStatementType, asLoopControlStatement) \
macro(BreakStatement, BreakStatementType, asBreakStatement) \
macro(ContinueStatement, ContinueStatementType, asContinueStatement) \
\
macro(NameNode, NameNodeType, asName) \
macro(LabeledStatement, LabeledStatementType, asLabeledStatement) \
\
macro(NullaryNode, NullaryNodeType, asNullary) \
macro(BooleanLiteral, BooleanLiteralType, asBooleanLiteral) \
macro(DebuggerStatement, DebuggerStatementType, asDebuggerStatement) \
macro(NullLiteral, NullLiteralType, asNullLiteral) \
macro(RawUndefinedLiteral, RawUndefinedLiteralType, asRawUndefinedLiteral) \
\
macro(NumericLiteral, NumericLiteralType, asNumericLiteral) \
\
macro(RegExpLiteral, RegExpLiteralType, asRegExpLiteral) \
@ -580,10 +593,6 @@ enum ParseNodeArity
macro(UnaryNode, UnaryNodeType, asUnary) \
macro(ThisLiteral, ThisLiteralType, asThisLiteral)
class LoopControlStatement;
class BreakStatement;
class ContinueStatement;
#define DECLARE_CLASS(typeName, longTypeName, asMethodName) \
class typeName;
FOR_EACH_PARSENODE_SUBCLASS(DECLARE_CLASS)
@ -733,6 +742,7 @@ class ParseNode
DecimalPoint decimalPoint; /* Whether the number has a decimal point */
} number;
class {
private:
friend class LoopControlStatement;
PropertyName* label; /* target of break/continue statement */
} loopControl;
@ -819,13 +829,18 @@ class ParseNode
#endif
};
struct NullaryNode : public ParseNode
class NullaryNode : public ParseNode
{
public:
NullaryNode(ParseNodeKind kind, const TokenPos& pos)
: ParseNode(kind, JSOP_NOP, PN_NULLARY, pos) {}
NullaryNode(ParseNodeKind kind, JSOp op, const TokenPos& pos)
: ParseNode(kind, op, PN_NULLARY, pos) {}
static bool test(const ParseNode& node) {
return node.isArity(PN_NULLARY);
}
#ifdef DEBUG
void dump();
#endif
@ -1587,7 +1602,7 @@ class LoopControlStatement : public ParseNode
{
protected:
LoopControlStatement(ParseNodeKind kind, PropertyName* label, const TokenPos& pos)
: ParseNode(kind, JSOP_NOP, PN_NULLARY, pos)
: ParseNode(kind, JSOP_NOP, PN_LOOP, pos)
{
MOZ_ASSERT(kind == PNK_BREAK || kind == PNK_CONTINUE);
pn_u.loopControl.label = label;
@ -1599,9 +1614,13 @@ class LoopControlStatement : public ParseNode
return pn_u.loopControl.label;
}
#ifdef DEBUG
void dump(int indent);
#endif
static bool test(const ParseNode& node) {
bool match = node.isKind(PNK_BREAK) || node.isKind(PNK_CONTINUE);
MOZ_ASSERT_IF(match, node.isArity(PN_NULLARY));
MOZ_ASSERT_IF(match, node.isArity(PN_LOOP));
MOZ_ASSERT_IF(match, node.isOp(JSOP_NOP));
return match;
}
@ -1616,7 +1635,7 @@ class BreakStatement : public LoopControlStatement
static bool test(const ParseNode& node) {
bool match = node.isKind(PNK_BREAK);
MOZ_ASSERT_IF(match, node.isArity(PN_NULLARY));
MOZ_ASSERT_IF(match, node.is<LoopControlStatement>());
MOZ_ASSERT_IF(match, node.isOp(JSOP_NOP));
return match;
}
@ -1631,18 +1650,24 @@ class ContinueStatement : public LoopControlStatement
static bool test(const ParseNode& node) {
bool match = node.isKind(PNK_CONTINUE);
MOZ_ASSERT_IF(match, node.isArity(PN_NULLARY));
MOZ_ASSERT_IF(match, node.is<LoopControlStatement>());
MOZ_ASSERT_IF(match, node.isOp(JSOP_NOP));
return match;
}
};
class DebuggerStatement : public ParseNode
class DebuggerStatement : public NullaryNode
{
public:
explicit DebuggerStatement(const TokenPos& pos)
: ParseNode(PNK_DEBUGGER, JSOP_NOP, PN_NULLARY, pos)
: NullaryNode(PNK_DEBUGGER, JSOP_NOP, pos)
{ }
static bool test(const ParseNode& node) {
bool match = node.isKind(PNK_DEBUGGER);
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
return match;
}
};
class ConditionalExpression : public TernaryNode
@ -1697,6 +1722,12 @@ class NullLiteral : public NullaryNode
explicit NullLiteral(const TokenPos& pos)
: NullaryNode(PNK_NULL, JSOP_NULL, pos)
{ }
static bool test(const ParseNode& node) {
bool match = node.isKind(PNK_NULL);
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
return match;
}
};
// This is only used internally, currently just for tagged templates.
@ -1707,6 +1738,12 @@ class RawUndefinedLiteral : public NullaryNode
public:
explicit RawUndefinedLiteral(const TokenPos& pos)
: NullaryNode(PNK_RAW_UNDEFINED, JSOP_UNDEFINED, pos) { }
static bool test(const ParseNode& node) {
bool match = node.isKind(PNK_RAW_UNDEFINED);
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
return match;
}
};
class BooleanLiteral : public NullaryNode
@ -1715,6 +1752,12 @@ class BooleanLiteral : public NullaryNode
BooleanLiteral(bool b, const TokenPos& pos)
: NullaryNode(b ? PNK_TRUE : PNK_FALSE, b ? JSOP_TRUE : JSOP_FALSE, pos)
{ }
static bool test(const ParseNode& node) {
bool match = node.isKind(PNK_TRUE) || node.isKind(PNK_FALSE);
MOZ_ASSERT_IF(match, node.is<NullaryNode>());
return match;
}
};
class RegExpLiteral : public ParseNode

View file

@ -5469,7 +5469,7 @@ Parser<ParseHandler>::exportBatch(uint32_t begin)
// Handle the form |export *| by adding a special export batch
// specifier to the list.
Node exportSpec = handler.newNullary(PNK_EXPORT_BATCH_SPEC, JSOP_NOP, pos());
NullaryNodeType exportSpec = handler.newNullary(PNK_EXPORT_BATCH_SPEC, JSOP_NOP, pos());
if (!exportSpec)
return null();
@ -6542,7 +6542,7 @@ Parser<ParseHandler>::switchStatement(YieldHandling yieldHandling)
}
template <typename ParseHandler>
typename ParseHandler::Node
typename ParseHandler::ContinueStatementType
Parser<ParseHandler>::continueStatement(YieldHandling yieldHandling)
{
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_CONTINUE));
@ -6600,7 +6600,7 @@ Parser<ParseHandler>::continueStatement(YieldHandling yieldHandling)
}
template <typename ParseHandler>
typename ParseHandler::Node
typename ParseHandler::BreakStatementType
Parser<ParseHandler>::breakStatement(YieldHandling yieldHandling)
{
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_BREAK));
@ -7192,7 +7192,7 @@ Parser<ParseHandler>::catchBlockStatement(YieldHandling yieldHandling,
}
template <typename ParseHandler>
typename ParseHandler::Node
typename ParseHandler::DebuggerStatementType
Parser<ParseHandler>::debuggerStatement()
{
TokenPos p;
@ -10378,7 +10378,7 @@ Parser<ParseHandler>::tryNewTarget(BinaryNodeType* newTarget)
*newTarget = null();
Node newHolder = handler.newPosHolder(pos());
NullaryNodeType newHolder = handler.newPosHolder(pos());
if (!newHolder)
return false;
@ -10406,7 +10406,7 @@ Parser<ParseHandler>::tryNewTarget(BinaryNodeType* newTarget)
return false;
}
Node targetHolder = handler.newPosHolder(pos());
NullaryNodeType targetHolder = handler.newPosHolder(pos());
if (!targetHolder)
return false;

View file

@ -1211,14 +1211,14 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_TYPE)
Node expressionAfterForInOrOf(ParseNodeKind forHeadKind, YieldHandling yieldHandling);
SwitchStatementType switchStatement(YieldHandling yieldHandling);
Node continueStatement(YieldHandling yieldHandling);
Node breakStatement(YieldHandling yieldHandling);
ContinueStatementType continueStatement(YieldHandling yieldHandling);
BreakStatementType breakStatement(YieldHandling yieldHandling);
UnaryNodeType returnStatement(YieldHandling yieldHandling);
BinaryNodeType withStatement(YieldHandling yieldHandling);
UnaryNodeType throwStatement(YieldHandling yieldHandling);
TernaryNodeType tryStatement(YieldHandling yieldHandling);
Node catchBlockStatement(YieldHandling yieldHandling, ParseContext::Scope& catchParamScope);
Node debuggerStatement();
DebuggerStatementType debuggerStatement();
Node variableStatement(YieldHandling yieldHandling);

View file

@ -224,7 +224,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
}
NumericLiteralType newNumber(double value, DecimalPoint decimalPoint, const TokenPos& pos) { return NodeGeneric; }
Node newBooleanLiteral(bool cond, const TokenPos& pos) { return NodeGeneric; }
BooleanLiteralType newBooleanLiteral(bool cond, const TokenPos& pos) { return NodeGeneric; }
NameNodeType newStringLiteral(JSAtom* atom, const TokenPos& pos) {
lastAtom = atom;
@ -243,8 +243,8 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
void addToCallSiteObject(CallSiteNodeType callSiteObj, Node rawNode, Node cookedNode) {}
UnaryNodeType newThisLiteral(const TokenPos& pos, Node thisName) { return NodeGeneric; }
Node newNullLiteral(const TokenPos& pos) { return NodeGeneric; }
Node newRawUndefinedLiteral(const TokenPos& pos) { return NodeGeneric; }
NullLiteralType newNullLiteral(const TokenPos& pos) { return NodeGeneric; }
RawUndefinedLiteralType newRawUndefinedLiteral(const TokenPos& pos) { return NodeGeneric; }
template <class Boxer>
RegExpLiteralType newRegExp(RegExpObject* reobj, const TokenPos& pos, Boxer& boxer) { return NodeGeneric; }
@ -263,7 +263,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return NodeUnparenthesizedUnary;
}
Node newNullary(ParseNodeKind kind, JSOp op, const TokenPos& pos) {
NullaryNodeType newNullary(ParseNodeKind kind, JSOp op, const TokenPos& pos) {
return NodeGeneric;
}
@ -316,8 +316,10 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
ClassNamesType newClassNames(Node outer, Node inner, const TokenPos& pos) { return NodeGeneric; }
ClassNodeType newClass(Node name, Node heritage, Node methodBlock, const TokenPos& pos) { return NodeGeneric; }
BinaryNodeType newNewTarget(Node newHolder, Node targetHolder) { return NodeGeneric; }
Node newPosHolder(const TokenPos& pos) { return NodeGeneric; }
BinaryNodeType newNewTarget(NullaryNodeType newHolder, NullaryNodeType targetHolder) {
return NodeGeneric;
}
NullaryNodeType newPosHolder(const TokenPos& pos) { return NodeGeneric; }
UnaryNodeType newSuperBase(Node thisName, const TokenPos& pos) { return NodeSuperBase; }
MOZ_MUST_USE bool addPrototypeMutation(ListNodeType literal, uint32_t begin, Node expr) { return true; }
@ -337,7 +339,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
void addStatementToList(ListNodeType list, Node stmt) {}
void addCaseStatementToList(ListNodeType list, CaseClauseType caseClause) {}
MOZ_MUST_USE bool prependInitialYield(ListNodeType stmtList, Node genName) { return true; }
Node newEmptyStatement(const TokenPos& pos) { return NodeEmptyStatement; }
UnaryNodeType newEmptyStatement(const TokenPos& pos) { return NodeEmptyStatement; }
UnaryNodeType newExportDeclaration(Node kid, const TokenPos& pos) {
return NodeGeneric;
@ -365,8 +367,8 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
return NodeGeneric;
}
CaseClauseType newCaseOrDefault(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
Node newContinueStatement(PropertyName* label, const TokenPos& pos) { return NodeGeneric; }
Node newBreakStatement(PropertyName* label, const TokenPos& pos) { return NodeBreak; }
ContinueStatementType newContinueStatement(PropertyName* label, const TokenPos& pos) { return NodeGeneric; }
BreakStatementType newBreakStatement(PropertyName* label, const TokenPos& pos) { return NodeBreak; }
UnaryNodeType newReturnStatement(Node expr, const TokenPos& pos) { return NodeReturn; }
BinaryNodeType newWithStatement(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
@ -378,7 +380,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
Node newTryStatement(uint32_t begin, Node body, ListNodeType catchList, Node finallyBlock) {
return NodeGeneric;
}
Node newDebuggerStatement(const TokenPos& pos) { return NodeGeneric; }
DebuggerStatementType newDebuggerStatement(const TokenPos& pos) { return NodeGeneric; }
NameNodeType newPropertyName(PropertyName* name, const TokenPos& pos) {
lastAtom = name;

View file

@ -598,7 +598,6 @@ static inline PropertyName*
LoopControlMaybeLabel(ParseNode* pn)
{
MOZ_ASSERT(pn->isKind(PNK_BREAK) || pn->isKind(PNK_CONTINUE));
MOZ_ASSERT(pn->isArity(PN_NULLARY));
return pn->as<LoopControlStatement>().label();
}