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/code-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 | 9 |
10 typedef compiler::Node Node; | 10 typedef compiler::Node Node; |
11 typedef CodeStubAssembler::ParameterMode ParameterMode; | 11 typedef CodeStubAssembler::ParameterMode ParameterMode; |
12 typedef compiler::CodeAssemblerState CodeAssemblerState; | 12 typedef compiler::CodeAssemblerState CodeAssemblerState; |
13 | 13 |
14 class PromiseBuiltinsAssembler : public CodeStubAssembler { | 14 class PromiseBuiltinsAssembler : public CodeStubAssembler { |
15 public: | 15 public: |
16 explicit PromiseBuiltinsAssembler(CodeAssemblerState* state) | 16 explicit PromiseBuiltinsAssembler(CodeAssemblerState* state) |
17 : CodeStubAssembler(state) {} | 17 : CodeStubAssembler(state) {} |
18 | 18 |
| 19 Node* AllocateAndInitPromise(Node* context, Node* parent); |
| 20 |
19 Node* ThrowIfNotJSReceiver(Node* context, Node* value, | 21 Node* ThrowIfNotJSReceiver(Node* context, Node* value, |
20 MessageTemplate::Template msg_template); | 22 MessageTemplate::Template msg_template); |
21 | 23 |
22 Node* SpeciesConstructor(Node* context, Node* object, | 24 Node* SpeciesConstructor(Node* context, Node* object, |
23 Node* default_constructor); | 25 Node* default_constructor); |
24 | 26 |
25 Node* PromiseHasHandler(Node* promise); | 27 Node* PromiseHasHandler(Node* promise); |
26 | 28 |
27 void PromiseSetHasHandler(Node* promise); | 29 void PromiseSetHasHandler(Node* promise); |
28 | 30 |
29 void AppendPromiseCallback(int offset, compiler::Node* promise, | 31 void AppendPromiseCallback(int offset, compiler::Node* promise, |
30 compiler::Node* value); | 32 compiler::Node* value); |
31 | 33 |
32 Node* InternalPromiseThen(Node* context, Node* promise, Node* on_resolve, | 34 Node* InternalPromiseThen(Node* context, Node* promise, Node* on_resolve, |
33 Node* on_reject); | 35 Node* on_reject); |
34 | 36 |
35 Node* InternalPerformPromiseThen(Node* context, Node* promise, | 37 Node* InternalPerformPromiseThen(Node* context, Node* promise, |
36 Node* on_resolve, Node* on_reject, | 38 Node* on_resolve, Node* on_reject, |
37 Node* deferred); | 39 Node* deferred_promise, |
| 40 Node* deferred_on_resolve, |
| 41 Node* deferred_on_reject); |
38 | 42 |
39 void InternalResolvePromise(Node* context, Node* promise, Node* result); | 43 void InternalResolvePromise(Node* context, Node* promise, Node* result); |
40 | 44 |
41 void BranchIfFastPath(Node* context, Node* promise, Label* if_isunmodified, | 45 void BranchIfFastPath(Node* context, Node* promise, Label* if_isunmodified, |
42 Label* if_ismodified); | 46 Label* if_ismodified); |
43 | 47 |
44 Node* CreatePromiseResolvingFunctionsContext(Node* promise, Node* debug_event, | 48 Node* CreatePromiseResolvingFunctionsContext(Node* promise, Node* debug_event, |
45 Node* native_context); | 49 Node* native_context); |
46 | 50 |
47 std::pair<Node*, Node*> CreatePromiseResolvingFunctions( | 51 std::pair<Node*, Node*> CreatePromiseResolvingFunctions( |
48 Node* promise, Node* native_context, Node* promise_context); | 52 Node* promise, Node* native_context, Node* promise_context); |
49 }; | 53 }; |
50 | 54 |
51 } // namespace internal | 55 } // namespace internal |
52 } // namespace v8 | 56 } // namespace v8 |
OLD | NEW |