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

Issue 2561093002: [parsing] Fix context allocation for async functions. (Closed)

Created:
4 years ago by neis
Modified:
4 years ago
Reviewers:
Dan Ehrenberg, adamk
CC:
caitp (chromium), v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[parsing] Fix context allocation for async functions. For generator-based functions (e.g. async functions) we force variables to be context-allocated.  Due to a bug in the parser, this didn't always work correctly.  For instance, in "async function foo([a]) { ... }" the variable "a" could become stack-allocated due to context allocation being forced on the wrong scope. Besides fixing this, I'm also cleaning up some related code in the async parsing setup and adding some guards. R=adamk@chromium.org, littledan@chromium.org BUG= Committed: https://crrev.com/80567914c70ab6538bdfa452913a84e929f3cc25 Cr-Commit-Position: refs/heads/master@{#41635}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Turn conditional into DCHECK. #

Total comments: 1

Patch Set 3 : Add comment and rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -44 lines) Patch
M src/parsing/parser.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/parsing/parser.cc View 1 2 8 chunks +27 lines, -39 lines 0 comments Download
M src/parsing/parser-base.h View 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
neis
4 years ago (2016-12-08 11:56:15 UTC) #1
neis
BTW, I can't add any mjsunit tests because nothing goes wrong (at least with my ...
4 years ago (2016-12-08 12:47:34 UTC) #2
adamk
I suspect my questions suggest that Dan is a better reviewer here, but figured I'd ...
4 years ago (2016-12-09 03:12:32 UTC) #3
Dan Ehrenberg
Really nice cleanup and bug fix. I remember trying to merge the two ForceContextAllocation calls ...
4 years ago (2016-12-09 06:02:21 UTC) #4
neis
https://codereview.chromium.org/2561093002/diff/1/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2561093002/diff/1/src/parsing/parser.cc#newcode2511 src/parsing/parser.cc:2511: function_state_->scope()->ForceContextAllocation(); On 2016/12/09 06:02:21, Dan Ehrenberg wrote: > I ...
4 years ago (2016-12-09 10:54:53 UTC) #5
neis
I made one other change, ptal. That conditional didn't make any sense to me.
4 years ago (2016-12-09 11:38:20 UTC) #6
adamk
lgtm, thanks for the explanation(s)
4 years ago (2016-12-09 17:44:34 UTC) #7
Dan Ehrenberg
lgtm https://codereview.chromium.org/2561093002/diff/20001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2561093002/diff/20001/src/parsing/parser.cc#newcode4170 src/parsing/parser.cc:4170: if (function_state_->generator_object_variable() == nullptr) { Could you put ...
4 years ago (2016-12-09 21:51:46 UTC) #8
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/2561093002/40001
4 years ago (2016-12-12 09:32:22 UTC) #11
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-12-12 09:57:23 UTC) #14
commit-bot: I haz the power
4 years ago (2016-12-12 09:57:38 UTC) #16
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/80567914c70ab6538bdfa452913a84e929f3cc25
Cr-Commit-Position: refs/heads/master@{#41635}

Powered by Google App Engine
This is Rietveld 408576698