OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |