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

Unified Diff: src/ast/scopes.h

Issue 2399833002: Teach Scopes whether they will end up being lazily compiled or not (Closed)
Patch Set: 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
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index ec946142e8d3c17637ff615efcc7fbee959cb8f8..45e8346d5c6a983ec1f504d61fc33d08fe315a5b 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -418,6 +418,13 @@ class Scope: public ZoneObject {
bool is_debug_evaluate_scope() const { return is_debug_evaluate_scope_; }
bool is_lazily_parsed() const { return is_lazily_parsed_; }
+ bool should_compile_lazily() const {
+ return is_lazily_parsed_ || should_compile_lazily_;
+ }
+
+ // Marks this scope and all inner scopes (except for inner function scopes)
+ // as lazy.
marja 2016/10/06 11:53:06 Why "except for inner function scopes"? If we com
jochen (gone - plz use gerrit) 2016/10/06 15:05:04 yeah, but not the other way round... if we compile
+ void SetShouldCompileLazily(bool is_lazy);
protected:
explicit Scope(Zone* zone);
@@ -447,7 +454,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 (should_compile_lazily()) 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 +530,7 @@ class Scope: public ZoneObject {
bool is_declaration_scope_ : 1;
bool is_lazily_parsed_ : 1;
+ bool should_compile_lazily_ : 1;
// Create a non-local variable with a given name.
// These variables are looked up dynamically at runtime.

Powered by Google App Engine
This is Rietveld 408576698