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

Unified Diff: src/ast/scopes.h

Issue 2257473002: Initialize num_heap_slots_ to MIN_CONTEXT_SLOTS in SetDefaults, make already_resolved_ debug-only (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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') | src/ast/scopes.cc » ('J')
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 3480b866baaffbd46fefa4270a7595e48cbacd88..8cfac5262a5a372db2433ba0472273e643daeb06 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -166,7 +166,7 @@ class Scope: public ZoneObject {
// Note that we must not share the unresolved variables with
// the same name because they may be removed selectively via
// RemoveUnresolved().
- DCHECK(!already_resolved());
+ DCHECK(!already_resolved_);
DCHECK_EQ(factory->zone(), zone());
VariableProxy* proxy =
factory->NewVariableProxy(name, kind, start_position, end_position);
@@ -176,7 +176,7 @@ class Scope: public ZoneObject {
}
void AddUnresolved(VariableProxy* proxy) {
- DCHECK(!already_resolved());
+ DCHECK(!already_resolved_);
DCHECK(!proxy->is_resolved());
proxy->set_next_unresolved(unresolved_);
unresolved_ = proxy;
@@ -289,7 +289,7 @@ class Scope: public ZoneObject {
// In some cases we want to force context allocation for a whole scope.
void ForceContextAllocation() {
- DCHECK(!already_resolved());
+ DCHECK(!already_resolved_);
force_context_allocation_ = true;
}
bool has_forced_context_allocation() const {
@@ -471,6 +471,10 @@ class Scope: public ZoneObject {
// Debugging support.
#ifdef DEBUG
const AstRawString* scope_name_;
+
+ // True if it doesn't need scope resolution (e.g., if the scope was
+ // constructed based on a serialized scope info or a catch context).
+ bool already_resolved_ : 1;
#endif
// Source positions.
@@ -515,11 +519,6 @@ class Scope: public ZoneObject {
bool force_eager_compilation_ : 1;
bool force_context_allocation_ : 1;
- // True if it doesn't need scope resolution (e.g., if the scope was
- // constructed based on a serialized scope info or a catch context).
- bool already_resolved_ : 1;
- bool already_resolved() { return already_resolved_; }
-
// True if it holds 'var' declarations.
bool is_declaration_scope_ : 1;
@@ -803,7 +802,7 @@ class DeclarationScope : public Scope {
// adjusting the scope of temporaries used when desugaring parameter
// initializers.
void AddTemporary(Variable* var) {
- DCHECK(!already_resolved());
+ DCHECK(!already_resolved_);
// Temporaries are only placed in ClosureScopes.
DCHECK_EQ(GetClosureScope(), this);
temps_.Add(var, zone());
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698