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); | 19 Node* AllocateAndInitPromise(Node* context, Node* parent); |
20 | 20 |
21 Node* ThrowIfNotJSReceiver(Node* context, Node* value, | 21 Node* ThrowIfNotJSReceiver(Node* context, Node* value, |
22 MessageTemplate::Template msg_template); | 22 MessageTemplate::Template msg_template, |
23 const char* method_name = NULL); | |
adamk
2017/01/04 19:19:21
nit: s/NULL/nullptr/
gsathya
2017/01/04 19:37:17
Done.
| |
23 | 24 |
24 Node* SpeciesConstructor(Node* context, Node* object, | 25 Node* SpeciesConstructor(Node* context, Node* object, |
25 Node* default_constructor); | 26 Node* default_constructor); |
26 | 27 |
27 Node* PromiseHasHandler(Node* promise); | 28 Node* PromiseHasHandler(Node* promise); |
28 | 29 |
29 void PromiseSetHasHandler(Node* promise); | 30 void PromiseSetHasHandler(Node* promise); |
30 | 31 |
31 void AppendPromiseCallback(int offset, compiler::Node* promise, | 32 void AppendPromiseCallback(int offset, compiler::Node* promise, |
32 compiler::Node* value); | 33 compiler::Node* value); |
33 | 34 |
34 Node* InternalPromiseThen(Node* context, Node* promise, Node* on_resolve, | 35 Node* InternalPromiseThen(Node* context, Node* promise, Node* on_resolve, |
35 Node* on_reject); | 36 Node* on_reject); |
36 | 37 |
37 Node* InternalPerformPromiseThen(Node* context, Node* promise, | 38 Node* InternalPerformPromiseThen(Node* context, Node* promise, |
38 Node* on_resolve, Node* on_reject, | 39 Node* on_resolve, Node* on_reject, |
39 Node* deferred_promise, | 40 Node* deferred_promise, |
40 Node* deferred_on_resolve, | 41 Node* deferred_on_resolve, |
41 Node* deferred_on_reject); | 42 Node* deferred_on_reject); |
42 | 43 |
43 void InternalResolvePromise(Node* context, Node* promise, Node* result); | 44 void InternalResolvePromise(Node* context, Node* promise, Node* result); |
44 | 45 |
45 void BranchIfFastPath(Node* context, Node* promise, Label* if_isunmodified, | 46 void BranchIfFastPath(Node* context, Node* promise, Label* if_isunmodified, |
46 Label* if_ismodified); | 47 Label* if_ismodified); |
47 | 48 |
49 void BranchIfFastPath(Node* native_context, Node* promise_fun, Node* promise, | |
50 Label* if_isunmodified, Label* if_ismodified); | |
51 | |
48 Node* CreatePromiseContext(Node* native_context, int slots); | 52 Node* CreatePromiseContext(Node* native_context, int slots); |
49 Node* CreatePromiseResolvingFunctionsContext(Node* promise, Node* debug_event, | 53 Node* CreatePromiseResolvingFunctionsContext(Node* promise, Node* debug_event, |
50 Node* native_context); | 54 Node* native_context); |
51 | 55 |
52 std::pair<Node*, Node*> CreatePromiseResolvingFunctions( | 56 std::pair<Node*, Node*> CreatePromiseResolvingFunctions( |
53 Node* promise, Node* native_context, Node* promise_context); | 57 Node* promise, Node* native_context, Node* promise_context); |
54 | 58 |
55 Node* CreatePromiseGetCapabilitiesExecutorContext(Node* native_context, | 59 Node* CreatePromiseGetCapabilitiesExecutorContext(Node* native_context, |
56 Node* promise_capability); | 60 Node* promise_capability); |
57 | 61 |
58 Node* NewPromiseCapability(Node* context, Node* constructor, | 62 Node* NewPromiseCapability(Node* context, Node* constructor, |
59 Node* debug_event = nullptr); | 63 Node* debug_event = nullptr); |
60 }; | 64 }; |
61 | 65 |
62 } // namespace internal | 66 } // namespace internal |
63 } // namespace v8 | 67 } // namespace v8 |
OLD | NEW |