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

Unified Diff: src/scopes.cc

Issue 11438042: Allow lazy compilation (and thus optimisation) of functions inside eval. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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') | test/mjsunit/regress/regress-2315.js » ('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 8ef969e653f1229ddf9f5c122b7378507024119a..56a922d25da9395604e210f7847ef498043c6e66 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -729,17 +729,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') | test/mjsunit/regress/regress-2315.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698