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

Issue 2578923002: [inspector] async stacks for Promise.then calls... (Closed)

Created:
4 years ago by kozy
Modified:
3 years, 11 months ago
Reviewers:
dgozman, Yang, gsathya
CC:
v8-reviews_googlegroups.com, Yang, devtools-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[inspector] async stacks for Promise.then calls... ... which were done after the promise has been resolved. Goal of this CL - change promise instrumentation to support better callbacks, chained after promise resolution and prepare instrumentation for adding new asyncTaskCreated instrumentation. Instrumentation changes: - asyncTaskScheduled(recurring) when promise is fulfilled or rejected, - asyncTaskCancelled when promise is collected (since [1] we can be sure that promise will survive scheduled microtasks). Minor changes: - async task type in inspector <-> debugger API transferred by enum instead of string, - Debug manages async task ids based on promise objects. More details: https://docs.google.com/document/d/1u19N45f1gSF7M39mGsycJEK3IPyJgIXCBnWyiPeuJFE [1] https://codereview.chromium.org/2581503003/ BUG=chromium:632829, v8:5738 R=dgozman@chromium.org,yangguo@chromium.org,gsathya@chromium.org Review-Url: https://codereview.chromium.org/2578923002 Cr-Commit-Position: refs/heads/master@{#42178} Committed: https://chromium.googlesource.com/v8/v8/+/754736d26c07454de8eace0b774a1ab13bf2c764

Patch Set 1 : tests without patch #

Patch Set 2 : CL #

Patch Set 3 : fixed test #

Patch Set 4 : added missing handle scope #

Total comments: 2

Patch Set 5 : use set_private instead of weak map #

Total comments: 6

Patch Set 6 : addressed comments #

Patch Set 7 : rebased #

Patch Set 8 : rebased.. #

Patch Set 9 : async-stacks #

Total comments: 12

Patch Set 10 : addressed comments #

Patch Set 11 : rebased #

Patch Set 12 : avoid calling functions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+874 lines, -106 lines) Patch
M src/builtins/builtins-promise.cc View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -6 lines 0 comments Download
M src/debug/debug.h View 1 2 3 4 5 6 7 5 chunks +7 lines, -9 lines 0 comments Download
M src/debug/debug.cc View 1 2 3 4 5 6 7 8 9 2 chunks +58 lines, -1 line 0 comments Download
M src/debug/debug.js View 1 2 3 4 5 6 7 1 chunk +2 lines, -11 lines 0 comments Download
M src/debug/interface-types.h View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M src/heap-symbols.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/inspector/v8-debugger.h View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/inspector/v8-debugger.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +40 lines, -32 lines 0 comments Download
M src/isolate.h View 1 2 3 4 5 6 7 2 chunks +0 lines, -2 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M src/js/async-await.js View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -14 lines 0 comments Download
M src/js/macros.py View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -8 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -3 lines 0 comments Download
M src/runtime/runtime-debug.cc View 1 2 3 4 5 6 7 1 chunk +30 lines, -11 lines 0 comments Download
M src/runtime/runtime-promise.cc View 1 2 3 4 5 6 7 8 9 3 chunks +11 lines, -4 lines 0 comments Download
A test/inspector/debugger/async-instrumentation.js View 1 2 3 4 5 6 7 8 9 1 chunk +68 lines, -0 lines 0 comments Download
A test/inspector/debugger/async-instrumentation-expected.txt View 1 chunk +43 lines, -0 lines 0 comments Download
A test/inspector/debugger/async-promise-late-then.js View 1 2 3 4 5 1 chunk +48 lines, -0 lines 0 comments Download
A test/inspector/debugger/async-promise-late-then-expected.txt View 1 1 chunk +16 lines, -0 lines 0 comments Download
A test/inspector/debugger/async-stack-await.js View 1 2 3 4 5 1 chunk +46 lines, -0 lines 0 comments Download
A test/inspector/debugger/async-stack-await-expected.txt View 1 1 chunk +42 lines, -0 lines 0 comments Download
A test/inspector/debugger/async-stack-for-promise.js View 1 2 3 4 5 6 7 1 chunk +265 lines, -0 lines 0 comments Download
A test/inspector/debugger/async-stack-for-promise-expected.txt View 1 2 3 4 5 6 7 1 chunk +155 lines, -0 lines 0 comments Download
M test/inspector/runtime/await-promise-expected.txt View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 86 (64 generated)
kozy
Please take a look. You can use codereview two compare test expectations with patch and ...
4 years ago (2016-12-15 23:43:59 UTC) #6
dgozman
Tests and expectations looks good!
4 years ago (2016-12-16 00:02:47 UTC) #8
Yang
https://codereview.chromium.org/2578923002/diff/120001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2578923002/diff/120001/src/debug/debug.cc#newcode1822 src/debug/debug.cc:1822: Handle<JSWeakMap> map = thread_local_.async_task_ids_; How about storing this id ...
4 years ago (2016-12-16 13:39:33 UTC) #27
kozy
all done, please take another look. https://codereview.chromium.org/2578923002/diff/120001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2578923002/diff/120001/src/debug/debug.cc#newcode1822 src/debug/debug.cc:1822: Handle<JSWeakMap> map = ...
4 years ago (2016-12-16 15:29:35 UTC) #28
gsathya
https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc#newcode1813 src/debug/debug.cc:1813: Handle<Object> Debug::NextAsyncTaskId(Handle<JSObject> promise) { Can this be a non ...
4 years ago (2016-12-16 15:37:11 UTC) #29
kozy
On 2016/12/16 15:37:11, gsathya wrote: > https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc > File src/debug/debug.cc (right): > > https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc#newcode1813 > ...
4 years ago (2016-12-16 15:42:15 UTC) #30
kozy
https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc#newcode1813 src/debug/debug.cc:1813: Handle<Object> Debug::NextAsyncTaskId(Handle<JSObject> promise) { On 2016/12/16 15:37:11, gsathya wrote: ...
4 years ago (2016-12-16 16:29:26 UTC) #33
gsathya
On 2016/12/16 16:29:26, kozyatinskiy wrote: > https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc > File src/debug/debug.cc (right): > > https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc#newcode1813 > ...
4 years ago (2016-12-16 16:48:36 UTC) #36
kozy
On 2016/12/16 16:48:36, gsathya wrote: > Ah sorry I thought this was just a single ...
4 years ago (2016-12-16 17:02:42 UTC) #40
Yang
I think either is ok. I dont think using a internal field will significantly grow ...
4 years ago (2016-12-16 17:10:26 UTC) #41
Yang
You know, we could actually store the stack directly on the promise instead of the ...
4 years ago (2016-12-16 17:12:28 UTC) #42
kozy
On 2016/12/16 17:12:28, Yang wrote: > You know, we could actually store the stack directly ...
4 years ago (2016-12-16 17:19:31 UTC) #43
gsathya
On 2016/12/16 17:19:31, kozyatinskiy wrote: > On 2016/12/16 17:12:28, Yang wrote: > > You know, ...
4 years ago (2016-12-16 17:26:28 UTC) #44
kozy
all done. https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2578923002/diff/140001/src/debug/debug.cc#newcode1800 src/debug/debug.cc:1800: data->debug->OnAsyncTaskEvent(debug::Cancel, On 2016/12/16 17:10:26, Yang wrote: > ...
4 years ago (2016-12-16 17:47:15 UTC) #49
kozy
Dmitry, please take a look.
4 years ago (2016-12-18 18:10:29 UTC) #56
kozy
Rebased and ready for review again. Dmitry, please take a look. One minor improvement in ...
3 years, 11 months ago (2017-01-09 19:01:45 UTC) #65
gsathya
https://codereview.chromium.org/2578923002/diff/230001/src/runtime/runtime-promise.cc File src/runtime/runtime-promise.cc (right): https://codereview.chromium.org/2578923002/diff/230001/src/runtime/runtime-promise.cc#newcode113 src/runtime/runtime-promise.cc:113: void SetDebugInfo(Isolate* isolate, Handle<PromiseReactionJobInfo> info, info->promise() == promise right? ...
3 years, 11 months ago (2017-01-09 19:24:35 UTC) #68
dgozman
Promises lgtm! Do we have to rebase some blink tests? Not sure whether async/await stacks ...
3 years, 11 months ago (2017-01-09 22:59:30 UTC) #71
kozy
https://codereview.chromium.org/2578923002/diff/230001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2578923002/diff/230001/src/debug/debug.cc#newcode1784 src/debug/debug.cc:1784: Object** location; On 2017/01/09 22:59:30, dgozman wrote: > Does ...
3 years, 11 months ago (2017-01-10 00:11:38 UTC) #74
kozy
On 2017/01/09 22:59:30, dgozman wrote: > Promises lgtm! Do we have to rebase some blink ...
3 years, 11 months ago (2017-01-10 00:12:53 UTC) #75
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/2578923002/290001
3 years, 11 months ago (2017-01-10 12:35:37 UTC) #83
commit-bot: I haz the power
3 years, 11 months ago (2017-01-10 12:54:19 UTC) #86
Message was sent while issue was closed.
Committed patchset #12 (id:290001) as
https://chromium.googlesource.com/v8/v8/+/754736d26c07454de8eace0b774a1ab13bf...

Powered by Google App Engine
This is Rietveld 408576698