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_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast-value-factory.h" | 9 #include "src/ast-value-factory.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 return flags; | 1577 return flags; |
1578 } | 1578 } |
1579 | 1579 |
1580 enum Flags { | 1580 enum Flags { |
1581 kNoFlags = 0, | 1581 kNoFlags = 0, |
1582 kShallowElements = 1, | 1582 kShallowElements = 1, |
1583 kDisableMementos = 1 << 1, | 1583 kDisableMementos = 1 << 1, |
1584 kIsStrong = 1 << 2 | 1584 kIsStrong = 1 << 2 |
1585 }; | 1585 }; |
1586 | 1586 |
| 1587 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, |
| 1588 FeedbackVectorSlotCache* cache) override; |
| 1589 FeedbackVectorSlot LiteralFeedbackSlot() const { return literal_slot_; } |
| 1590 |
1587 protected: | 1591 protected: |
1588 ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, | 1592 ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, |
1589 int first_spread_index, int literal_index, bool is_strong, | 1593 int first_spread_index, int literal_index, bool is_strong, |
1590 int pos) | 1594 int pos) |
1591 : MaterializedLiteral(zone, literal_index, is_strong, pos), | 1595 : MaterializedLiteral(zone, literal_index, is_strong, pos), |
1592 values_(values), | 1596 values_(values), |
1593 first_spread_index_(first_spread_index) {} | 1597 first_spread_index_(first_spread_index) {} |
1594 static int parent_num_ids() { return MaterializedLiteral::num_ids(); } | 1598 static int parent_num_ids() { return MaterializedLiteral::num_ids(); } |
1595 | 1599 |
1596 private: | 1600 private: |
1597 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 1601 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
1598 | 1602 |
1599 Handle<FixedArray> constant_elements_; | 1603 Handle<FixedArray> constant_elements_; |
1600 ZoneList<Expression*>* values_; | 1604 ZoneList<Expression*>* values_; |
1601 int first_spread_index_; | 1605 int first_spread_index_; |
| 1606 FeedbackVectorSlot literal_slot_; |
1602 }; | 1607 }; |
1603 | 1608 |
1604 | 1609 |
1605 class VariableProxy final : public Expression { | 1610 class VariableProxy final : public Expression { |
1606 public: | 1611 public: |
1607 DECLARE_NODE_TYPE(VariableProxy) | 1612 DECLARE_NODE_TYPE(VariableProxy) |
1608 | 1613 |
1609 bool IsValidReferenceExpression() const override { | 1614 bool IsValidReferenceExpression() const override { |
1610 return !is_this() && !is_new_target(); | 1615 return !is_this() && !is_new_target(); |
1611 } | 1616 } |
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3610 // the parser-level zone. | 3615 // the parser-level zone. |
3611 Zone* parser_zone_; | 3616 Zone* parser_zone_; |
3612 AstValueFactory* ast_value_factory_; | 3617 AstValueFactory* ast_value_factory_; |
3613 }; | 3618 }; |
3614 | 3619 |
3615 | 3620 |
3616 } // namespace internal | 3621 } // namespace internal |
3617 } // namespace v8 | 3622 } // namespace v8 |
3618 | 3623 |
3619 #endif // V8_AST_H_ | 3624 #endif // V8_AST_H_ |
OLD | NEW |