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

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

Issue 2611083002: [promises] Add AllocatePromiseResolveThenableJobInfo to TF (Closed)
Patch Set: rebase 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 | « src/runtime/runtime.h ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-promise.cc
diff --git a/src/runtime/runtime-promise.cc b/src/runtime/runtime-promise.cc
index e17ffd946179850235d206421aca99b6b8098733..ace8db8b89bb288cdd7f910b9d65355665f3a507 100644
--- a/src/runtime/runtime-promise.cc
+++ b/src/runtime/runtime-promise.cc
@@ -195,32 +195,9 @@ RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) {
RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) {
HandleScope scope(isolate);
- DCHECK_EQ(3, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
- CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 1);
- CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 2);
-
- // TODO(gsathya): Add fast path for native promises with unmodified
- // PromiseThen (which don't need these resolving functions, but
- // instead can just call resolve/reject directly).
- Handle<JSFunction> resolve, reject;
- PromiseUtils::CreateResolvingFunctions(
- isolate, promise, isolate->factory()->false_value(), &resolve, &reject);
-
- int debug_id = kDebugPromiseFirstID;
- PromiseDebugActionName debug_name = kDebugNotActive;
- if (isolate->debug()->is_active()) {
- debug_id = isolate->GetNextDebugMicrotaskId();
- debug_name = kDebugPromiseResolveThenableJob;
- isolate->debug()->OnAsyncTaskEvent(kDebugEnqueue, debug_id, debug_name);
- }
-
- Handle<PromiseResolveThenableJobInfo> info =
- isolate->factory()->NewPromiseResolveThenableJobInfo(
- resolution, then, resolve, reject, debug_id, debug_name,
- isolate->native_context());
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(PromiseResolveThenableJobInfo, info, 0);
isolate->EnqueueMicrotask(info);
-
return isolate->heap()->undefined_value();
}
@@ -239,22 +216,6 @@ RUNTIME_FUNCTION(Runtime_RunMicrotasks) {
return isolate->heap()->undefined_value();
}
-RUNTIME_FUNCTION(Runtime_CreateResolvingFunctions) {
- HandleScope scope(isolate);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
- DCHECK_EQ(1, args.length());
- Handle<JSFunction> resolve, reject;
-
- PromiseUtils::CreateResolvingFunctions(
- isolate, promise, isolate->factory()->true_value(), &resolve, &reject);
-
- Handle<FixedArray> result = isolate->factory()->NewFixedArray(2);
- result->set(0, *resolve);
- result->set(1, *reject);
-
- return *result;
-}
-
RUNTIME_FUNCTION(Runtime_PromiseStatus) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698