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

Unified Diff: src/promise-utils.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/promise-utils.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/promise-utils.cc
diff --git a/src/promise-utils.cc b/src/promise-utils.cc
index 50f6ba16afdecde3c00dab5fd090f50b5d3ba9eb..40b247e8597a26a7b79c918d3032501ba456f018 100644
--- a/src/promise-utils.cc
+++ b/src/promise-utils.cc
@@ -27,42 +27,5 @@ void PromiseUtils::SetAlreadyVisited(Handle<Context> context) {
context->set(kAlreadyVisitedSlot, Smi::FromInt(1));
}
-void PromiseUtils::CreateResolvingFunctions(Isolate* isolate,
- Handle<JSObject> promise,
- Handle<Object> debug_event,
- Handle<JSFunction>* resolve,
- Handle<JSFunction>* reject) {
- DCHECK(debug_event->IsTrue(isolate) || debug_event->IsFalse(isolate));
- Handle<Context> context =
- isolate->factory()->NewPromiseResolvingFunctionContext(
- kPromiseContextLength);
- context->set_native_context(*isolate->native_context());
- // We set the closure to be an empty function, same as native context.
- context->set_closure(isolate->native_context()->closure());
- context->set(kAlreadyVisitedSlot, Smi::kZero);
- context->set(kPromiseSlot, *promise);
- context->set(kDebugEventSlot, *debug_event);
-
- Handle<SharedFunctionInfo> resolve_shared_fun(
- isolate->native_context()->promise_resolve_shared_fun(), isolate);
- Handle<JSFunction> resolve_fun =
- isolate->factory()->NewFunctionFromSharedFunctionInfo(
- isolate->sloppy_function_without_prototype_map(), resolve_shared_fun,
- isolate->native_context(), TENURED);
-
- Handle<SharedFunctionInfo> reject_shared_fun(
- isolate->native_context()->promise_reject_shared_fun(), isolate);
- Handle<JSFunction> reject_fun =
- isolate->factory()->NewFunctionFromSharedFunctionInfo(
- isolate->sloppy_function_without_prototype_map(), reject_shared_fun,
- isolate->native_context(), TENURED);
-
- resolve_fun->set_context(*context);
- reject_fun->set_context(*context);
-
- *resolve = resolve_fun;
- *reject = reject_fun;
-}
-
} // namespace internal
} // namespace v8
« no previous file with comments | « src/promise-utils.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698