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

Issue 2274133002: Add function-var to variables_ so LookupRecursive doesn't need to special-case it (Closed)

Created:
4 years, 4 months ago by Toon Verwaest
Modified:
4 years, 3 months ago
Reviewers:
adamk
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Add function-var to variables_ so LookupRecursive doesn't need to special-case it After parsing a function, if there's no masking declaration in the function scope, DeclareFunctionVar will also bind the function name to a variable. It will either bind it to the const/const-legacy function_ variable, or to a dynamic non-local if the function calls sloppy eval. Even if the variable is masked or sloppy eval is called, we still declare the function-var. The client immediately sets up the variable by assigning the resulting function to it. BUG=v8:5209 Committed: https://crrev.com/65bae443a2ddc1f882e07728fd67cc2178c842b5 Cr-Commit-Position: refs/heads/master@{#39581}

Patch Set 1 #

Patch Set 2 : undo spurious change #

Total comments: 2

Patch Set 3 : rebase #

Patch Set 4 : Drop assignment if the variable is definitely masked #

Patch Set 5 : Only allocate variable in one way #

Patch Set 6 : Update comments #

Total comments: 2

Patch Set 7 : Addressed comments #

Patch Set 8 : Update copyright #

Patch Set 9 : Rebase #

Patch Set 10 : functionvar #

Patch Set 11 : merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -55 lines) Patch
M src/ast/scopes.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -6 lines 0 comments Download
M src/ast/scopes.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +15 lines, -27 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -11 lines 0 comments Download
A + test/mjsunit/function-var.js View 1 2 3 4 5 6 7 1 chunk +11 lines, -11 lines 0 comments Download

Messages

Total messages: 29 (12 generated)
Toon Verwaest
ptal
4 years, 4 months ago (2016-08-24 14:28:10 UTC) #2
adamk
As noted below, I find the new declaration logic harder to understand than the old ...
4 years, 4 months ago (2016-08-24 18:15:49 UTC) #3
adamk
https://codereview.chromium.org/2274133002/diff/20001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2274133002/diff/20001/src/ast/scopes.cc#newcode481 src/ast/scopes.cc:481: function_ = new (zone()) Maybe we should just skip ...
4 years, 4 months ago (2016-08-24 20:22:48 UTC) #4
Toon Verwaest
I was thinking about that approach as well. I'll try it out tomorrow.
4 years, 4 months ago (2016-08-24 20:26:21 UTC) #5
Toon Verwaest
ptal again
4 years, 3 months ago (2016-09-19 12:12:01 UTC) #6
adamk
Can you add a test checking how this interacts with sloppy function hoisting? In particular, ...
4 years, 3 months ago (2016-09-19 18:00:39 UTC) #7
Toon Verwaest
Addressed comments. Nice catch on the Lookup vs LookupLocal!
4 years, 3 months ago (2016-09-20 05:14:36 UTC) #8
adamk
lgtm
4 years, 3 months ago (2016-09-20 16:11:27 UTC) #9
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/2274133002/140001
4 years, 3 months ago (2016-09-20 17:50:37 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_rel_ng/builds/13109) v8_linux_chromium_gn_rel on master.tryserver.v8 (JOB_FAILED, ...
4 years, 3 months ago (2016-09-20 17:53:27 UTC) #13
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/2274133002/160001
4 years, 3 months ago (2016-09-21 08:21:30 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux_gcc_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_gcc_compile_rel/builds/23388) v8_linux_mips64el_compile_rel on master.tryserver.v8 (JOB_FAILED, ...
4 years, 3 months ago (2016-09-21 08:24:17 UTC) #18
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/2274133002/180001
4 years, 3 months ago (2016-09-21 08:32:53 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux_gcc_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_gcc_compile_rel/builds/23389) v8_linux_mips64el_compile_rel on master.tryserver.v8 (JOB_FAILED, ...
4 years, 3 months ago (2016-09-21 08:35:23 UTC) #23
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/2274133002/200001
4 years, 3 months ago (2016-09-21 08:46:52 UTC) #26
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 3 months ago (2016-09-21 09:15:18 UTC) #27
commit-bot: I haz the power
4 years, 3 months ago (2016-09-21 09:15:34 UTC) #29
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/65bae443a2ddc1f882e07728fd67cc2178c842b5
Cr-Commit-Position: refs/heads/master@{#39581}

Powered by Google App Engine
This is Rietveld 408576698