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

Unified Diff: src/ast/scopes.h

Issue 2399833002: Teach Scopes whether they will end up being lazily compiled or not (Closed)
Patch Set: rebase Created 4 years, 2 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/ast/ast.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index e7e8a6f64572a2a7790742cd7ba0d6d2fc0db559..3d5004041ed3279b41eb664ea1f430cfb9d72df5 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -419,6 +419,12 @@ class Scope: public ZoneObject {
bool is_lazily_parsed() const { return is_lazily_parsed_; }
+ bool ShouldEagerCompile() const;
+
+ // Marks this scope and all inner scopes (except for inner function scopes)
+ // such that they get eagerly compiled.
+ void SetShouldEagerCompile();
+
protected:
explicit Scope(Zone* zone);
@@ -447,7 +453,7 @@ class Scope: public ZoneObject {
DCHECK(!already_resolved_);
// A lazily parsed scope doesn't contain enough information to create a
// ScopeInfo from it.
- if (is_lazily_parsed_) return false;
+ if (!ShouldEagerCompile()) return false;
// The debugger expects all functions to have scope infos.
// TODO(jochen|yangguo): Remove this requirement.
if (is_function_scope()) return true;
@@ -523,6 +529,7 @@ class Scope: public ZoneObject {
bool is_declaration_scope_ : 1;
bool is_lazily_parsed_ : 1;
+ bool should_eager_compile_ : 1;
// Create a non-local variable with a given name.
// These variables are looked up dynamically at runtime.
« no previous file with comments | « src/ast/ast.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698