Bug 1577857 - Create ParseInfo class to manage Parser related information r=tcampbell
- Hoists the UsedNameTracker and and the FunctionTreeHolder into a new ParseInfo structure. - Make LifoAllocScopes lifetimes lexically explicit throughout parser. - Removes allocator argument to Parser construction in lieu of the LifoAllocScope inside of ParseInfo. Differential Revision: https://phabricator.services.mozilla.com/D45042
This commit is contained in:
@@ -83,14 +83,14 @@ using UsedNamePtr = UsedNameTracker::UsedNameMap::Ptr;
|
||||
|
||||
template <typename Tok>
|
||||
BinASTParserPerTokenizer<Tok>::BinASTParserPerTokenizer(
|
||||
JSContext* cx, LifoAlloc& alloc, UsedNameTracker& usedNames,
|
||||
JSContext* cx, ParseInfo& parseInfo,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
HandleScriptSourceObject sourceObject,
|
||||
Handle<LazyScript*> lazyScript /* = nullptr */)
|
||||
: BinASTParserBase(cx, alloc, usedNames, sourceObject),
|
||||
: BinASTParserBase(cx, parseInfo, sourceObject),
|
||||
options_(options),
|
||||
lazyScript_(cx, lazyScript),
|
||||
handler_(cx, alloc, nullptr, SourceKind::Binary),
|
||||
handler_(cx, parseInfo.allocScope.alloc(), nullptr, SourceKind::Binary),
|
||||
variableDeclarationKind_(VariableDeclarationKind::Var),
|
||||
treeHolder_(cx, FunctionTreeHolder::Mode::Eager) {
|
||||
MOZ_ASSERT_IF(lazyScript_, lazyScript_->isBinAST());
|
||||
|
||||
Reference in New Issue
Block a user