OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
7 | 7 |
8 #include "src/ast/ast-types.h" | 8 #include "src/ast/ast-types.h" |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 }; | 1547 }; |
1548 | 1548 |
1549 | 1549 |
1550 // An array literal has a literals object that is used | 1550 // An array literal has a literals object that is used |
1551 // for minimizing the work when constructing it at runtime. | 1551 // for minimizing the work when constructing it at runtime. |
1552 class ArrayLiteral final : public MaterializedLiteral { | 1552 class ArrayLiteral final : public MaterializedLiteral { |
1553 public: | 1553 public: |
1554 Handle<ConstantElementsPair> constant_elements() const { | 1554 Handle<ConstantElementsPair> constant_elements() const { |
1555 return constant_elements_; | 1555 return constant_elements_; |
1556 } | 1556 } |
1557 ElementsKind constant_elements_kind() const { | 1557 ElementsKind constant_elements_kind() const; |
1558 return static_cast<ElementsKind>(constant_elements()->elements_kind()); | |
1559 } | |
1560 | 1558 |
1561 ZoneList<Expression*>* values() const { return values_; } | 1559 ZoneList<Expression*>* values() const { return values_; } |
1562 | 1560 |
1563 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } | 1561 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } |
1564 | 1562 |
1565 // Return an AST id for an element that is used in simulate instructions. | 1563 // Return an AST id for an element that is used in simulate instructions. |
1566 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } | 1564 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } |
1567 | 1565 |
1568 // Unlike other AST nodes, this number of bailout IDs allocated for an | 1566 // Unlike other AST nodes, this number of bailout IDs allocated for an |
1569 // ArrayLiteral can vary, so num_ids() is not a static method. | 1567 // ArrayLiteral can vary, so num_ids() is not a static method. |
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3647 : NULL; \ | 3645 : NULL; \ |
3648 } | 3646 } |
3649 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3647 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3650 #undef DECLARE_NODE_FUNCTIONS | 3648 #undef DECLARE_NODE_FUNCTIONS |
3651 | 3649 |
3652 | 3650 |
3653 } // namespace internal | 3651 } // namespace internal |
3654 } // namespace v8 | 3652 } // namespace v8 |
3655 | 3653 |
3656 #endif // V8_AST_AST_H_ | 3654 #endif // V8_AST_AST_H_ |
OLD | NEW |