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

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

Issue 2314903004: [promises] Move PromiseResolveThenableJob to c++ (Closed)
Patch Set: Created 4 years, 3 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
« src/objects.h ('K') | « src/runtime/runtime.h ('k') | src/types.cc » ('j') | 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 db2aa01ea8db022d2c35bc7259783dc78d08eec2..2d56e38a4da26d5facba74a27e542a0a4efbaffe 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -555,6 +555,20 @@ RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) {
}
}
+RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 5);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, resolution, 1);
adamk 2016/09/06 21:04:57 The struct says these are just Objects; which is i
gsathya 2016/09/07 04:45:30 Updated the struct to be more specific.
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, then, 2);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 3);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 4);
+ Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer(
+ promise, resolution, then, resolve, reject);
+ isolate->EnqueueMicrotask(container);
+ return isolate->heap()->undefined_value();
+}
+
RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
« src/objects.h ('K') | « src/runtime/runtime.h ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698