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

Unified Diff: src/scopes.cc

Issue 11564012: Merged r13161 into 3.14 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.14
Patch Set: Created 8 years 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/preparser.h ('k') | src/version.cc » ('j') | 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 c9612577afa22c56e5461e543c8edcb3a9adeb63..434479ca5d199794d12a8b46c9e1984f0f51e9a2 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -702,17 +702,12 @@ bool Scope::HasTrivialOuterContext() const {
bool Scope::HasLazyCompilableOuterContext() const {
Scope* outer = outer_scope_;
if (outer == NULL) return true;
- // There are several reasons that prevent lazy compilation:
- // - This scope is inside a with scope and all declaration scopes between
- // them have empty contexts. Such declaration scopes become invisible
- // during scope info deserialization.
- // - This scope is inside a strict eval scope with variables that are
- // potentially context allocated in an artificial function scope that
- // is not deserialized correctly.
+ // 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_eval_scope()) return false;
if (scope->is_with_scope() && !found_non_trivial_declarations) return false;
if (scope->is_declaration_scope() && scope->num_heap_slots() > 0) {
found_non_trivial_declarations = true;
« no previous file with comments | « src/preparser.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698