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

Side by Side Diff: src/builtins/builtins-promise.cc

Issue 2607233002: [builtins] Add EmitFastNewObject (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-constructor.cc ('k') | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins-promise.h" 5 #include "src/builtins/builtins-promise.h"
6 #include "src/builtins/builtins-constructor.h"
6 #include "src/builtins/builtins-utils.h" 7 #include "src/builtins/builtins-utils.h"
7 #include "src/builtins/builtins.h" 8 #include "src/builtins/builtins.h"
8 #include "src/code-factory.h" 9 #include "src/code-factory.h"
9 #include "src/code-stub-assembler.h" 10 #include "src/code-stub-assembler.h"
10 #include "src/promise-utils.h" 11 #include "src/promise-utils.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 15
15 typedef compiler::Node Node; 16 typedef compiler::Node Node;
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 736
736 Bind(&if_targetisnotmodified); 737 Bind(&if_targetisnotmodified);
737 { 738 {
738 Node* const instance = AllocateJSPromise(context); 739 Node* const instance = AllocateJSPromise(context);
739 var_result.Bind(instance); 740 var_result.Bind(instance);
740 Goto(&init); 741 Goto(&init);
741 } 742 }
742 743
743 Bind(&if_targetismodified); 744 Bind(&if_targetismodified);
744 { 745 {
745 Callable fast_new_object_stub = CodeFactory::FastNewObject(isolate); 746 ConstructorBuiltinsAssembler constructor_assembler(this->state());
746 Node* const instance = 747 Node* const instance = constructor_assembler.EmitFastNewObject(
747 CallStub(fast_new_object_stub, context, promise_fun, new_target); 748 context, promise_fun, new_target);
748 749
749 var_result.Bind(instance); 750 var_result.Bind(instance);
750 Goto(&init); 751 Goto(&init);
751 } 752 }
752 753
753 Bind(&init); 754 Bind(&init);
754 { 755 {
755 PromiseInit(var_result.value()); 756 PromiseInit(var_result.value());
756 GotoUnless(IsPromiseHookEnabled(), &debug_push); 757 GotoUnless(IsPromiseHookEnabled(), &debug_push);
757 CallRuntime(Runtime::kPromiseHookInit, context, var_result.value(), 758 CallRuntime(Runtime::kPromiseHookInit, context, var_result.value(),
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 CallStub(getproperty_callable, context, promise, then_str); 1064 CallStub(getproperty_callable, context, promise, then_str);
1064 Callable call_callable = CodeFactory::Call(isolate); 1065 Callable call_callable = CodeFactory::Call(isolate);
1065 Node* const result = 1066 Node* const result =
1066 CallJS(call_callable, context, then, promise, on_resolve, on_reject); 1067 CallJS(call_callable, context, then, promise, on_resolve, on_reject);
1067 Return(result); 1068 Return(result);
1068 } 1069 }
1069 } 1070 }
1070 1071
1071 } // namespace internal 1072 } // namespace internal
1072 } // namespace v8 1073 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-constructor.cc ('k') | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698