Commit 4be63d6d authored by verwaest's avatar verwaest Committed by Commit bot

Simplify num_heap_slots_ calculation of deserialized scopes

BUG=v8:5209

Review-Url: https://codereview.chromium.org/2244233003
Cr-Commit-Position: refs/heads/master@{#38661}
parent 998f7797
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment