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

Issue 2276243002: Mark await expressions as caught or uncaught (Closed)

Created:
4 years, 3 months ago by Dan Ehrenberg
Modified:
4 years, 3 months ago
Reviewers:
kozy, adamk, jgruber
CC:
caitp, Michael Starzinger, neis, v8-reviews_googlegroups.com, Yang
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Mark await expressions as caught or uncaught Handle some examples of the "asynchronous case" by marking await expressions as either caught or uncaught; in the caught case, this marks the Promise passed in as having a catch predicted. The marking is done in AST numbering, which chooses between two different runtime function calls based on catch prediction. BUG=v8:5167 Committed: https://crrev.com/edb4d3151ce963c531327bd2345008b2e108913d Cr-Commit-Position: refs/heads/master@{#39394}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Fix it through logic #

Patch Set 4 : Rebase #

Patch Set 5 : Rebase bette #

Patch Set 6 : Format #

Total comments: 18

Patch Set 7 : Clean up tests #

Total comments: 11

Patch Set 8 : Just the parts for the catch prediction #

Patch Set 9 : Fix broken test #

Total comments: 15

Patch Set 10 : cleanups and comments from code review #

Total comments: 2

Patch Set 11 : rebase #

Total comments: 7

Patch Set 12 : Add a test #

Patch Set 13 : Revert "Tests for caught exception" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -32 lines) Patch
M src/ast/ast.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +14 lines, -0 lines 0 comments Download
M src/ast/ast-numbering.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +21 lines, -0 lines 0 comments Download
M src/ast/prettyprinter.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M src/contexts.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -1 line 0 comments Download
M src/heap-symbols.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/isolate.h View 1 2 3 4 5 6 7 11 1 chunk +3 lines, -1 line 0 comments Download
M src/isolate.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M src/js/harmony-async-await.js View 1 2 3 4 5 6 7 8 9 1 chunk +56 lines, -7 lines 0 comments Download
M src/js/prologue.js View 1 2 3 4 4 chunks +5 lines, -1 line 0 comments Download
M src/js/promise.js View 1 2 3 4 5 6 7 8 9 6 chunks +21 lines, -16 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -2 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -4 lines 0 comments Download

Messages

Total messages: 82 (62 generated)
Dan Ehrenberg
4 years, 3 months ago (2016-09-08 01:11:59 UTC) #24
jgruber
+mstarzinger for ast-numbering changes. Looking good. Would it perhaps be possible to split the two ...
4 years, 3 months ago (2016-09-08 10:19:59 UTC) #32
adamk
Still having trouble paging all this back into my head so I'm going to mostly ...
4 years, 3 months ago (2016-09-08 18:58:36 UTC) #37
Dan Ehrenberg
To answer the question of why the caught/uncaught marking happens in ast-numbering: This is when ...
4 years, 3 months ago (2016-09-08 20:13:15 UTC) #38
Dan Ehrenberg
I split out this patch into two; the other one is at https://codereview.chromium.org/2325813002 https://codereview.chromium.org/2276243002/diff/100001/src/js/harmony-async-await.js File ...
4 years, 3 months ago (2016-09-08 22:34:05 UTC) #40
adamk
This is looking good, but I'd find the logic a lot easier to understand with ...
4 years, 3 months ago (2016-09-09 18:46:29 UTC) #49
Dan Ehrenberg
https://codereview.chromium.org/2276243002/diff/160001/src/ast/ast-numbering.cc File src/ast/ast-numbering.cc (right): https://codereview.chromium.org/2276243002/diff/160001/src/ast/ast-numbering.cc#newcode259 src/ast/ast-numbering.cc:259: // try { await fn(); } finally { } ...
4 years, 3 months ago (2016-09-10 01:54:14 UTC) #51
jgruber
Thanks for splitting this out, it's much more readable now. Could you still add relevant ...
4 years, 3 months ago (2016-09-12 09:29:00 UTC) #59
jgruber
https://codereview.chromium.org/2276243002/diff/200001/src/ast/ast-numbering.cc File src/ast/ast-numbering.cc (right): https://codereview.chromium.org/2276243002/diff/200001/src/ast/ast-numbering.cc#newcode271 src/ast/ast-numbering.cc:271: node->set_context_index(Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); On 2016/09/12 09:29:00, jgruber wrote: > This still ...
4 years, 3 months ago (2016-09-12 12:22:27 UTC) #60
Dan Ehrenberg
Tests are added in the two follow-on patches. https://codereview.chromium.org/2276243002/diff/200001/src/ast/ast-numbering.cc File src/ast/ast-numbering.cc (right): https://codereview.chromium.org/2276243002/diff/200001/src/ast/ast-numbering.cc#newcode271 src/ast/ast-numbering.cc:271: node->set_context_index(Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); ...
4 years, 3 months ago (2016-09-12 14:07:46 UTC) #61
adamk
Thanks, the comments are helpful, one more question below. As for the ast-numbering thing: given ...
4 years, 3 months ago (2016-09-12 15:58:25 UTC) #62
kozy
lgtm for marking logic from DevTools point of view. Could you add a test?
4 years, 3 months ago (2016-09-12 17:14:45 UTC) #63
Dan Ehrenberg
On 2016/09/12 at 12:22:27, jgruber wrote: > https://codereview.chromium.org/2276243002/diff/200001/src/ast/ast-numbering.cc > File src/ast/ast-numbering.cc (right): > > https://codereview.chromium.org/2276243002/diff/200001/src/ast/ast-numbering.cc#newcode271 ...
4 years, 3 months ago (2016-09-12 22:10:46 UTC) #68
Dan Ehrenberg
Working on a test (though the one that's uploaded fails). It's a bit funny to ...
4 years, 3 months ago (2016-09-12 22:11:50 UTC) #69
Dan Ehrenberg
I don't think there's a good way to observe the caught exception with just this ...
4 years, 3 months ago (2016-09-12 23:51:21 UTC) #72
kozy
On 2016/09/12 23:51:21, Dan Ehrenberg wrote: > I don't think there's a good way to ...
4 years, 3 months ago (2016-09-13 20:46:16 UTC) #75
adamk
lgtm from my end
4 years, 3 months ago (2016-09-13 20:47:05 UTC) #76
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/2276243002/240001
4 years, 3 months ago (2016-09-13 20:47:35 UTC) #79
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 3 months ago (2016-09-13 20:50:02 UTC) #80
commit-bot: I haz the power
4 years, 3 months ago (2016-09-13 20:51:15 UTC) #82
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/edb4d3151ce963c531327bd2345008b2e108913d
Cr-Commit-Position: refs/heads/master@{#39394}

Powered by Google App Engine
This is Rietveld 408576698