diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 85aceaf4c961..a6d0606d7298 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -536,10 +536,6 @@ class BytecodeEmitter::EmitterScope : public Nestable::enclosing(); } @@ -2402,13 +2398,6 @@ BytecodeEmitter::init() return atomIndices.acquire(cx); } -template bool */> -BytecodeEmitter::NestableControl* -BytecodeEmitter::findInnermostNestableControl(Predicate predicate) const -{ - return NestableControl::findNearest(innermostNestableControl, predicate); -} - template T* BytecodeEmitter::findInnermostNestableControl() const @@ -5159,54 +5148,6 @@ BytecodeEmitter::emitFunctionScript(ParseNode* body) return true; } -template -bool -BytecodeEmitter::emitDestructuringDeclsWithEmitter(ParseNode* pattern, NameEmitter emitName) -{ - if (pattern->isKind(ParseNodeKind::Array)) { - for (ParseNode* element = pattern->pn_head; element; element = element->pn_next) { - if (element->isKind(ParseNodeKind::Elision)) - continue; - ParseNode* target = element; - if (element->isKind(ParseNodeKind::Spread)) { - target = element->pn_kid; - } - if (target->isKind(ParseNodeKind::Assign)) - target = target->pn_left; - if (target->isKind(ParseNodeKind::Name)) { - if (!emitName(this, target)) - return false; - } else { - if (!emitDestructuringDeclsWithEmitter(target, emitName)) - return false; - } - } - return true; - } - - MOZ_ASSERT(pattern->isKind(ParseNodeKind::Object)); - for (ParseNode* member = pattern->pn_head; member; member = member->pn_next) { - MOZ_ASSERT(member->isKind(ParseNodeKind::MutateProto) || - member->isKind(ParseNodeKind::Colon) || - member->isKind(ParseNodeKind::Shorthand)); - - ParseNode* target = member->isKind(ParseNodeKind::MutateProto) - ? member->pn_kid - : member->pn_right; - - if (target->isKind(ParseNodeKind::Assign)) - target = target->pn_left; - if (target->isKind(ParseNodeKind::Name)) { - if (!emitName(this, target)) - return false; - } else { - if (!emitDestructuringDeclsWithEmitter(target, emitName)) - return false; - } - } - return true; -} - bool BytecodeEmitter::emitDestructuringLHSRef(ParseNode* target, size_t* emitted) { @@ -11420,16 +11361,6 @@ CGObjectList::add(ObjectBox* objbox) return length++; } -unsigned -CGObjectList::indexOf(JSObject* obj) -{ - MOZ_ASSERT(length > 0); - unsigned index = length - 1; - for (ObjectBox* box = lastbox; box->object != obj; box = box->emitLink) - index--; - return index; -} - void CGObjectList::finish(ObjectArray* array) { @@ -11447,16 +11378,6 @@ CGObjectList::finish(ObjectArray* array) MOZ_ASSERT(cursor == array->vector); } -ObjectBox* -CGObjectList::find(uint32_t index) -{ - MOZ_ASSERT(index < length); - ObjectBox* box = lastbox; - for (unsigned n = length - 1; n > index; n--) - box = box->emitLink; - return box; -} - void CGScopeList::finish(ScopeArray* array) { diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index 140f958a2902..d0a779204168 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -44,9 +44,7 @@ struct CGObjectList { CGObjectList() : length(0), lastbox(nullptr) {} unsigned add(ObjectBox* objbox); - unsigned indexOf(JSObject* obj); void finish(ObjectArray* array); - ObjectBox* find(uint32_t index); }; struct MOZ_STACK_CLASS CGScopeList { @@ -370,9 +368,6 @@ struct MOZ_STACK_CLASS BytecodeEmitter MOZ_MUST_USE bool init(); - template bool */> - NestableControl* findInnermostNestableControl(Predicate predicate) const; - template T* findInnermostNestableControl() const; @@ -776,12 +771,6 @@ struct MOZ_STACK_CLASS BytecodeEmitter MOZ_MUST_USE bool emitDestructuringOpsArray(ParseNode* pattern, DestructuringFlavor flav); MOZ_MUST_USE bool emitDestructuringOpsObject(ParseNode* pattern, DestructuringFlavor flav); - typedef bool - (*DestructuringDeclEmitter)(BytecodeEmitter* bce, ParseNode* pn); - - template - MOZ_MUST_USE bool emitDestructuringDeclsWithEmitter(ParseNode* pattern, NameEmitter emitName); - enum class CopyOption { Filtered, Unfiltered }; diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h index 48ee87009a02..ea09cd684112 100644 --- a/js/src/frontend/FullParseHandler.h +++ b/js/src/frontend/FullParseHandler.h @@ -311,9 +311,6 @@ class FullParseHandler ParseNode* newSuperBase(ParseNode* thisName, const TokenPos& pos) { return new_(ParseNodeKind::SuperBase, pos, thisName); } - ParseNode* newCatchBlock(ParseNode* catchName, ParseNode* catchGuard, ParseNode* catchBody) { - return new_(ParseNodeKind::Catch, catchName, catchGuard, catchBody); - } MOZ_MUST_USE bool addPrototypeMutation(ParseNode* literal, uint32_t begin, ParseNode* expr) { MOZ_ASSERT(literal->isKind(ParseNodeKind::Object)); MOZ_ASSERT(literal->isArity(PN_LIST)); @@ -473,10 +470,6 @@ class FullParseHandler list->pn_xflags |= PNX_FUNCDEFS; } - MOZ_MUST_USE inline bool addCatchBlock(ParseNode* catchList, ParseNode* lexicalScope, - ParseNode* catchName, ParseNode* catchGuard, - ParseNode* catchBody); - MOZ_MUST_USE bool prependInitialYield(ParseNode* stmtList, ParseNode* genName) { MOZ_ASSERT(stmtList->isKind(ParseNodeKind::StatementList)); MOZ_ASSERT(stmtList->isArity(PN_LIST)); @@ -947,19 +940,6 @@ class FullParseHandler } }; -inline bool -FullParseHandler::addCatchBlock(ParseNode* catchList, ParseNode* lexicalScope, - ParseNode* catchName, ParseNode* catchGuard, - ParseNode* catchBody) -{ - ParseNode* catchpn = newCatchBlock(catchName, catchGuard, catchBody); - if (!catchpn) - return false; - addList(/* list = */ catchList, /* child = */ lexicalScope); - lexicalScope->setScopeBody(catchpn); - return true; -} - inline bool FullParseHandler::setLastFunctionFormalParameterDefault(ParseNode* funcpn, ParseNode* defaultValue) diff --git a/js/src/frontend/ParseNode-inl.h b/js/src/frontend/ParseNode-inl.h index 2402f3b0698c..eaed735a37ea 100644 --- a/js/src/frontend/ParseNode-inl.h +++ b/js/src/frontend/ParseNode-inl.h @@ -22,13 +22,6 @@ ParseNode::name() const return atom->asPropertyName(); } -inline JSAtom* -ParseNode::atom() const -{ - MOZ_ASSERT(isKind(ParseNodeKind::String)); - return pn_atom; -} - } /* namespace frontend */ } /* namespace js */ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index 98c02a178a87..e371c32fe735 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -623,7 +623,6 @@ class ParseNode // include "ParseNode-inl.h" for these methods. inline PropertyName* name() const; - inline JSAtom* atom() const; ParseNode* expr() const { MOZ_ASSERT(pn_arity == PN_NAME || pn_arity == PN_CODE); diff --git a/js/src/frontend/SharedContext.h b/js/src/frontend/SharedContext.h index 28ccfec02951..180d1c9b39f2 100644 --- a/js/src/frontend/SharedContext.h +++ b/js/src/frontend/SharedContext.h @@ -235,10 +235,6 @@ class SharedContext bool needStrictChecks() const { return strict() || extraWarnings; } - - bool isDotVariable(JSAtom* atom) const { - return atom == context->names().dotGenerator || atom == context->names().dotThis; - } }; class MOZ_STACK_CLASS GlobalSharedContext : public SharedContext diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index 607eae589b74..5bbbdca813f4 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -561,8 +561,6 @@ class TokenStreamAnyChars return currentToken().type == type; } - bool getMutedErrors() const { return mutedErrors; } - MOZ_MUST_USE bool checkOptions(); private: @@ -587,14 +585,6 @@ class TokenStreamAnyChars return false; } - PropertyName* nextName() const { - if (nextToken().type != TokenKind::Name) - return nextToken().name(); - - MOZ_ASSERT(TokenKindIsPossibleIdentifierName(nextToken().type)); - return reservedWordToPropertyName(nextToken().type); - } - bool isCurrentTokenAssignment() const { return TokenKindIsAssignment(currentToken().type); } @@ -775,10 +765,6 @@ class TokenStreamAnyChars SourceCoords srcCoords; - JSAtomState& names() const { - return cx->names(); - } - JSContext* context() const { return cx; } @@ -1740,13 +1726,6 @@ class MOZ_STACK_CLASS TokenStreamSpecific MOZ_ASSERT(!SourceUnits::isRawEOLChar(c)); } } - - void skipCharsIgnoreEOL(uint8_t n) { - while (n-- > 0) { - MOZ_ASSERT(sourceUnits.hasRawChars()); - getCharIgnoreEOL(); - } - } }; // It's preferable to define this in TokenStream.cpp, but its template-ness