| 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 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 class LookupIterator; |
| 14 class Map; | 15 class Map; |
| 15 | 16 |
| 16 // Wrapper class to hold a field index, usually but not necessarily generated | 17 // Wrapper class to hold a field index, usually but not necessarily generated |
| 17 // from a property index. When available, the wrapper class captures additional | 18 // from a property index. When available, the wrapper class captures additional |
| 18 // information to allow the field index to be translated back into the property | 19 // information to allow the field index to be translated back into the property |
| 19 // index it was originally generated from. | 20 // index it was originally generated from. |
| 20 class FieldIndex V8_FINAL { | 21 class FieldIndex V8_FINAL { |
| 21 public: | 22 public: |
| 22 static FieldIndex ForPropertyIndex(Map* map, | 23 static FieldIndex ForPropertyIndex(Map* map, |
| 23 int index, | 24 int index, |
| 24 bool is_double = false); | 25 bool is_double = false); |
| 25 static FieldIndex ForInObjectOffset(int offset, Map* map = NULL); | 26 static FieldIndex ForInObjectOffset(int offset, Map* map = NULL); |
| 26 static FieldIndex ForLookupResult(const LookupResult* result); | 27 static FieldIndex ForLookupResult(const LookupResult* result); |
| 28 static FieldIndex ForLookupIterator(const LookupIterator* lookup); |
| 27 static FieldIndex ForDescriptor(Map* map, int descriptor_index); | 29 static FieldIndex ForDescriptor(Map* map, int descriptor_index); |
| 28 static FieldIndex ForLoadByFieldIndex(Map* map, int index); | 30 static FieldIndex ForLoadByFieldIndex(Map* map, int index); |
| 29 static FieldIndex ForKeyedLookupCacheIndex(Map* map, int index); | 31 static FieldIndex ForKeyedLookupCacheIndex(Map* map, int index); |
| 30 | 32 |
| 31 int GetLoadByFieldIndex() const; | 33 int GetLoadByFieldIndex() const; |
| 32 | 34 |
| 33 bool is_inobject() const { | 35 bool is_inobject() const { |
| 34 return IsInObjectBits::decode(bit_field_); | 36 return IsInObjectBits::decode(bit_field_); |
| 35 } | 37 } |
| 36 | 38 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 class IsHiddenField: | 105 class IsHiddenField: |
| 104 public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; | 106 public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; |
| 105 STATIC_ASSERT(IsHiddenField::kNext <= 32); | 107 STATIC_ASSERT(IsHiddenField::kNext <= 32); |
| 106 | 108 |
| 107 int bit_field_; | 109 int bit_field_; |
| 108 }; | 110 }; |
| 109 | 111 |
| 110 } } // namespace v8::internal | 112 } } // namespace v8::internal |
| 111 | 113 |
| 112 #endif | 114 #endif |
| OLD | NEW |