Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Unified Diff: src/parsing/parser.cc

Issue 2160943004: Remove ast_value_factory_ and usages from scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename NewScope(...FunctionKind) to NewFunctionScope Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 778da5f8f0db1360787c353ec49403ae4b834503..87569a4868a9ac229c2a3eefd392b69b011ca90e 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -210,7 +210,7 @@ FunctionLiteral* Parser::DefaultConstructor(const AstRawString* name,
FunctionKind kind = call_super ? FunctionKind::kDefaultSubclassConstructor
: FunctionKind::kDefaultBaseConstructor;
- Scope* function_scope = NewScope(scope, FUNCTION_SCOPE, kind);
+ Scope* function_scope = NewFunctionScope(scope, kind);
SetLanguageMode(function_scope,
static_cast<LanguageMode>(language_mode | STRICT));
// Set start and end position to the same value
@@ -944,7 +944,8 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
info->set_script_scope(scope);
if (!info->context().is_null() && !info->context()->IsNativeContext()) {
scope = Scope::DeserializeScopeChain(info->isolate(), zone(),
- *info->context(), scope);
+ *info->context(), scope,
+ ast_value_factory());
// The Scope is backed up by ScopeInfo (which is in the V8 heap); this
// means the Parser cannot operate independent of the V8 heap. Tell the
// string table to internalize strings and values right after they're
@@ -1110,7 +1111,7 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info,
// main thread.
DCHECK(parsing_on_main_thread_);
scope = Scope::DeserializeScopeChain(isolate, zone(), *info->context(),
- scope);
+ scope, ast_value_factory());
}
original_scope_ = scope;
AstNodeFactory function_factory(ast_value_factory());
@@ -1139,7 +1140,7 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info,
// TODO(adamk): We should construct this scope from the ScopeInfo.
Scope* scope =
- NewScope(this->scope(), FUNCTION_SCOPE, FunctionKind::kArrowFunction);
+ NewFunctionScope(this->scope(), FunctionKind::kArrowFunction);
// These two bits only need to be explicitly set because we're
// not passing the ScopeInfo to the Scope constructor.
@@ -4302,7 +4303,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
function_name = ast_value_factory()->empty_string();
}
- Scope* scope = NewScope(this->scope(), FUNCTION_SCOPE, kind);
+ Scope* scope = NewFunctionScope(this->scope(), kind);
SetLanguageMode(scope, language_mode);
ZoneList<Statement*>* body = NULL;
int arity = -1;
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698