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

Unified Diff: src/bootstrapper.cc

Issue 2567333002: [promises] port NewPromiseCapability to TF (Closed)
Patch Set: git rid of stuff that snuck into patch 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/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index fe4721617cd8a2ffa3be6f6448fdd28f5d876907..db085b3240f33c484e8aafe9d662048826efaf62 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1843,6 +1843,32 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
to_primitive->shared()->set_length(1);
}
+ {
+ Handle<Code> code = isolate->builtins()->PromiseGetCapabilitiesExecutor();
+ Handle<SharedFunctionInfo> info =
+ factory->NewSharedFunctionInfo(factory->empty_string(), code, true);
+ info->SetConstructStub(*isolate->builtins()->JSBuiltinsConstructStub());
+ info->set_instance_class_name(isolate->heap()->Object_string());
+ info->set_internal_formal_parameter_count(2);
+ info->set_length(2);
+ native_context()->set_promise_get_capabilities_executor_shared_fun(*info);
+
+ // %new_internal_promise_capability(debugEvent)
+ Handle<JSFunction> new_internal_promise_capability =
+ SimpleCreateFunction(isolate, factory->empty_string(),
+ Builtins::kNewInternalPromiseCapability, 1, false);
+ InstallWithIntrinsicDefaultProto(
+ isolate, new_internal_promise_capability,
+ Context::NEW_INTERNAL_PROMISE_CAPABILITY_INDEX);
+
+ // %new_promise_capability(C, debugEvent)
+ Handle<JSFunction> new_promise_capability =
+ SimpleCreateFunction(isolate, factory->empty_string(),
+ Builtins::kNewPromiseCapability, 2, false);
+ InstallWithIntrinsicDefaultProto(isolate, new_promise_capability,
+ Context::NEW_PROMISE_CAPABILITY_INDEX);
+ }
+
{ // -- P r o m i s e
// Set catch prediction
Handle<Code> promise_code = isolate->builtins()->PromiseConstructor();
@@ -1972,12 +1998,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
info->set_length(1);
native_context()->set_promise_reject_shared_fun(*info);
}
-
- Handle<JSFunction> create_resolving_functions =
- SimpleCreateFunction(isolate, factory->empty_string(),
- Builtins::kCreateResolvingFunctions, 2, false);
- native_context()->set_create_resolving_functions(
- *create_resolving_functions);
}
{ // -- R e g E x p
« no previous file with comments | « src/ast/ast-types.cc ('k') | src/builtins/builtins.h » ('j') | src/builtins/builtins-promise.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698