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/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1677 DECLARE_NODE_TYPE(Property) | 1677 DECLARE_NODE_TYPE(Property) |
1678 | 1678 |
1679 virtual bool IsValidReferenceExpression() const V8_OVERRIDE { return true; } | 1679 virtual bool IsValidReferenceExpression() const V8_OVERRIDE { return true; } |
1680 | 1680 |
1681 Expression* obj() const { return obj_; } | 1681 Expression* obj() const { return obj_; } |
1682 Expression* key() const { return key_; } | 1682 Expression* key() const { return key_; } |
1683 | 1683 |
1684 BailoutId LoadId() const { return load_id_; } | 1684 BailoutId LoadId() const { return load_id_; } |
1685 | 1685 |
1686 bool IsStringAccess() const { return is_string_access_; } | 1686 bool IsStringAccess() const { return is_string_access_; } |
1687 bool IsFunctionPrototype() const { return is_function_prototype_; } | |
1688 | 1687 |
1689 // Type feedback information. | 1688 // Type feedback information. |
1690 virtual bool IsMonomorphic() V8_OVERRIDE { | 1689 virtual bool IsMonomorphic() V8_OVERRIDE { |
1691 return receiver_types_.length() == 1; | 1690 return receiver_types_.length() == 1; |
1692 } | 1691 } |
1693 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { | 1692 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { |
1694 return &receiver_types_; | 1693 return &receiver_types_; |
1695 } | 1694 } |
1696 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { | 1695 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { |
1697 return STANDARD_STORE; | 1696 return STANDARD_STORE; |
1698 } | 1697 } |
1699 bool IsUninitialized() { return !is_for_call_ && is_uninitialized_; } | 1698 bool IsUninitialized() { return !is_for_call_ && is_uninitialized_; } |
1700 bool HasNoTypeInformation() { | 1699 bool HasNoTypeInformation() { |
1701 return is_uninitialized_; | 1700 return is_uninitialized_; |
1702 } | 1701 } |
1703 void set_is_uninitialized(bool b) { is_uninitialized_ = b; } | 1702 void set_is_uninitialized(bool b) { is_uninitialized_ = b; } |
1704 void set_is_string_access(bool b) { is_string_access_ = b; } | 1703 void set_is_string_access(bool b) { is_string_access_ = b; } |
1705 void set_is_function_prototype(bool b) { is_function_prototype_ = b; } | |
1706 void mark_for_call() { is_for_call_ = true; } | 1704 void mark_for_call() { is_for_call_ = true; } |
1707 bool IsForCall() { return is_for_call_; } | 1705 bool IsForCall() { return is_for_call_; } |
1708 | 1706 |
1709 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } | 1707 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } |
1710 | 1708 |
1711 virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; } | 1709 virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; } |
1712 virtual void SetFirstFeedbackSlot(int slot) { | 1710 virtual void SetFirstFeedbackSlot(int slot) { |
1713 property_feedback_slot_ = slot; | 1711 property_feedback_slot_ = slot; |
1714 } | 1712 } |
1715 | 1713 |
1716 int PropertyFeedbackSlot() const { return property_feedback_slot_; } | 1714 int PropertyFeedbackSlot() const { return property_feedback_slot_; } |
1717 | 1715 |
1718 protected: | 1716 protected: |
1719 Property(Zone* zone, | 1717 Property(Zone* zone, Expression* obj, Expression* key, int pos) |
1720 Expression* obj, | |
1721 Expression* key, | |
1722 int pos) | |
1723 : Expression(zone, pos), | 1718 : Expression(zone, pos), |
1724 obj_(obj), | 1719 obj_(obj), |
1725 key_(key), | 1720 key_(key), |
1726 load_id_(GetNextId(zone)), | 1721 load_id_(GetNextId(zone)), |
1727 property_feedback_slot_(kInvalidFeedbackSlot), | 1722 property_feedback_slot_(kInvalidFeedbackSlot), |
1728 is_for_call_(false), | 1723 is_for_call_(false), |
1729 is_uninitialized_(false), | 1724 is_uninitialized_(false), |
1730 is_string_access_(false), | 1725 is_string_access_(false) {} |
1731 is_function_prototype_(false) { } | |
1732 | 1726 |
1733 private: | 1727 private: |
1734 Expression* obj_; | 1728 Expression* obj_; |
1735 Expression* key_; | 1729 Expression* key_; |
1736 const BailoutId load_id_; | 1730 const BailoutId load_id_; |
1737 int property_feedback_slot_; | 1731 int property_feedback_slot_; |
1738 | 1732 |
1739 SmallMapList receiver_types_; | 1733 SmallMapList receiver_types_; |
1740 bool is_for_call_ : 1; | 1734 bool is_for_call_ : 1; |
1741 bool is_uninitialized_ : 1; | 1735 bool is_uninitialized_ : 1; |
1742 bool is_string_access_ : 1; | 1736 bool is_string_access_ : 1; |
1743 bool is_function_prototype_ : 1; | |
1744 }; | 1737 }; |
1745 | 1738 |
1746 | 1739 |
1747 class Call V8_FINAL : public Expression, public FeedbackSlotInterface { | 1740 class Call V8_FINAL : public Expression, public FeedbackSlotInterface { |
1748 public: | 1741 public: |
1749 DECLARE_NODE_TYPE(Call) | 1742 DECLARE_NODE_TYPE(Call) |
1750 | 1743 |
1751 Expression* expression() const { return expression_; } | 1744 Expression* expression() const { return expression_; } |
1752 ZoneList<Expression*>* arguments() const { return arguments_; } | 1745 ZoneList<Expression*>* arguments() const { return arguments_; } |
1753 | 1746 |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3478 private: | 3471 private: |
3479 Zone* zone_; | 3472 Zone* zone_; |
3480 Visitor visitor_; | 3473 Visitor visitor_; |
3481 AstValueFactory* ast_value_factory_; | 3474 AstValueFactory* ast_value_factory_; |
3482 }; | 3475 }; |
3483 | 3476 |
3484 | 3477 |
3485 } } // namespace v8::internal | 3478 } } // namespace v8::internal |
3486 | 3479 |
3487 #endif // V8_AST_H_ | 3480 #endif // V8_AST_H_ |
OLD | NEW |