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

Unified Diff: src/bootstrapper.cc

Issue 2459283004: [promises] Move CreateResolvingFunctions to c++ (Closed)
Patch Set: fix test Created 4 years, 1 month 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 143c00154c63b56304706f0c0515b93106b614d4..8e4110226d5d573b45bc1d76e3c27664e33cf92f 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3597,6 +3597,34 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
*isolate()->builtins()->JSBuiltinsConstructStub());
InstallWithIntrinsicDefaultProto(isolate(), function,
Context::PROMISE_FUNCTION_INDEX);
+
+ {
+ Handle<String> name = isolate()->factory()->InternalizeUtf8String("");
adamk 2016/11/08 18:09:54 You can use factory()->empty_string()
gsathya 2016/11/08 20:03:18 Done.
+ Handle<Code> code = handle(
+ isolate()->builtins()->builtin(Builtins::kPromiseResolveClosure),
+ isolate());
+ Handle<SharedFunctionInfo> info =
+ isolate()->factory()->NewSharedFunctionInfo(name, code, false);
+ info->set_internal_formal_parameter_count(1);
+ info->set_length(1);
+ native_context()->set_promise_resolve_shared_fun(*info);
adamk 2016/11/08 18:09:54 Why are we storing these per context? Could we ins
+
+ name = isolate()->factory()->InternalizeUtf8String("");
+ code = handle(
+ isolate()->builtins()->builtin(Builtins::kPromiseRejectClosure),
+ isolate());
+ info = isolate()->factory()->NewSharedFunctionInfo(name, code, false);
+ info->set_internal_formal_parameter_count(2);
+ info->set_length(1);
+ native_context()->set_promise_reject_shared_fun(*info);
+ }
+
+ Handle<JSFunction> create_resolving_functions = SimpleCreateFunction(
+ isolate(),
+ factory()->InternalizeUtf8String("create_resolving_functions"),
+ Builtins::kCreateResolvingFunctions, 2, false);
+ native_context()->set_create_resolving_functions(
+ *create_resolving_functions);
}
InstallBuiltinFunctionIds();
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | src/builtins/builtins-promise.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698