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 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 | 1741 |
1742 bool IsStringAccess() const { | 1742 bool IsStringAccess() const { |
1743 return IsStringAccessField::decode(bit_field_); | 1743 return IsStringAccessField::decode(bit_field_); |
1744 } | 1744 } |
1745 | 1745 |
1746 // Type feedback information. | 1746 // Type feedback information. |
1747 bool IsMonomorphic() OVERRIDE { return receiver_types_.length() == 1; } | 1747 bool IsMonomorphic() OVERRIDE { return receiver_types_.length() == 1; } |
1748 SmallMapList* GetReceiverTypes() OVERRIDE { return &receiver_types_; } | 1748 SmallMapList* GetReceiverTypes() OVERRIDE { return &receiver_types_; } |
1749 KeyedAccessStoreMode GetStoreMode() const OVERRIDE { return STANDARD_STORE; } | 1749 KeyedAccessStoreMode GetStoreMode() const OVERRIDE { return STANDARD_STORE; } |
1750 IcCheckType GetKeyType() const OVERRIDE { | 1750 IcCheckType GetKeyType() const OVERRIDE { |
1751 // PROPERTY key types currently aren't implemented for KeyedLoadICs. | 1751 return KeyTypeField::decode(bit_field_); |
1752 return ELEMENT; | |
1753 } | 1752 } |
1754 bool IsUninitialized() const { | 1753 bool IsUninitialized() const { |
1755 return !is_for_call() && HasNoTypeInformation(); | 1754 return !is_for_call() && HasNoTypeInformation(); |
1756 } | 1755 } |
1757 bool HasNoTypeInformation() const { | 1756 bool HasNoTypeInformation() const { |
1758 return IsUninitializedField::decode(bit_field_); | 1757 return IsUninitializedField::decode(bit_field_); |
1759 } | 1758 } |
1760 void set_is_uninitialized(bool b) { | 1759 void set_is_uninitialized(bool b) { |
1761 bit_field_ = IsUninitializedField::update(bit_field_, b); | 1760 bit_field_ = IsUninitializedField::update(bit_field_, b); |
1762 } | 1761 } |
1763 void set_is_string_access(bool b) { | 1762 void set_is_string_access(bool b) { |
1764 bit_field_ = IsStringAccessField::update(bit_field_, b); | 1763 bit_field_ = IsStringAccessField::update(bit_field_, b); |
1765 } | 1764 } |
| 1765 void set_key_type(IcCheckType key_type) { |
| 1766 bit_field_ = KeyTypeField::update(bit_field_, key_type); |
| 1767 } |
1766 void mark_for_call() { | 1768 void mark_for_call() { |
1767 bit_field_ = IsForCallField::update(bit_field_, true); | 1769 bit_field_ = IsForCallField::update(bit_field_, true); |
1768 } | 1770 } |
1769 bool is_for_call() const { return IsForCallField::decode(bit_field_); } | 1771 bool is_for_call() const { return IsForCallField::decode(bit_field_); } |
1770 | 1772 |
1771 bool IsSuperAccess() { | 1773 bool IsSuperAccess() { |
1772 return obj()->IsSuperReference(); | 1774 return obj()->IsSuperReference(); |
1773 } | 1775 } |
1774 | 1776 |
1775 virtual FeedbackVectorRequirements ComputeFeedbackRequirements( | 1777 virtual FeedbackVectorRequirements ComputeFeedbackRequirements( |
(...skipping 22 matching lines...) Expand all Loading... |
1798 obj_(obj), | 1800 obj_(obj), |
1799 key_(key) {} | 1801 key_(key) {} |
1800 static int parent_num_ids() { return Expression::num_ids(); } | 1802 static int parent_num_ids() { return Expression::num_ids(); } |
1801 | 1803 |
1802 private: | 1804 private: |
1803 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 1805 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
1804 | 1806 |
1805 class IsForCallField : public BitField8<bool, 0, 1> {}; | 1807 class IsForCallField : public BitField8<bool, 0, 1> {}; |
1806 class IsUninitializedField : public BitField8<bool, 1, 1> {}; | 1808 class IsUninitializedField : public BitField8<bool, 1, 1> {}; |
1807 class IsStringAccessField : public BitField8<bool, 2, 1> {}; | 1809 class IsStringAccessField : public BitField8<bool, 2, 1> {}; |
| 1810 class KeyTypeField : public BitField8<IcCheckType, 3, 1> {}; |
1808 uint8_t bit_field_; | 1811 uint8_t bit_field_; |
1809 FeedbackVectorICSlot property_feedback_slot_; | 1812 FeedbackVectorICSlot property_feedback_slot_; |
1810 Expression* obj_; | 1813 Expression* obj_; |
1811 Expression* key_; | 1814 Expression* key_; |
1812 SmallMapList receiver_types_; | 1815 SmallMapList receiver_types_; |
1813 }; | 1816 }; |
1814 | 1817 |
1815 | 1818 |
1816 class Call FINAL : public Expression { | 1819 class Call FINAL : public Expression { |
1817 public: | 1820 public: |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3542 | 3545 |
3543 private: | 3546 private: |
3544 Zone* zone_; | 3547 Zone* zone_; |
3545 AstValueFactory* ast_value_factory_; | 3548 AstValueFactory* ast_value_factory_; |
3546 }; | 3549 }; |
3547 | 3550 |
3548 | 3551 |
3549 } } // namespace v8::internal | 3552 } } // namespace v8::internal |
3550 | 3553 |
3551 #endif // V8_AST_H_ | 3554 #endif // V8_AST_H_ |
OLD | NEW |