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 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 slow); | 1162 slow); |
1163 | 1163 |
1164 // Check if the receiver has fast or slow properties. | 1164 // Check if the receiver has fast or slow properties. |
1165 Node* properties = LoadProperties(receiver); | 1165 Node* properties = LoadProperties(receiver); |
1166 Node* properties_map = LoadMap(properties); | 1166 Node* properties_map = LoadMap(properties); |
1167 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), | 1167 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), |
1168 &if_property_dictionary); | 1168 &if_property_dictionary); |
1169 | 1169 |
1170 // Try looking up the property on the receiver; if unsuccessful, look | 1170 // Try looking up the property on the receiver; if unsuccessful, look |
1171 // for a handler in the stub cache. | 1171 // for a handler in the stub cache. |
1172 Comment("DescriptorArray lookup"); | 1172 Node* bitfield3 = LoadMapBitField3(receiver_map); |
| 1173 Node* descriptors = LoadMapDescriptors(receiver_map); |
1173 | 1174 |
1174 // Skip linear search if there are too many descriptors. | 1175 Label if_descriptor_found(this), stub_cache(this); |
1175 // TODO(jkummerow): Consider implementing binary search. | |
1176 // See also TryLookupProperty() which has the same limitation. | |
1177 const int32_t kMaxLinear = 210; | |
1178 Label stub_cache(this); | |
1179 Node* bitfield3 = LoadMapBitField3(receiver_map); | |
1180 Node* nof = DecodeWordFromWord32<Map::NumberOfOwnDescriptorsBits>(bitfield3); | |
1181 GotoIf(UintPtrLessThan(IntPtrConstant(kMaxLinear), nof), &stub_cache); | |
1182 Node* descriptors = LoadMapDescriptors(receiver_map); | |
1183 Variable var_name_index(this, MachineType::PointerRepresentation()); | 1176 Variable var_name_index(this, MachineType::PointerRepresentation()); |
1184 Label if_descriptor_found(this); | 1177 DescriptorLookup(key, descriptors, bitfield3, &if_descriptor_found, |
1185 DescriptorLookupLinear(key, descriptors, nof, &if_descriptor_found, | 1178 &var_name_index, &stub_cache); |
1186 &var_name_index, &stub_cache); | |
1187 | 1179 |
1188 Bind(&if_descriptor_found); | 1180 Bind(&if_descriptor_found); |
1189 { | 1181 { |
1190 LoadPropertyFromFastObject(receiver, receiver_map, descriptors, | 1182 LoadPropertyFromFastObject(receiver, receiver_map, descriptors, |
1191 var_name_index.value(), &var_details, | 1183 var_name_index.value(), &var_details, |
1192 &var_value); | 1184 &var_value); |
1193 Goto(&if_found_on_receiver); | 1185 Goto(&if_found_on_receiver); |
1194 } | 1186 } |
1195 | 1187 |
1196 Bind(&stub_cache); | 1188 Bind(&stub_cache); |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1948 Node* slot = Parameter(Descriptor::kSlot); | 1940 Node* slot = Parameter(Descriptor::kSlot); |
1949 Node* context = Parameter(Descriptor::kContext); | 1941 Node* context = Parameter(Descriptor::kContext); |
1950 Node* vector = LoadFeedbackVectorForStub(); | 1942 Node* vector = LoadFeedbackVectorForStub(); |
1951 | 1943 |
1952 StoreICParameters p(context, receiver, name, value, slot, vector); | 1944 StoreICParameters p(context, receiver, name, value, slot, vector); |
1953 KeyedStoreIC(&p, language_mode); | 1945 KeyedStoreIC(&p, language_mode); |
1954 } | 1946 } |
1955 | 1947 |
1956 } // namespace internal | 1948 } // namespace internal |
1957 } // namespace v8 | 1949 } // namespace v8 |
OLD | NEW |