Commit 35fc3d58 authored by verwaest's avatar verwaest Committed by Commit bot

Don't count nested function scopes towards MaxNestedContextChainlength

This is allocating registers in the function for all inner contexts that can be active in that function, so that nested blocks always have O(1) access to all outer contexts. However, currently it's always walking into nested functions, overallocating the number of registers, causing additional register pressure.

BUG=v8:5484

Review-Url: https://codereview.chromium.org/2408303003
Cr-Commit-Position: refs/heads/master@{#40214}
parent 10ffd2b1
......@@ -1153,6 +1153,7 @@ int Scope::ContextChainLengthUntilOutermostSloppyEval() const {
int Scope::MaxNestedContextChainLength() {
int max_context_chain_length = 0;
for (Scope* scope = inner_scope_; scope != nullptr; scope = scope->sibling_) {
if (scope->is_function_scope()) continue;
max_context_chain_length = std::max(scope->MaxNestedContextChainLength(),
max_context_chain_length);
}
......
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