| 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 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1739 bool IsMonomorphic() OVERRIDE { return receiver_types_.length() == 1; } | 1739 bool IsMonomorphic() OVERRIDE { return receiver_types_.length() == 1; } |
| 1740 SmallMapList* GetReceiverTypes() OVERRIDE { return &receiver_types_; } | 1740 SmallMapList* GetReceiverTypes() OVERRIDE { return &receiver_types_; } |
| 1741 KeyedAccessStoreMode GetStoreMode() const OVERRIDE { return STANDARD_STORE; } | 1741 KeyedAccessStoreMode GetStoreMode() const OVERRIDE { return STANDARD_STORE; } |
| 1742 IcCheckType GetKeyType() const OVERRIDE { | 1742 IcCheckType GetKeyType() const OVERRIDE { |
| 1743 return KeyTypeField::decode(bit_field_); | 1743 return KeyTypeField::decode(bit_field_); |
| 1744 } | 1744 } |
| 1745 bool IsUninitialized() const { | 1745 bool IsUninitialized() const { |
| 1746 return !is_for_call() && HasNoTypeInformation(); | 1746 return !is_for_call() && HasNoTypeInformation(); |
| 1747 } | 1747 } |
| 1748 bool HasNoTypeInformation() const { | 1748 bool HasNoTypeInformation() const { |
| 1749 return IsUninitializedField::decode(bit_field_); | 1749 return GetInlineCacheState() == UNINITIALIZED; |
| 1750 } | 1750 } |
| 1751 void set_is_uninitialized(bool b) { | 1751 InlineCacheState GetInlineCacheState() const { |
| 1752 bit_field_ = IsUninitializedField::update(bit_field_, b); | 1752 return InlineCacheStateField::decode(bit_field_); |
| 1753 } | 1753 } |
| 1754 void set_is_string_access(bool b) { | 1754 void set_is_string_access(bool b) { |
| 1755 bit_field_ = IsStringAccessField::update(bit_field_, b); | 1755 bit_field_ = IsStringAccessField::update(bit_field_, b); |
| 1756 } | 1756 } |
| 1757 void set_key_type(IcCheckType key_type) { | 1757 void set_key_type(IcCheckType key_type) { |
| 1758 bit_field_ = KeyTypeField::update(bit_field_, key_type); | 1758 bit_field_ = KeyTypeField::update(bit_field_, key_type); |
| 1759 } | 1759 } |
| 1760 void set_inline_cache_state(InlineCacheState state) { |
| 1761 bit_field_ = InlineCacheStateField::update(bit_field_, state); |
| 1762 } |
| 1760 void mark_for_call() { | 1763 void mark_for_call() { |
| 1761 bit_field_ = IsForCallField::update(bit_field_, true); | 1764 bit_field_ = IsForCallField::update(bit_field_, true); |
| 1762 } | 1765 } |
| 1763 bool is_for_call() const { return IsForCallField::decode(bit_field_); } | 1766 bool is_for_call() const { return IsForCallField::decode(bit_field_); } |
| 1764 | 1767 |
| 1765 bool IsSuperAccess() { | 1768 bool IsSuperAccess() { |
| 1766 return obj()->IsSuperReference(); | 1769 return obj()->IsSuperReference(); |
| 1767 } | 1770 } |
| 1768 | 1771 |
| 1769 virtual FeedbackVectorRequirements ComputeFeedbackRequirements( | 1772 virtual FeedbackVectorRequirements ComputeFeedbackRequirements( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1780 | 1783 |
| 1781 FeedbackVectorICSlot PropertyFeedbackSlot() const { | 1784 FeedbackVectorICSlot PropertyFeedbackSlot() const { |
| 1782 DCHECK(!FLAG_vector_ics || !property_feedback_slot_.IsInvalid()); | 1785 DCHECK(!FLAG_vector_ics || !property_feedback_slot_.IsInvalid()); |
| 1783 return property_feedback_slot_; | 1786 return property_feedback_slot_; |
| 1784 } | 1787 } |
| 1785 | 1788 |
| 1786 protected: | 1789 protected: |
| 1787 Property(Zone* zone, Expression* obj, Expression* key, int pos) | 1790 Property(Zone* zone, Expression* obj, Expression* key, int pos) |
| 1788 : Expression(zone, pos), | 1791 : Expression(zone, pos), |
| 1789 bit_field_(IsForCallField::encode(false) | | 1792 bit_field_(IsForCallField::encode(false) | |
| 1790 IsUninitializedField::encode(false) | | 1793 IsStringAccessField::encode(false) | |
| 1791 IsStringAccessField::encode(false)), | 1794 InlineCacheStateField::encode(UNINITIALIZED)), |
| 1792 property_feedback_slot_(FeedbackVectorICSlot::Invalid()), | 1795 property_feedback_slot_(FeedbackVectorICSlot::Invalid()), |
| 1793 obj_(obj), | 1796 obj_(obj), |
| 1794 key_(key) {} | 1797 key_(key) {} |
| 1795 static int parent_num_ids() { return Expression::num_ids(); } | 1798 static int parent_num_ids() { return Expression::num_ids(); } |
| 1796 | 1799 |
| 1797 private: | 1800 private: |
| 1798 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 1801 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
| 1799 | 1802 |
| 1800 class IsForCallField : public BitField8<bool, 0, 1> {}; | 1803 class IsForCallField : public BitField8<bool, 0, 1> {}; |
| 1801 class IsUninitializedField : public BitField8<bool, 1, 1> {}; | 1804 class IsStringAccessField : public BitField8<bool, 1, 1> {}; |
| 1802 class IsStringAccessField : public BitField8<bool, 2, 1> {}; | 1805 class KeyTypeField : public BitField8<IcCheckType, 2, 1> {}; |
| 1803 class KeyTypeField : public BitField8<IcCheckType, 3, 1> {}; | 1806 class InlineCacheStateField : public BitField8<InlineCacheState, 3, 4> {}; |
| 1804 uint8_t bit_field_; | 1807 uint8_t bit_field_; |
| 1805 FeedbackVectorICSlot property_feedback_slot_; | 1808 FeedbackVectorICSlot property_feedback_slot_; |
| 1806 Expression* obj_; | 1809 Expression* obj_; |
| 1807 Expression* key_; | 1810 Expression* key_; |
| 1808 SmallMapList receiver_types_; | 1811 SmallMapList receiver_types_; |
| 1809 }; | 1812 }; |
| 1810 | 1813 |
| 1811 | 1814 |
| 1812 class Call FINAL : public Expression { | 1815 class Call FINAL : public Expression { |
| 1813 public: | 1816 public: |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3577 | 3580 |
| 3578 private: | 3581 private: |
| 3579 Zone* zone_; | 3582 Zone* zone_; |
| 3580 AstValueFactory* ast_value_factory_; | 3583 AstValueFactory* ast_value_factory_; |
| 3581 }; | 3584 }; |
| 3582 | 3585 |
| 3583 | 3586 |
| 3584 } } // namespace v8::internal | 3587 } } // namespace v8::internal |
| 3585 | 3588 |
| 3586 #endif // V8_AST_H_ | 3589 #endif // V8_AST_H_ |
| OLD | NEW |