Commit a6ceec24 authored by verwaest's avatar verwaest Committed by Commit bot

Rewind zonelists in scopes when resetting rather than clearing

Clear also frees the memory, which isn't useful in the case of a zonelist. If we later want to use the list (e.g., because of aborting), that will cause additional allocations.

BUG=

Review-Url: https://codereview.chromium.org/2391953002
Cr-Commit-Position: refs/heads/master@{#39948}
parent 22ff09e0
......@@ -1214,8 +1214,8 @@ void DeclarationScope::ResetAfterPreparsing(AstValueFactory* ast_value_factory,
DCHECK(is_function_scope());
// Reset all non-trivial members.
decls_.Clear();
locals_.Clear();
decls_.Rewind(0);
locals_.Rewind(0);
sloppy_block_function_map_.Clear();
variables_.Clear();
// Make sure we won't walk the scope tree from here on.
......@@ -1239,7 +1239,7 @@ void DeclarationScope::ResetAfterPreparsing(AstValueFactory* ast_value_factory,
}
}
} else {
params_.Clear();
params_.Rewind(0);
}
#ifdef DEBUG
......
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