Parsing especially large nested functions takes up more memory than necessary.
authorconradw <conradw@chromium.org>
Thu, 10 Sep 2015 14:40:57 +0000 (07:40 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 10 Sep 2015 14:41:14 +0000 (14:41 +0000)
commit33ec0b79b8ea60dcccf1d445b0cbd2eed8e1a165
tree9e55d025af65cdee0c715128c0997966dca409e9
parentdeb5f524d7e7dd011bc245cb24e83358e22826f8
Parsing especially large nested functions takes up more memory than necessary.
Inner functions must be eagerly parsed for scope analysis, but the full AST is
also kept around even though it's not needed.

This CL mitigates this problem by allocating some AstNodes of the inner function
to a temporary Zone which is deallocated once the scope information has been
built. The remaining nodes (such as VariableProxy) must persist until scope
analysis actually happens, and have to be allocated to a parser-persistent Zone.

BUG=417697
LOG=N

Review URL: https://codereview.chromium.org/1304923004

Cr-Commit-Position: refs/heads/master@{#30685}
src/ast.h
src/parser.cc
test/cctest/test-parsing.cc
test/mjsunit/compiler/lazy-iife-no-parens.js [new file with mode: 0644]