mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 1418026: Remove unused code from js/src/frontend. r=jandem
This commit is contained in:
parent
5418665096
commit
027f71e3dd
@ -52,7 +52,6 @@ class MOZ_STACK_CLASS BytecodeCompiler
|
||||
const Maybe<uint32_t>& parameterListEnd);
|
||||
|
||||
ScriptSourceObject* sourceObjectPtr() const;
|
||||
SourceCompressionTask* sourceCompressionTask() const;
|
||||
|
||||
private:
|
||||
JSScript* compileScript(HandleObject environment, SharedContext* sc);
|
||||
@ -94,19 +93,6 @@ class MOZ_STACK_CLASS BytecodeCompiler
|
||||
RootedScript script;
|
||||
};
|
||||
|
||||
AutoFrontendTraceLog::AutoFrontendTraceLog(JSContext* cx, const TraceLoggerTextId id,
|
||||
const char* filename, size_t line, size_t column)
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
: logger_(TraceLoggerForCurrentThread(cx))
|
||||
{
|
||||
frontendEvent_.emplace(TraceLogger_Frontend, filename, line, column);
|
||||
frontendLog_.emplace(logger_, *frontendEvent_);
|
||||
typeLog_.emplace(logger_, id);
|
||||
}
|
||||
#else
|
||||
{ }
|
||||
#endif
|
||||
|
||||
AutoFrontendTraceLog::AutoFrontendTraceLog(JSContext* cx, const TraceLoggerTextId id,
|
||||
const ErrorReporter& errorReporter)
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
|
@ -134,9 +134,6 @@ class MOZ_STACK_CLASS AutoFrontendTraceLog
|
||||
#endif
|
||||
|
||||
public:
|
||||
AutoFrontendTraceLog(JSContext* cx, const TraceLoggerTextId id,
|
||||
const char* filename, size_t line, size_t column);
|
||||
|
||||
AutoFrontendTraceLog(JSContext* cx, const TraceLoggerTextId id,
|
||||
const ErrorReporter& reporter);
|
||||
|
||||
|
@ -346,7 +346,6 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||
varEmitterScope = emitterScope;
|
||||
}
|
||||
|
||||
Scope* bodyScope() const { return scopeList.vector[bodyScopeIndex]; }
|
||||
Scope* outermostScope() const { return scopeList.vector[0]; }
|
||||
Scope* innermostScope() const;
|
||||
|
||||
@ -393,7 +392,6 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||
SrcNotesVector& notes() const { return current->notes; }
|
||||
ptrdiff_t lastNoteOffset() const { return current->lastNoteOffset; }
|
||||
unsigned currentLine() const { return current->currentLine; }
|
||||
unsigned lastColumn() const { return current->lastColumn; }
|
||||
|
||||
// Check if the last emitted opcode is a jump target.
|
||||
bool lastOpcodeIsJumpTarget() const {
|
||||
|
@ -29,14 +29,6 @@ class FullParseHandler
|
||||
return static_cast<ParseNode*>(allocator.allocNode());
|
||||
}
|
||||
|
||||
ParseNode* cloneNode(const ParseNode& other) {
|
||||
ParseNode* node = allocParseNode(sizeof(ParseNode));
|
||||
if (!node)
|
||||
return nullptr;
|
||||
mozilla::PodAssign(node, &other);
|
||||
return node;
|
||||
}
|
||||
|
||||
/*
|
||||
* If this is a full parse to construct the bytecode for a function that
|
||||
* was previously lazily parsed, that lazy function and the current index
|
||||
@ -73,11 +65,6 @@ class FullParseHandler
|
||||
return node->isInParens() && (node->isKind(PNK_OBJECT) || node->isKind(PNK_ARRAY));
|
||||
}
|
||||
|
||||
static bool isDestructuringPatternAnyParentheses(ParseNode* node) {
|
||||
return isUnparenthesizedDestructuringPattern(node) ||
|
||||
isParenthesizedDestructuringPattern(node);
|
||||
}
|
||||
|
||||
FullParseHandler(JSContext* cx, LifoAlloc& alloc, LazyScript* lazyOuterFunction)
|
||||
: allocator(cx, alloc),
|
||||
lazyOuterFunction_(cx, lazyOuterFunction),
|
||||
@ -629,7 +616,6 @@ class FullParseHandler
|
||||
|
||||
inline MOZ_MUST_USE bool setLastFunctionFormalParameterDefault(ParseNode* funcpn,
|
||||
ParseNode* pn);
|
||||
inline void setLastFunctionFormalParameterDestructuring(ParseNode* funcpn, ParseNode* pn);
|
||||
|
||||
void checkAndSetIsDirectRHSAnonFunction(ParseNode* pn) {
|
||||
if (IsAnonymousFunctionDefinition(pn))
|
||||
@ -686,10 +672,6 @@ class FullParseHandler
|
||||
return newBinary(kind, lhs, rhs);
|
||||
}
|
||||
|
||||
bool isUnparenthesizedYieldExpression(ParseNode* node) {
|
||||
return node->isKind(PNK_YIELD) && !node->isInParens();
|
||||
}
|
||||
|
||||
bool isUnparenthesizedAssignment(Node node) {
|
||||
if (node->isKind(PNK_ASSIGN) && !node->isInParens()) {
|
||||
// PNK_ASSIGN is also (mis)used for things like |var name = expr;|.
|
||||
@ -757,10 +739,6 @@ class FullParseHandler
|
||||
}
|
||||
|
||||
private:
|
||||
ParseNode* newList(ParseNodeKind kind, uint32_t begin) {
|
||||
return newList(kind, TokenPos(begin, begin + 1));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ParseNode* newList(ParseNodeKind kind, const T& begin) = delete;
|
||||
|
||||
@ -819,10 +797,6 @@ class FullParseHandler
|
||||
return pn->isConstant();
|
||||
}
|
||||
|
||||
bool isUnparenthesizedName(ParseNode* node) {
|
||||
return node->isKind(PNK_NAME) && !node->isInParens();
|
||||
}
|
||||
|
||||
bool isNameAnyParentheses(ParseNode* node) {
|
||||
return node->isKind(PNK_NAME);
|
||||
}
|
||||
@ -852,9 +826,6 @@ class FullParseHandler
|
||||
node->pn_atom == cx->names().async;
|
||||
}
|
||||
|
||||
bool isCall(ParseNode* pn) {
|
||||
return pn->isKind(PNK_CALL);
|
||||
}
|
||||
PropertyName* maybeDottedProperty(ParseNode* pn) {
|
||||
return pn->is<PropertyAccess>() ? &pn->as<PropertyAccess>().name() : nullptr;
|
||||
}
|
||||
@ -876,16 +847,13 @@ class FullParseHandler
|
||||
bool canSkipLazyClosedOverBindings() {
|
||||
return !!lazyOuterFunction_;
|
||||
}
|
||||
LazyScript* lazyOuterFunction() {
|
||||
return lazyOuterFunction_;
|
||||
}
|
||||
JSFunction* nextLazyInnerFunction() {
|
||||
MOZ_ASSERT(lazyInnerFunctionIndex < lazyOuterFunction()->numInnerFunctions());
|
||||
return lazyOuterFunction()->innerFunctions()[lazyInnerFunctionIndex++];
|
||||
MOZ_ASSERT(lazyInnerFunctionIndex < lazyOuterFunction_->numInnerFunctions());
|
||||
return lazyOuterFunction_->innerFunctions()[lazyInnerFunctionIndex++];
|
||||
}
|
||||
JSAtom* nextLazyClosedOverBinding() {
|
||||
MOZ_ASSERT(lazyClosedOverBindingIndex < lazyOuterFunction()->numClosedOverBindings());
|
||||
return lazyOuterFunction()->closedOverBindings()[lazyClosedOverBindingIndex++];
|
||||
MOZ_ASSERT(lazyClosedOverBindingIndex < lazyOuterFunction_->numClosedOverBindings());
|
||||
return lazyOuterFunction_->closedOverBindings()[lazyClosedOverBindingIndex++];
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@ enum class DeprecatedLanguageExtension
|
||||
// NO LONGER USING 7
|
||||
// NO LONGER USING 8
|
||||
// NO LONGER USING 9
|
||||
BlockScopeFunRedecl = 10,
|
||||
// NO LONGER USING 10
|
||||
|
||||
// Sentinel value. MAY change as extension initializers are added (only to
|
||||
// the end) above.
|
||||
|
@ -47,10 +47,6 @@ class CollectionPool
|
||||
purgeAll();
|
||||
}
|
||||
|
||||
bool empty() const {
|
||||
return all_.empty();
|
||||
}
|
||||
|
||||
void purgeAll() {
|
||||
void** end = all_.end();
|
||||
for (void** it = all_.begin(); it != end; ++it)
|
||||
@ -156,8 +152,6 @@ using CheckTDZMap = RecyclableNameMap<MaybeCheckTDZ>;
|
||||
using NameLocationMap = RecyclableNameMap<NameLocation>;
|
||||
using AtomIndexMap = RecyclableNameMap<uint32_t>;
|
||||
|
||||
#undef RECYCLABLE_NAME_MAP_TYPE
|
||||
|
||||
template <typename RepresentativeTable>
|
||||
class InlineTablePool
|
||||
: public CollectionPool<RepresentativeTable, InlineTablePool<RepresentativeTable>>
|
||||
|
@ -155,11 +155,6 @@ class SyntaxParseHandler
|
||||
return node == NodeParenthesizedArray || node == NodeParenthesizedObject;
|
||||
}
|
||||
|
||||
static bool isDestructuringPatternAnyParentheses(Node node) {
|
||||
return isUnparenthesizedDestructuringPattern(node) ||
|
||||
isParenthesizedDestructuringPattern(node);
|
||||
}
|
||||
|
||||
public:
|
||||
SyntaxParseHandler(JSContext* cx, LifoAlloc& alloc, LazyScript* lazyOuterFunction)
|
||||
: lastAtom(nullptr)
|
||||
@ -170,8 +165,6 @@ class SyntaxParseHandler
|
||||
void prepareNodeForMutation(Node node) {}
|
||||
void freeTree(Node node) {}
|
||||
|
||||
void trace(JSTracer* trc) {}
|
||||
|
||||
Node newName(PropertyName* name, const TokenPos& pos, JSContext* cx) {
|
||||
lastAtom = name;
|
||||
if (name == cx->names().arguments)
|
||||
@ -507,17 +500,12 @@ class SyntaxParseHandler
|
||||
|
||||
bool isConstant(Node pn) { return false; }
|
||||
|
||||
bool isUnparenthesizedName(Node node) {
|
||||
bool isNameAnyParentheses(Node node) {
|
||||
return node == NodeUnparenthesizedArgumentsName ||
|
||||
node == NodeUnparenthesizedEvalName ||
|
||||
node == NodeUnparenthesizedName ||
|
||||
node == NodePotentialAsyncKeyword;
|
||||
}
|
||||
|
||||
bool isNameAnyParentheses(Node node) {
|
||||
if (isUnparenthesizedName(node))
|
||||
return true;
|
||||
return node == NodeParenthesizedArgumentsName ||
|
||||
node == NodePotentialAsyncKeyword ||
|
||||
node == NodeParenthesizedArgumentsName ||
|
||||
node == NodeParenthesizedEvalName ||
|
||||
node == NodeParenthesizedName;
|
||||
}
|
||||
|
@ -1314,7 +1314,7 @@
|
||||
"expires_in_version": "never",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach=0, DestructuringForIn=1 (obsolete), LegacyGenerator=2, ExpressionClosure=3, LetBlock=4 (obsolete), LetExpression=5 (obsolete), NoSuchMethod=6 (obsolete), FlagsArgument=7 (obsolete), RegExpSourceProp=8 (obsolete), RestoredRegExpStatics=9 (obsolete), BlockScopeFunRedecl=10"
|
||||
"description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach=0 (obsolete), DestructuringForIn=1 (obsolete), LegacyGenerator=2 (obsolete), ExpressionClosure=3, LetBlock=4 (obsolete), LetExpression=5 (obsolete), NoSuchMethod=6 (obsolete), FlagsArgument=7 (obsolete), RegExpSourceProp=8 (obsolete), RestoredRegExpStatics=9 (obsolete), BlockScopeFunRedecl=10 (obsolete)"
|
||||
},
|
||||
"JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
@ -1322,7 +1322,7 @@
|
||||
"expires_in_version": "never",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "Use of SpiderMonkey's deprecated language extensions in add-ons: ForEach=0, DestructuringForIn=1 (obsolete), LegacyGenerator=2, ExpressionClosure=3, LetBlock=4 (obsolete), LetExpression=5 (obsolete), NoSuchMethod=6 (obsolete), FlagsArgument=7 (obsolete), RegExpSourceProp=8 (obsolete), RestoredRegExpStatics=9 (obsolete), BlockScopeFunRedecl=10"
|
||||
"description": "Use of SpiderMonkey's deprecated language extensions in add-ons: ForEach=0 (obsolete), DestructuringForIn=1 (obsolete), LegacyGenerator=2 (obsolete), ExpressionClosure=3, LetBlock=4 (obsolete), LetExpression=5 (obsolete), NoSuchMethod=6 (obsolete), FlagsArgument=7 (obsolete), RegExpSourceProp=8 (obsolete), RestoredRegExpStatics=9 (obsolete), BlockScopeFunRedecl=10 (obsolete)"
|
||||
},
|
||||
"JS_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
|
Loading…
Reference in New Issue
Block a user