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

Unified Diff: src/builtins/builtins-promise.cc

Issue 2578923002: [inspector] async stacks for Promise.then calls... (Closed)
Patch Set: avoid calling functions Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug/debug.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-promise.cc
diff --git a/src/builtins/builtins-promise.cc b/src/builtins/builtins-promise.cc
index e6034e7b6bf70299450ad972a518583b8f2b2557..345625d6d098d09eeb7686658803da7bdbcfa046 100644
--- a/src/builtins/builtins-promise.cc
+++ b/src/builtins/builtins-promise.cc
@@ -794,10 +794,9 @@ void PromiseBuiltinsAssembler::InternalResolvePromise(Node* context,
Label enqueue(this);
GotoUnless(IsDebugActive(), &enqueue);
- Node* const debug_id = CallRuntime(Runtime::kDebugNextMicrotaskId, context);
+ Node* const debug_id =
+ CallRuntime(Runtime::kDebugNextAsyncTaskId, context, promise);
Node* const debug_name = SmiConstant(kDebugPromiseResolveThenableJob);
- CallRuntime(Runtime::kDebugAsyncTaskEvent, context,
- SmiConstant(kDebugEnqueue), debug_id, debug_name);
StoreObjectField(info, PromiseResolveThenableJobInfo::kDebugIdOffset,
debug_id);
@@ -855,13 +854,13 @@ void PromiseBuiltinsAssembler::InternalResolvePromise(Node* context,
void PromiseBuiltinsAssembler::PromiseFulfill(
Node* context, Node* promise, Node* result,
v8::Promise::PromiseState status) {
- Label do_promisereset(this);
+ Label do_promisereset(this), debug_async_event_enqueue_recurring(this);
Node* const status_smi = SmiConstant(static_cast<int>(status));
Node* const deferred_promise =
LoadObjectField(promise, JSPromise::kDeferredPromiseOffset);
- GotoIf(IsUndefined(deferred_promise), &do_promisereset);
+ GotoIf(IsUndefined(deferred_promise), &debug_async_event_enqueue_recurring);
Node* const tasks =
status == v8::Promise::kFulfilled
@@ -876,8 +875,17 @@ void PromiseBuiltinsAssembler::PromiseFulfill(
Node* const info = AllocatePromiseReactionJobInfo(
promise, result, tasks, deferred_promise, deferred_on_resolve,
deferred_on_reject, context);
+
CallRuntime(Runtime::kEnqueuePromiseReactionJob, context, info, status_smi);
- Goto(&do_promisereset);
+ Goto(&debug_async_event_enqueue_recurring);
+
+ Bind(&debug_async_event_enqueue_recurring);
+ {
+ GotoUnless(IsDebugActive(), &do_promisereset);
+ CallRuntime(Runtime::kDebugAsyncEventEnqueueRecurring, context, promise,
+ status_smi);
+ Goto(&do_promisereset);
+ }
Bind(&do_promisereset);
{
« no previous file with comments | « no previous file | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698