OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_FIELD_INDEX_H_ | 5 #ifndef V8_FIELD_INDEX_H_ |
6 #define V8_FIELD_INDEX_H_ | 6 #define V8_FIELD_INDEX_H_ |
7 | 7 |
8 #include "src/property-details.h" | 8 #include "src/property-details.h" |
9 #include "src/utils.h" | 9 #include "src/utils.h" |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return result; | 69 return result; |
70 } | 70 } |
71 | 71 |
72 int GetKeyedLookupCacheIndex() const; | 72 int GetKeyedLookupCacheIndex() const; |
73 | 73 |
74 int GetFieldAccessStubKey() const { | 74 int GetFieldAccessStubKey() const { |
75 return bit_field_ & | 75 return bit_field_ & |
76 (IsInObjectBits::kMask | IsDoubleBits::kMask | IndexBits::kMask); | 76 (IsInObjectBits::kMask | IsDoubleBits::kMask | IndexBits::kMask); |
77 } | 77 } |
78 | 78 |
| 79 bool operator==(FieldIndex const& other) const { |
| 80 return bit_field_ == other.bit_field_; |
| 81 } |
| 82 bool operator!=(FieldIndex const& other) const { return !(*this == other); } |
| 83 |
79 // For GetLoadByFieldOffset. | 84 // For GetLoadByFieldOffset. |
80 class FieldOffsetIsInobject : public BitField<bool, 1, 1> {}; | 85 class FieldOffsetIsInobject : public BitField<bool, 1, 1> {}; |
81 class FieldOffsetIsDouble : public BitField<bool, 2, 1> {}; | 86 class FieldOffsetIsDouble : public BitField<bool, 2, 1> {}; |
82 class FieldOffsetOffset : public BitField<int, 3, 27> {}; | 87 class FieldOffsetOffset : public BitField<int, 3, 27> {}; |
83 // Make sure we don't overflow into the sign bit. | 88 // Make sure we don't overflow into the sign bit. |
84 STATIC_ASSERT(FieldOffsetOffset::kNext <= kSmiValueSize - 1); | 89 STATIC_ASSERT(FieldOffsetOffset::kNext <= kSmiValueSize - 1); |
85 | 90 |
86 private: | 91 private: |
87 FieldIndex(bool is_inobject, int local_index, bool is_double, | 92 FieldIndex(bool is_inobject, int local_index, bool is_double, |
88 int inobject_properties, int first_inobject_property_offset, | 93 int inobject_properties, int first_inobject_property_offset, |
(...skipping 30 matching lines...) Expand all Loading... |
119 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; | 124 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; |
120 STATIC_ASSERT(IsHiddenField::kNext <= 32); | 125 STATIC_ASSERT(IsHiddenField::kNext <= 32); |
121 | 126 |
122 int bit_field_; | 127 int bit_field_; |
123 }; | 128 }; |
124 | 129 |
125 } // namespace internal | 130 } // namespace internal |
126 } // namespace v8 | 131 } // namespace v8 |
127 | 132 |
128 #endif | 133 #endif |
OLD | NEW |