| 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_INL_H_ | 5 #ifndef V8_FIELD_INDEX_INL_H_ |
| 6 #define V8_FIELD_INDEX_INL_H_ | 6 #define V8_FIELD_INDEX_INL_H_ |
| 7 | 7 |
| 8 #include "src/field-index.h" | 8 #include "src/field-index.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 inline FieldIndex FieldIndex::ForDescriptor(Map* map, int descriptor_index) { | 87 inline FieldIndex FieldIndex::ForDescriptor(Map* map, int descriptor_index) { |
| 88 PropertyDetails details = | 88 PropertyDetails details = |
| 89 map->instance_descriptors()->GetDetails(descriptor_index); | 89 map->instance_descriptors()->GetDetails(descriptor_index); |
| 90 int field_index = details.field_index(); | 90 int field_index = details.field_index(); |
| 91 return ForPropertyIndex(map, field_index, | 91 return ForPropertyIndex(map, field_index, |
| 92 details.representation().IsDouble()); | 92 details.representation().IsDouble()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 | |
| 96 inline FieldIndex FieldIndex::ForKeyedLookupCacheIndex(Map* map, int index) { | |
| 97 if (FLAG_compiled_keyed_generic_loads) { | |
| 98 return ForLoadByFieldIndex(map, index); | |
| 99 } else { | |
| 100 return ForPropertyIndex(map, index); | |
| 101 } | |
| 102 } | |
| 103 | |
| 104 | |
| 105 inline FieldIndex FieldIndex::FromFieldAccessStubKey(int key) { | 95 inline FieldIndex FieldIndex::FromFieldAccessStubKey(int key) { |
| 106 return FieldIndex(key); | 96 return FieldIndex(key); |
| 107 } | 97 } |
| 108 | 98 |
| 109 | |
| 110 inline int FieldIndex::GetKeyedLookupCacheIndex() const { | |
| 111 if (FLAG_compiled_keyed_generic_loads) { | |
| 112 return GetLoadByFieldIndex(); | |
| 113 } else { | |
| 114 return property_index(); | |
| 115 } | |
| 116 } | |
| 117 | |
| 118 | |
| 119 } // namespace internal | 99 } // namespace internal |
| 120 } // namespace v8 | 100 } // namespace v8 |
| 121 | 101 |
| 122 #endif | 102 #endif |
| OLD | NEW |