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

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

Issue 2581503003: [promisehook] Store promise in PromiseReactionJob (Closed)
Patch Set: rebase correctly Created 4 years 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
Index: src/runtime/runtime-promise.cc
diff --git a/src/runtime/runtime-promise.cc b/src/runtime/runtime-promise.cc
index a8a84eb00e81bbc3bb729fc182a29eedb0613041..f609df73fd6e7864266e54e640291a14ecefaca2 100644
--- a/src/runtime/runtime-promise.cc
+++ b/src/runtime/runtime-promise.cc
@@ -57,9 +57,9 @@ RUNTIME_FUNCTION(Runtime_PromiseRevokeReject) {
}
namespace {
-void EnqueuePromiseReactionJob(Isolate* isolate, Handle<Object> value,
- Handle<Object> tasks, Handle<Object> deferred,
- Handle<Object> status) {
+void EnqueuePromiseReactionJob(Isolate* isolate, Handle<JSPromise> promise,
+ Handle<Object> value, Handle<Object> tasks,
+ Handle<Object> deferred, Handle<Object> status) {
Handle<Object> debug_id = isolate->factory()->undefined_value();
Handle<Object> debug_name = isolate->factory()->undefined_value();
if (isolate->debug()->is_active()) {
@@ -87,9 +87,9 @@ void EnqueuePromiseReactionJob(Isolate* isolate, Handle<Object> value,
}
}
Handle<PromiseReactionJobInfo> info =
- isolate->factory()->NewPromiseReactionJobInfo(value, tasks, deferred,
- debug_id, debug_name,
- isolate->native_context());
+ isolate->factory()->NewPromiseReactionJobInfo(
+ promise, value, tasks, deferred, debug_id, debug_name,
+ isolate->native_context());
isolate->EnqueueMicrotask(info);
}
@@ -111,7 +111,7 @@ void PromiseFulfill(Isolate* isolate, Handle<JSPromise> promise,
: promise->reject_reactions(),
isolate);
Handle<Object> deferred(promise->deferred(), isolate);
- EnqueuePromiseReactionJob(isolate, value, tasks, deferred, status);
+ EnqueuePromiseReactionJob(isolate, promise, value, tasks, deferred, status);
}
PromiseSet(isolate, promise, status->value(), value);
@@ -145,12 +145,13 @@ RUNTIME_FUNCTION(Runtime_PromiseFulfill) {
RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) {
HandleScope scope(isolate);
- DCHECK(args.length() == 4);
- CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
- CONVERT_ARG_HANDLE_CHECKED(Object, tasks, 1);
- CONVERT_ARG_HANDLE_CHECKED(Object, deferred, 2);
- CONVERT_ARG_HANDLE_CHECKED(Object, status, 3);
- EnqueuePromiseReactionJob(isolate, value, tasks, deferred, status);
+ DCHECK(args.length() == 5);
+ CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
+ CONVERT_ARG_HANDLE_CHECKED(Object, tasks, 2);
+ CONVERT_ARG_HANDLE_CHECKED(Object, deferred, 3);
+ CONVERT_ARG_HANDLE_CHECKED(Object, status, 4);
+ EnqueuePromiseReactionJob(isolate, promise, value, tasks, deferred, status);
return isolate->heap()->undefined_value();
}

Powered by Google App Engine
This is Rietveld 408576698