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

Unified Diff: src/ast/scopes.cc

Issue 2244233003: Simplify num_heap_slots_ calculation of deserialized scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add dcheck 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 1330f79b28d4d9373fbba2df76a9a95eea04424e..98a6bfa413d16e18c997d7f28a536a7e0bbbc011 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -132,15 +132,15 @@ Scope::Scope(Zone* zone, Scope* inner_scope, ScopeType scope_type,
SetDefaults();
if (scope_type == WITH_SCOPE) {
DCHECK(scope_info.is_null());
+ // Ensure at least MIN_CONTEXT_SLOTS to indicate a materialized context.
+ num_heap_slots_ = Context::MIN_CONTEXT_SLOTS;
} else {
scope_calls_eval_ = scope_info->CallsEval();
language_mode_ = scope_info->language_mode();
num_heap_slots_ = scope_info->ContextLength();
+ DCHECK_LE(Context::MIN_CONTEXT_SLOTS, num_heap_slots_);
}
- // Ensure at least MIN_CONTEXT_SLOTS to indicate a materialized context.
- num_heap_slots_ = Max(num_heap_slots_,
- static_cast<int>(Context::MIN_CONTEXT_SLOTS));
if (inner_scope != nullptr) AddInnerScope(inner_scope);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698