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

Unified Diff: src/js/promise.js

Issue 2415023002: [promises] Move async debug event creation to c++ (Closed)
Patch Set: rebase Created 4 years, 2 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 | « src/js/async-await.js ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index ce62cf2379ca4c176b6719b26068439e9ad67c21..0cde9320e2c2da25395a7f9d3b19401603625a51 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -185,7 +185,7 @@ function PromiseHandle(value, handler, deferred) {
}
function PromiseEnqueue(value, tasks, deferreds, status) {
- var id, name, beforeDebug, afterDebug, instrumenting = DEBUG_IS_ACTIVE;
+ var id, name, instrumenting = DEBUG_IS_ACTIVE;
if (instrumenting) {
// In an async function, reuse the existing stack related to the outer
@@ -204,14 +204,10 @@ function PromiseEnqueue(value, tasks, deferreds, status) {
} else {
id = PromiseNextMicrotaskID();
name = status === kFulfilled ? "Promise.resolve" : "Promise.reject";
- %DebugAsyncTaskEvent({ type: "enqueue", id: id, name: name });
+ %DebugAsyncTaskEvent("enqueue", id, name);
}
-
- beforeDebug = { type: "willHandle", id: id, name: name };
- afterDebug = { type: "didHandle", id: id, name: name };
}
-
- %EnqueuePromiseReactionJob(value, tasks, deferreds, beforeDebug, afterDebug);
+ %EnqueuePromiseReactionJob(value, tasks, deferreds, id, name);
}
function PromiseAttachCallbacks(promise, deferred, onResolve, onReject) {
@@ -305,33 +301,18 @@ function ResolvePromise(promise, resolution) {
if (IS_CALLABLE(then)) {
var callbacks = CreateResolvingFunctions(promise, false);
- var id, before_debug_event, after_debug_event;
- var instrumenting = DEBUG_IS_ACTIVE;
+ var id, name, instrumenting = DEBUG_IS_ACTIVE;
if (instrumenting) {
if (IsPromise(resolution)) {
// Mark the dependency of the new promise on the resolution
SET_PRIVATE(resolution, promiseHandledBySymbol, promise);
}
id = PromiseNextMicrotaskID();
- before_debug_event = {
- type: "willHandle",
- id: id,
- name: "PromiseResolveThenableJob"
- };
- after_debug_event = {
- type: "didHandle",
- id: id,
- name: "PromiseResolveThenableJob"
- };
- %DebugAsyncTaskEvent({
- type: "enqueue",
- id: id,
- name: "PromiseResolveThenableJob"
- });
+ name = "PromiseResolveThenableJob";
+ %DebugAsyncTaskEvent("enqueue", id, name);
}
%EnqueuePromiseResolveThenableJob(
- resolution, then, callbacks.resolve, callbacks.reject,
- before_debug_event, after_debug_event);
+ resolution, then, callbacks.resolve, callbacks.reject, id, name);
return;
}
}
« no previous file with comments | « src/js/async-await.js ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698