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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 inline FieldIndex FieldIndex::ForDescriptor(Map* map, int descriptor_index) { | 68 inline FieldIndex FieldIndex::ForDescriptor(Map* map, int descriptor_index) { |
69 PropertyDetails details = | 69 PropertyDetails details = |
70 map->instance_descriptors()->GetDetails(descriptor_index); | 70 map->instance_descriptors()->GetDetails(descriptor_index); |
71 int field_index = | 71 int field_index = |
72 map->instance_descriptors()->GetFieldIndex(descriptor_index); | 72 map->instance_descriptors()->GetFieldIndex(descriptor_index); |
73 return ForPropertyIndex(map, field_index, | 73 return ForPropertyIndex(map, field_index, |
74 details.representation().IsDouble()); | 74 details.representation().IsDouble()); |
75 } | 75 } |
76 | 76 |
77 | 77 |
78 inline FieldIndex FieldIndex::ForKeyedLookupCacheIndex(Map* map, int index) { | |
79 if (FLAG_compiled_keyed_generic_loads) { | |
80 return ForLoadByFieldIndex(map, index); | |
81 } else { | |
82 return ForPropertyIndex(map, index); | |
83 } | |
84 } | |
85 | |
86 | |
87 inline int FieldIndex::GetKeyedLookupCacheIndex() const { | |
88 if (FLAG_compiled_keyed_generic_loads) { | |
89 return GetLoadByFieldIndex(); | |
90 } else { | |
91 return property_index(); | |
92 } | |
93 } | |
94 | |
95 | |
96 } } // namespace v8::internal | 78 } } // namespace v8::internal |
97 | 79 |
98 #endif | 80 #endif |
OLD | NEW |