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

Issue 1304923004: When parsing inner functions, try to allocate in a temporary Zone (Closed)

Created:
5 years, 3 months ago by conradw
Modified:
5 years, 3 months ago
CC:
v8-dev, JF, Sven Panne, Michael Hablich
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

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 Committed: https://crrev.com/33ec0b79b8ea60dcccf1d445b0cbd2eed8e1a165 Cr-Commit-Position: refs/heads/master@{#30685}

Patch Set 1 #

Patch Set 2 : fix FunctionExpression oversight, allocate more to temp zone #

Patch Set 3 : Disable temp allocation of the FunctionExpression object until I can work out FunctionNameInferrer #

Total comments: 2

Patch Set 4 : cl feedback #

Total comments: 2

Patch Set 5 : cl feedback 2 #

Patch Set 6 : wrap the temporary zone stuff in its own scope #

Total comments: 2

Patch Set 7 : get terminology less wrong in comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -91 lines) Patch
M src/ast.h View 1 2 3 4 5 6 12 chunks +126 lines, -84 lines 0 comments Download
M src/parser.cc View 1 2 3 4 5 6 1 chunk +36 lines, -2 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 1 chunk +62 lines, -0 lines 0 comments Download
A + test/mjsunit/compiler/lazy-iife-no-parens.js View 1 1 chunk +22 lines, -5 lines 0 comments Download

Messages

Total messages: 17 (7 generated)
conradw
PTAL Of the "worst" allocations mentioned here.. https://code.google.com/p/chromium/issues/detail?id=417697#c14 Allocations that are discarded: NewAssignment, NewNumberLiteral, NewBinaryOperation, ...
5 years, 3 months ago (2015-09-09 12:39:44 UTC) #3
titzer
https://codereview.chromium.org/1304923004/diff/60001/src/ast.h File src/ast.h (right): https://codereview.chromium.org/1304923004/diff/60001/src/ast.h#newcode3280 src/ast.h:3280: : zone_(ast_value_factory->zone()), Can we rename this zone to be ...
5 years, 3 months ago (2015-09-09 19:48:16 UTC) #4
conradw
https://codereview.chromium.org/1304923004/diff/60001/src/ast.h File src/ast.h (right): https://codereview.chromium.org/1304923004/diff/60001/src/ast.h#newcode3280 src/ast.h:3280: : zone_(ast_value_factory->zone()), On 2015/09/09 19:48:16, titzer wrote: > Can ...
5 years, 3 months ago (2015-09-10 11:17:29 UTC) #6
Michael Starzinger
Looking good, just one suggestion. https://codereview.chromium.org/1304923004/diff/100001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1304923004/diff/100001/src/parser.cc#newcode4241 src/parser.cc:4241: factory()->set_zone(outer_zone); Suggestion as discsussed ...
5 years, 3 months ago (2015-09-10 12:16:54 UTC) #7
conradw
https://codereview.chromium.org/1304923004/diff/100001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1304923004/diff/100001/src/parser.cc#newcode4241 src/parser.cc:4241: factory()->set_zone(outer_zone); On 2015/09/10 12:16:54, Michael Starzinger wrote: > Suggestion ...
5 years, 3 months ago (2015-09-10 13:12:40 UTC) #10
Michael Starzinger
LGTM from my end. https://codereview.chromium.org/1304923004/diff/180001/src/ast.h File src/ast.h (right): https://codereview.chromium.org/1304923004/diff/180001/src/ast.h#newcode3696 src/ast.h:3696: // HeapObjects which need to ...
5 years, 3 months ago (2015-09-10 14:06:36 UTC) #11
conradw
https://codereview.chromium.org/1304923004/diff/180001/src/ast.h File src/ast.h (right): https://codereview.chromium.org/1304923004/diff/180001/src/ast.h#newcode3696 src/ast.h:3696: // HeapObjects which need to persist until scope analysis ...
5 years, 3 months ago (2015-09-10 14:15:56 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1304923004/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1304923004/200001
5 years, 3 months ago (2015-09-10 14:39:16 UTC) #15
commit-bot: I haz the power
Committed patchset #7 (id:200001)
5 years, 3 months ago (2015-09-10 14:41:03 UTC) #16
commit-bot: I haz the power
5 years, 3 months ago (2015-09-10 14:41:26 UTC) #17
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/33ec0b79b8ea60dcccf1d445b0cbd2eed8e1a165
Cr-Commit-Position: refs/heads/master@{#30685}

Powered by Google App Engine
This is Rietveld 408576698