OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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-async.h" | 5 #include "src/builtins/builtins-async.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils-gen.h" |
7 #include "src/builtins/builtins.h" | 7 #include "src/builtins/builtins.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stub-assembler.h" | 9 #include "src/code-stub-assembler.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
| 15 using compiler::Node; |
| 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 // Describe fields of Context associated with the AsyncIterator unwrap closure. | 19 // Describe fields of Context associated with the AsyncIterator unwrap closure. |
18 class ValueUnwrapContext { | 20 class ValueUnwrapContext { |
19 public: | 21 public: |
20 enum Fields { kDoneSlot = Context::MIN_CONTEXT_SLOTS, kLength }; | 22 enum Fields { kDoneSlot = Context::MIN_CONTEXT_SLOTS, kLength }; |
21 }; | 23 }; |
22 | 24 |
23 class AsyncFromSyncBuiltinsAssembler : public AsyncBuiltinsAssembler { | 25 class AsyncFromSyncBuiltinsAssembler : public AsyncBuiltinsAssembler { |
24 public: | 26 public: |
25 explicit AsyncFromSyncBuiltinsAssembler(CodeAssemblerState* state) | 27 explicit AsyncFromSyncBuiltinsAssembler(compiler::CodeAssemblerState* state) |
26 : AsyncBuiltinsAssembler(state) {} | 28 : AsyncBuiltinsAssembler(state) {} |
27 | 29 |
28 void ThrowIfNotAsyncFromSyncIterator(Node* const context, Node* const object, | 30 void ThrowIfNotAsyncFromSyncIterator(Node* const context, Node* const object, |
29 Label* if_exception, | 31 Label* if_exception, |
30 Variable* var_exception, | 32 Variable* var_exception, |
31 const char* method_name); | 33 const char* method_name); |
32 | 34 |
33 typedef std::function<void(Node* const context, Node* const promise, | 35 typedef std::function<void(Node* const context, Node* const promise, |
34 Label* if_exception)> | 36 Label* if_exception)> |
35 UndefinedMethodHandler; | 37 UndefinedMethodHandler; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 CSA_ASSERT(this, IsBoolean(done)); | 319 CSA_ASSERT(this, IsBoolean(done)); |
318 | 320 |
319 Node* const unwrapped_value = CallStub( | 321 Node* const unwrapped_value = CallStub( |
320 CodeFactory::CreateIterResultObject(isolate()), context, value, done); | 322 CodeFactory::CreateIterResultObject(isolate()), context, value, done); |
321 | 323 |
322 Return(unwrapped_value); | 324 Return(unwrapped_value); |
323 } | 325 } |
324 | 326 |
325 } // namespace internal | 327 } // namespace internal |
326 } // namespace v8 | 328 } // namespace v8 |
OLD | NEW |