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

Issue 2481163002: Assign unique IDs to FunctionLiterals (Closed)

Created:
4 years, 1 month ago by jochen (gone - plz use gerrit)
Modified:
4 years ago
Reviewers:
Toon Verwaest, marja
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Assign unique IDs to FunctionLiterals They're supposed to be stable across several parse passes, so we'll also store them in the associated SharedFunctionInfos To achieve this, the PreParser and Parser need to generated the same number of FunctionLiterals. To achieve this, we teach the PreParser about desuggaring of class literals. For regular functions, the function IDs are assigned in the order they occur in the source. For arrow functions, however, we only know that it's an arrow function after parsing the parameter list, and so the ID assigned to the arrow function is larger than the IDs assigned to functions defined in the parameter list. This implies that we have to reset the function ID counter to before the parameter list when re-parsing an arrow function. To be able to do this, we store the number of function literals found in the parameter list of arrow functions as well. BUG=v8:5589 Committed: https://crrev.com/cfebe6034c39562681c11e8381448f4934972429 Cr-Commit-Position: refs/heads/master@{#41309}

Patch Set 1 #

Patch Set 2 : updates #

Patch Set 3 : updates #

Patch Set 4 : updates #

Patch Set 5 : updates #

Patch Set 6 : updates #

Patch Set 7 : updates #

Patch Set 8 : updates #

Total comments: 11

Patch Set 9 : updates #

Patch Set 10 : updates #

Patch Set 11 : updates #

Patch Set 12 : updates #

Total comments: 7

Patch Set 13 : updates #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -48 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M src/ast/ast.h View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +15 lines, -5 lines 0 comments Download
A src/ast/ast-function-literal-id-reindexer.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +36 lines, -0 lines 0 comments Download
A src/ast/ast-function-literal-id-reindexer.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +28 lines, -0 lines 0 comments Download
M src/compiler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M src/compiler-dispatcher/compiler-dispatcher-job.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +11 lines, -3 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M src/parsing/parse-info.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -0 lines 0 comments Download
M src/parsing/parse-info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M src/parsing/parser.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +4 lines, -0 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 12 chunks +38 lines, -5 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 3 4 5 6 7 8 9 10 11 12 16 chunks +46 lines, -23 lines 1 comment Download
M src/parsing/preparse-data.h View 1 2 3 4 5 6 4 chunks +8 lines, -4 lines 0 comments Download
M src/parsing/preparse-data.cc View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M src/parsing/preparse-data-format.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M src/parsing/preparser.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +18 lines, -2 lines 0 comments Download
M src/parsing/preparser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +10 lines, -4 lines 0 comments Download
M src/runtime/runtime-function.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M src/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 51 (36 generated)
jochen (gone - plz use gerrit)
ptal
4 years, 1 month ago (2016-11-18 09:20:08 UTC) #12
marja
Initial set of comments; however I'll need to look at this closer to understand this... ...
4 years, 1 month ago (2016-11-18 10:48:04 UTC) #15
marja
Ahh, I just realized you cannot do the id getting in the arrow branch because ...
4 years, 1 month ago (2016-11-18 10:51:10 UTC) #16
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2481163002/diff/140001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2481163002/diff/140001/src/ast/ast.h#newcode3491 src/ast/ast.h:3491: FunctionLiteral::kShouldLazyCompile, 0, false, true, 0); On 2016/11/18 at 10:48:04, ...
4 years ago (2016-11-21 08:03:47 UTC) #22
Toon Verwaest
We really should't be storing 2 smis in the SharedFunctionInfos, that's pretty expensive memory-wise. SFI ...
4 years ago (2016-11-21 14:41:43 UTC) #28
jochen (gone - plz use gerrit)
I did option 3) ptal
4 years ago (2016-11-23 14:40:04 UTC) #31
marja
lgtm, but pls wait for verwaest@'s review. https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.cc File src/parsing/preparser.cc (right): https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.cc#newcode95 src/parsing/preparser.cc:95: ResetFunctionLiteralId(); Had ...
4 years ago (2016-11-25 13:14:56 UTC) #36
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.cc File src/parsing/preparser.cc (right): https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.cc#newcode95 src/parsing/preparser.cc:95: ResetFunctionLiteralId(); On 2016/11/25 at 13:14:56, marja wrote: > Had ...
4 years ago (2016-11-28 08:12:08 UTC) #37
marja
still lgtm (I was confused about what DeclareClassProperty does, esp the preparser version...)
4 years ago (2016-11-28 09:10:54 UTC) #42
Toon Verwaest
https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.h File src/parsing/preparser.h (right): https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.h#newcode1105 src/parsing/preparser.h:1105: if (has_default_constructor) GetNextFunctionLiteralId(); Do we really need an ID ...
4 years ago (2016-11-28 11:12:34 UTC) #43
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.h File src/parsing/preparser.h (right): https://codereview.chromium.org/2481163002/diff/220001/src/parsing/preparser.h#newcode1105 src/parsing/preparser.h:1105: if (has_default_constructor) GetNextFunctionLiteralId(); On 2016/11/28 at 11:12:33, Toon Verwaest ...
4 years ago (2016-11-28 11:26:50 UTC) #44
Toon Verwaest
Ok then, let's keep it like this for now. That's quite broken though... lgtm
4 years ago (2016-11-28 11:37:58 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2481163002/240001
4 years ago (2016-11-28 11:38:28 UTC) #47
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years ago (2016-11-28 11:40:27 UTC) #49
commit-bot: I haz the power
4 years ago (2016-11-28 11:40:59 UTC) #51
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/cfebe6034c39562681c11e8381448f4934972429
Cr-Commit-Position: refs/heads/master@{#41309}

Powered by Google App Engine
This is Rietveld 408576698