Line data Source code
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
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_BUILTINS_BUILTINS_ITERATOR_GEN_H_
6 : #define V8_BUILTINS_BUILTINS_ITERATOR_GEN_H_
7 :
8 : #include "src/code-stub-assembler.h"
9 :
10 : namespace v8 {
11 : namespace internal {
12 :
13 : using compiler::Node;
14 :
15 : class IteratorBuiltinsAssembler : public CodeStubAssembler {
16 : public:
17 : explicit IteratorBuiltinsAssembler(compiler::CodeAssemblerState* state)
18 155 : : CodeStubAssembler(state) {}
19 :
20 : // https://tc39.github.io/ecma262/#sec-getiterator --- never used for
21 : // @@asyncIterator.
22 : Node* GetIterator(Node* context, Node* object, Label* if_exception = nullptr,
23 : Variable* exception = nullptr);
24 :
25 : // https://tc39.github.io/ecma262/#sec-iteratorstep
26 : // Returns `false` if the iterator is done, otherwise returns an
27 : // iterator result.
28 : // `fast_iterator_result_map` refers to the map for the JSIteratorResult
29 : // object, loaded from the native context.
30 : Node* IteratorStep(Node* context, Node* iterator, Label* if_done,
31 : Node* fast_iterator_result_map = nullptr,
32 : Label* if_exception = nullptr,
33 : Variable* exception = nullptr);
34 :
35 : // https://tc39.github.io/ecma262/#sec-iteratorvalue
36 : // Return the `value` field from an iterator.
37 : // `fast_iterator_result_map` refers to the map for the JSIteratorResult
38 : // object, loaded from the native context.
39 : Node* IteratorValue(Node* context, Node* result,
40 : Node* fast_iterator_result_map = nullptr,
41 : Label* if_exception = nullptr,
42 : Variable* exception = nullptr);
43 :
44 : // https://tc39.github.io/ecma262/#sec-iteratorclose
45 : void IteratorCloseOnException(Node* context, Node* iterator,
46 : Label* if_exception, Variable* exception);
47 : void IteratorCloseOnException(Node* context, Node* iterator,
48 : Variable* exception);
49 : };
50 :
51 : } // namespace internal
52 : } // namespace v8
53 :
54 : #endif // V8_BUILTINS_BUILTINS_ITERATOR_GEN_H_
|