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 #ifndef V8_BUILTINS_BUILTINS_ASYNC_H_ | 5 #ifndef V8_BUILTINS_BUILTINS_ASYNC_H_ |
6 #define V8_BUILTINS_BUILTINS_ASYNC_H_ | 6 #define V8_BUILTINS_BUILTINS_ASYNC_H_ |
7 | 7 |
8 #include "src/builtins/builtins-promise.h" | 8 #include "src/builtins/builtins-promise-gen.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 class AsyncBuiltinsAssembler : public PromiseBuiltinsAssembler { | 13 class AsyncBuiltinsAssembler : public PromiseBuiltinsAssembler { |
14 public: | 14 public: |
15 explicit AsyncBuiltinsAssembler(compiler::CodeAssemblerState* state) | 15 explicit AsyncBuiltinsAssembler(compiler::CodeAssemblerState* state) |
16 : PromiseBuiltinsAssembler(state) {} | 16 : PromiseBuiltinsAssembler(state) {} |
17 | 17 |
18 protected: | 18 protected: |
19 typedef std::function<Node*(Node*)> NodeGenerator1; | 19 typedef std::function<Node*(Node*)> NodeGenerator1; |
20 | 20 |
21 // Perform steps to resume generator after `value` is resolved. | 21 // Perform steps to resume generator after `value` is resolved. |
22 // `on_reject_context_index` is an index into the Native Context, which should | 22 // `on_reject_context_index` is an index into the Native Context, which should |
23 // point to a SharedFunctioninfo instance used to create the closure. The | 23 // point to a SharedFunctioninfo instance used to create the closure. The |
24 // value following the reject index should be a similar value for the resolve | 24 // value following the reject index should be a similar value for the resolve |
25 // closure. Returns the Promise-wrapped `value`. | 25 // closure. Returns the Promise-wrapped `value`. |
26 Node* Await(Node* context, Node* generator, Node* value, Node* outer_promise, | 26 Node* Await(Node* context, Node* generator, Node* value, Node* outer_promise, |
27 const NodeGenerator1& create_closure_context, | 27 const NodeGenerator1& create_closure_context, |
28 int on_resolve_context_index, int on_reject_context_index, | 28 int on_resolve_context_index, int on_reject_context_index, |
29 bool is_predicted_as_caught); | 29 bool is_predicted_as_caught); |
30 }; | 30 }; |
31 | 31 |
32 } // namespace internal | 32 } // namespace internal |
33 } // namespace v8 | 33 } // namespace v8 |
34 | 34 |
35 #endif // V8_BUILTINS_BUILTINS_ASYNC_H_ | 35 #endif // V8_BUILTINS_BUILTINS_ASYNC_H_ |
OLD | NEW |