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

Unified Diff: src/parser.cc

Issue 1216013002: Parse eagerly inside block scopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplified a lot Created 5 years, 6 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 | « no previous file | src/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 4a56b19dd2a09c59c95ea7eb31d0c3e48b09f08a..faf36c4c7455d541f2bf38f6761f52fe1b359bd1 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4036,9 +4036,9 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// To make this additional case work, both Parser and PreParser implement a
// logic where only top-level functions will be parsed lazily.
- bool is_lazily_parsed = (mode() == PARSE_LAZILY &&
- scope_->AllowsLazyCompilation() &&
- !parenthesized_function_);
+ bool is_lazily_parsed = mode() == PARSE_LAZILY &&
+ scope_->AllowsLazyParsing() &&
+ !parenthesized_function_;
parenthesized_function_ = false; // The bit was set for this function only.
// Eager or lazy parse?
@@ -4048,11 +4048,6 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// try to lazy parse in the first place, we'll have to parse eagerly.
Scanner::BookmarkScope bookmark(scanner());
if (is_lazily_parsed) {
- for (Scope* s = scope_->outer_scope();
- s != nullptr && (s != s->DeclarationScope()); s = s->outer_scope()) {
- s->ForceContextAllocation();
- }
-
Scanner::BookmarkScope* maybe_bookmark =
bookmark.Set() ? &bookmark : nullptr;
SkipLazyFunctionBody(&materialized_literal_count,
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698