OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/ic/accessor-assembler.h" | 5 #include "src/ic/accessor-assembler.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/ic/handler-configuration.h" | 9 #include "src/ic/handler-configuration.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 slow); | 1167 slow); |
1168 | 1168 |
1169 // Check if the receiver has fast or slow properties. | 1169 // Check if the receiver has fast or slow properties. |
1170 Node* properties = LoadProperties(receiver); | 1170 Node* properties = LoadProperties(receiver); |
1171 Node* properties_map = LoadMap(properties); | 1171 Node* properties_map = LoadMap(properties); |
1172 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), | 1172 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), |
1173 &if_property_dictionary); | 1173 &if_property_dictionary); |
1174 | 1174 |
1175 // Try looking up the property on the receiver; if unsuccessful, look | 1175 // Try looking up the property on the receiver; if unsuccessful, look |
1176 // for a handler in the stub cache. | 1176 // for a handler in the stub cache. |
1177 Comment("DescriptorArray lookup"); | 1177 Node* bitfield3 = LoadMapBitField3(receiver_map); |
| 1178 Node* descriptors = LoadMapDescriptors(receiver_map); |
1178 | 1179 |
1179 // Skip linear search if there are too many descriptors. | 1180 Label if_descriptor_found(this), stub_cache(this); |
1180 // TODO(jkummerow): Consider implementing binary search. | |
1181 // See also TryLookupProperty() which has the same limitation. | |
1182 const int32_t kMaxLinear = 210; | |
1183 Label stub_cache(this); | |
1184 Node* bitfield3 = LoadMapBitField3(receiver_map); | |
1185 Node* nof = DecodeWordFromWord32<Map::NumberOfOwnDescriptorsBits>(bitfield3); | |
1186 GotoIf(UintPtrLessThan(IntPtrConstant(kMaxLinear), nof), &stub_cache); | |
1187 Node* descriptors = LoadMapDescriptors(receiver_map); | |
1188 Variable var_name_index(this, MachineType::PointerRepresentation()); | 1181 Variable var_name_index(this, MachineType::PointerRepresentation()); |
1189 Label if_descriptor_found(this); | 1182 DescriptorLookup(key, descriptors, bitfield3, &if_descriptor_found, |
1190 DescriptorLookupLinear(key, descriptors, nof, &if_descriptor_found, | 1183 &var_name_index, &stub_cache); |
1191 &var_name_index, &stub_cache); | |
1192 | 1184 |
1193 Bind(&if_descriptor_found); | 1185 Bind(&if_descriptor_found); |
1194 { | 1186 { |
1195 LoadPropertyFromFastObject(receiver, receiver_map, descriptors, | 1187 LoadPropertyFromFastObject(receiver, receiver_map, descriptors, |
1196 var_name_index.value(), &var_details, | 1188 var_name_index.value(), &var_details, |
1197 &var_value); | 1189 &var_value); |
1198 Goto(&if_found_on_receiver); | 1190 Goto(&if_found_on_receiver); |
1199 } | 1191 } |
1200 | 1192 |
1201 Bind(&stub_cache); | 1193 Bind(&stub_cache); |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 Node* slot = Parameter(Descriptor::kSlot); | 1973 Node* slot = Parameter(Descriptor::kSlot); |
1982 Node* context = Parameter(Descriptor::kContext); | 1974 Node* context = Parameter(Descriptor::kContext); |
1983 Node* vector = LoadFeedbackVectorForStub(); | 1975 Node* vector = LoadFeedbackVectorForStub(); |
1984 | 1976 |
1985 StoreICParameters p(context, receiver, name, value, slot, vector); | 1977 StoreICParameters p(context, receiver, name, value, slot, vector); |
1986 KeyedStoreIC(&p, language_mode); | 1978 KeyedStoreIC(&p, language_mode); |
1987 } | 1979 } |
1988 | 1980 |
1989 } // namespace internal | 1981 } // namespace internal |
1990 } // namespace v8 | 1982 } // namespace v8 |
OLD | NEW |