| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 DCHECK(!IsHiddenField::decode(bit_field_)); | 58 DCHECK(!IsHiddenField::decode(bit_field_)); |
| 59 int result = index() - first_inobject_property_offset() / kPointerSize; | 59 int result = index() - first_inobject_property_offset() / kPointerSize; |
| 60 if (!is_inobject()) { | 60 if (!is_inobject()) { |
| 61 result += InObjectPropertyBits::decode(bit_field_); | 61 result += InObjectPropertyBits::decode(bit_field_); |
| 62 } | 62 } |
| 63 return result; | 63 return result; |
| 64 } | 64 } |
| 65 | 65 |
| 66 int GetKeyedLookupCacheIndex() const; | 66 int GetKeyedLookupCacheIndex() const; |
| 67 | 67 |
| 68 int GetLoadFieldStubKey() const { | 68 int GetFieldAccessStubKey() const { |
| 69 return bit_field_ & | 69 return bit_field_ & |
| 70 (IsInObjectBits::kMask | IsDoubleBits::kMask | IndexBits::kMask); | 70 (IsInObjectBits::kMask | IsDoubleBits::kMask | IndexBits::kMask); |
| 71 } | 71 } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 FieldIndex(bool is_inobject, int local_index, bool is_double, | 74 FieldIndex(bool is_inobject, int local_index, bool is_double, |
| 75 int inobject_properties, int first_inobject_property_offset, | 75 int inobject_properties, int first_inobject_property_offset, |
| 76 bool is_hidden = false) { | 76 bool is_hidden = false) { |
| 77 DCHECK((first_inobject_property_offset & (kPointerSize - 1)) == 0); | 77 DCHECK((first_inobject_property_offset & (kPointerSize - 1)) == 0); |
| 78 bit_field_ = IsInObjectBits::encode(is_inobject) | | 78 bit_field_ = IsInObjectBits::encode(is_inobject) | |
| (...skipping 24 matching lines...) Expand all Loading... |
| 103 class IsHiddenField | 103 class IsHiddenField |
| 104 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; | 104 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; |
| 105 STATIC_ASSERT(IsHiddenField::kNext <= 32); | 105 STATIC_ASSERT(IsHiddenField::kNext <= 32); |
| 106 | 106 |
| 107 int bit_field_; | 107 int bit_field_; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } } // namespace v8::internal | 110 } } // namespace v8::internal |
| 111 | 111 |
| 112 #endif | 112 #endif |
| OLD | NEW |