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

Issue 2655623005: [parser] Skipping inner funcs: add info about variables. (Closed)

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

Description

[parser] Skipping inner funcs: add info about variables. - Declaring a variable called "this" for preparsed functions was unnecessary; DeclarationScope ctor already adds the variable. - "arguments" for preparsed scopes need to be declared after parsing the function, like it's done in the parser. - Now arguments_ can be the dummy variable, so adapted code to it. - A previous refactoring CL ( https://codereview.chromium.org/2638333002 ) was incomplete; it had added ParserBase::ParseFunctionBody but PreParser::ParseFunction didn't call it. This CL completes that work. This is needed for getting "arguments" declared properly for preparsed functions. - AllocateVariablesRecursively is already called for preparsed scopes (without this CL, that is), and it bails out early. However, before the bailout it used to dcheck num_stack_slots_ == 0; that is no longer true since we've done scope analysis for preparsed scopes. - Test fix: we cannot have any lazy inner functions in the test, except the topmost lazy inner function. Such functions would also be lazy in the parser case, and the parser would just throw away their variables. Then the test tries to verify the preparsed data against the scopes without variables and fails. - Disabled a test w/ a sloppy block function, will get that working again in the upcoming CLs. BUG=v8:5516 Review-Url: https://codereview.chromium.org/2655623005 Cr-Commit-Position: refs/heads/master@{#42685} Committed: https://chromium.googlesource.com/v8/v8/+/d4507a6cf9ca4312d0f0b143f7ef5f6c7802ac29

Patch Set 1 #

Patch Set 2 : alt fix #

Total comments: 4

Patch Set 3 : create variables only when the flag is on #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -23 lines) Patch
M src/ast/scopes.cc View 1 2 6 chunks +23 lines, -6 lines 0 comments Download
M src/parsing/preparsed-scope-data.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/parsing/preparsed-scope-data.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/parsing/preparser.cc View 4 chunks +14 lines, -12 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 3 chunks +18 lines, -3 lines 2 comments Download

Messages

Total messages: 25 (14 generated)
marja
ptal
3 years, 11 months ago (2017-01-25 16:26:08 UTC) #6
jochen (gone - plz use gerrit)
have you considered landing all the items from the CL description as individual patches? also, ...
3 years, 11 months ago (2017-01-25 16:34:15 UTC) #8
marja
All these changes are needed to get even the simplest test to pass; I could ...
3 years, 11 months ago (2017-01-25 17:10:44 UTC) #11
jochen (gone - plz use gerrit)
no flags gives you more coverage, so lgtm
3 years, 11 months ago (2017-01-25 17:20:55 UTC) #13
adamk
On 2017/01/25 17:20:55, jochen (travelling til Feb 4) wrote: > no flags gives you more ...
3 years, 11 months ago (2017-01-25 18:34:25 UTC) #14
jochen (gone - plz use gerrit)
my concern was that the new code might have a perf hit, and I thought ...
3 years, 11 months ago (2017-01-25 19:06:42 UTC) #15
marja
If I go for the solution of not putting the DeclareLocal behind the flag, then ...
3 years, 11 months ago (2017-01-25 20:42:23 UTC) #16
vogelheim
lgtm, but please look at the test comment. Not sure if bug or if I ...
3 years, 11 months ago (2017-01-26 09:34:35 UTC) #18
marja
thanks for reviewing! https://codereview.chromium.org/2655623005/diff/20001/test/cctest/test-parsing.cc File test/cctest/test-parsing.cc (left): https://codereview.chromium.org/2655623005/diff/20001/test/cctest/test-parsing.cc#oldcode9025 test/cctest/test-parsing.cc:9025: {"", "if (true) { function f1() ...
3 years, 11 months ago (2017-01-26 09:41:00 UTC) #19
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/2655623005/40001
3 years, 11 months ago (2017-01-26 09:41:12 UTC) #22
commit-bot: I haz the power
3 years, 11 months ago (2017-01-26 10:14:47 UTC) #25
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/v8/v8/+/d4507a6cf9ca4312d0f0b143f7ef5f6c780...

Powered by Google App Engine
This is Rietveld 408576698