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

Unified Diff: src/ast/scopes.h

Issue 2158393002: Make the Scope constructors less reliant on SetDefaults to magically set flags (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Reupload Created 4 years, 5 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 | « no previous file | 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 397a1dbd05a1dfb4e83f97019e96723b5153ae69..b35581542a1a99d991e2e1e2e48439ae5e4c6445 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -124,7 +124,7 @@ class Scope: public ZoneObject {
// to the passed-in scope.
void PropagateUsageFlagsToScope(Scope* other);
- Zone* zone() const { return zone_; }
+ Zone* zone() const { return variables_.zone(); }
// ---------------------------------------------------------------------------
// Declarations
@@ -612,9 +612,9 @@ class Scope: public ZoneObject {
ZoneList<Scope*> inner_scopes_; // the immediately enclosed inner scopes
// The scope type.
- ScopeType scope_type_;
+ const ScopeType scope_type_;
// If the scope is a function scope, this is the function kind.
- FunctionKind function_kind_;
+ const FunctionKind function_kind_;
// Debugging support.
const AstRawString* scope_name_;
@@ -811,7 +811,7 @@ class Scope: public ZoneObject {
void AddInnerScope(Scope* inner_scope) {
if (inner_scope != NULL) {
- inner_scopes_.Add(inner_scope, zone_);
+ inner_scopes_.Add(inner_scope, zone());
inner_scope->outer_scope_ = this;
}
}
@@ -826,11 +826,7 @@ class Scope: public ZoneObject {
}
}
- void SetDefaults(ScopeType type, Scope* outer_scope,
- Handle<ScopeInfo> scope_info,
- FunctionKind function_kind = kNormalFunction);
-
- Zone* zone_;
+ void SetDefaults();
PendingCompilationErrorHandler pending_error_handler_;
};
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698