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

Unified Diff: src/bootstrapper.cc

Issue 2497523002: [promises] Move promise constructor to TFS (Closed)
Patch Set: remove temp code 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
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-promise.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index c75961d4bb9357bbc2ca3d0720345813c71d1bb0..65f8dd97d51cde1e33be16ef291e25a0d8ecd8c9 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3583,6 +3583,17 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
InstallWithIntrinsicDefaultProto(isolate(), function,
Context::PROMISE_FUNCTION_INDEX);
+ // TODO(gsathya): Fix up the wiring to be the correct Promise constructor.
+ Handle<JSObject> prototype =
+ factory()->NewJSObject(isolate()->object_function(), TENURED);
+ Handle<JSFunction> promise2_fun = SimpleInstallFunction(
+ global_object, "Promise2", Builtins::kPromiseConstructor, 1, false);
Benedikt Meurer 2016/11/11 06:50:30 You cannot say "dont adapt" arguments here, but ha
gsathya 2016/11/22 04:31:43 Done.
+
+ Handle<SharedFunctionInfo> shared(promise2_fun->shared(), isolate());
+ shared->SetConstructStub(*isolate()->builtins()->PromiseConstructor());
Benedikt Meurer 2016/11/11 06:50:30 I'm not sure we currently support having a TFS bui
gsathya 2016/11/22 04:31:43 Done.
+ shared->set_instance_class_name(isolate()->heap()->Promise_string());
+ shared->DontAdaptArguments();
Benedikt Meurer 2016/11/11 06:50:30 This is reundant (and wrong).
gsathya 2016/11/22 04:31:43 Done.
+
{
Handle<Code> code = handle(
isolate()->builtins()->builtin(Builtins::kPromiseResolveClosure),
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-promise.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698