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

Unified Diff: src/scopes.cc

Issue 1214303002: Remove outdated ban on lazy compilation due to scope chain. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « src/scopes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index e0922b423b5600cdc5927b69fb011079a2e86741..5f7ed84beecca11f7e5f3715c93b5aa4f58a903e 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -711,25 +711,6 @@ bool Scope::HasTrivialOuterContext() const {
}
-bool Scope::HasLazyCompilableOuterContext() const {
- Scope* outer = outer_scope_;
- if (outer == NULL) return true;
- // We have to prevent lazy compilation if this scope is inside a with scope
- // and all declaration scopes between them have empty contexts. Such
- // declaration scopes may become invisible during scope info deserialization.
- outer = outer->DeclarationScope();
- bool found_non_trivial_declarations = false;
- for (const Scope* scope = outer; scope != NULL; scope = scope->outer_scope_) {
- if (scope->is_with_scope() && !found_non_trivial_declarations) return false;
- if (scope->is_block_scope() && !scope->decls_.is_empty()) return false;
- if (scope->is_declaration_scope() && scope->num_heap_slots() > 0) {
- found_non_trivial_declarations = true;
- }
- }
- return true;
-}
-
-
bool Scope::AllowsLazyParsing() const {
// If we are inside a block scope, we must parse eagerly to find out how
// to allocate variables on the block scope. At this point, declarations may
@@ -741,9 +722,7 @@ bool Scope::AllowsLazyParsing() const {
}
-bool Scope::AllowsLazyCompilation() const {
- return !force_eager_compilation_ && HasLazyCompilableOuterContext();
-}
+bool Scope::AllowsLazyCompilation() const { return !force_eager_compilation_; }
bool Scope::AllowsLazyCompilationWithoutContext() const {
« no previous file with comments | « src/scopes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698