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

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

Issue 2431793003: [promises] move PromiseResolveThenableJob debugging code to runtime function (Closed)
Patch Set: 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/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index 4e4de3d74fc74f598bae99568ad8a9d90ef44551..5fa42f1d5e5b32faedcdd0181fd30efbc5648cb0 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -589,13 +589,24 @@ RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) {
RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) {
HandleScope scope(isolate);
- DCHECK(args.length() == 6);
+ DCHECK(args.length() == 4);
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0);
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 1);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3);
- CONVERT_ARG_HANDLE_CHECKED(Object, debug_id, 4);
- CONVERT_ARG_HANDLE_CHECKED(Object, debug_name, 5);
+ Handle<Object> debug_id;
+ Handle<Object> debug_name;
+ if (isolate->debug()->is_active()) {
+ debug_id =
+ handle(Smi::FromInt(isolate->GetNextDebugMicrotaskId()), isolate);
+ debug_name = isolate->factory()->PromiseResolveThenableJob_string();
+ isolate->debug()->OnAsyncTaskEvent(isolate->factory()->enqueue_string(),
+ debug_id,
+ Handle<String>::cast(debug_name));
+ } else {
+ debug_id = isolate->factory()->undefined_value();
+ debug_name = isolate->factory()->undefined_value();
+ }
Handle<PromiseResolveThenableJobInfo> info =
isolate->factory()->NewPromiseResolveThenableJobInfo(
resolution, then, resolve, reject, debug_id, debug_name);
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698