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 #include "src/ic/accessor-assembler-impl.h" | 6 #include "src/ic/accessor-assembler-impl.h" |
7 | 7 |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/ic/handler-configuration.h" | 10 #include "src/ic/handler-configuration.h" |
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 Bind(&miss); | 1294 Bind(&miss); |
1295 { | 1295 { |
1296 Comment("KeyedLoadIC_miss"); | 1296 Comment("KeyedLoadIC_miss"); |
1297 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, p->context, p->receiver, | 1297 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, p->context, p->receiver, |
1298 p->name, p->slot, p->vector); | 1298 p->name, p->slot, p->vector); |
1299 } | 1299 } |
1300 } | 1300 } |
1301 | 1301 |
1302 void AccessorAssemblerImpl::KeyedLoadICGeneric(const LoadICParameters* p) { | 1302 void AccessorAssemblerImpl::KeyedLoadICGeneric(const LoadICParameters* p) { |
1303 Variable var_index(this, MachineType::PointerRepresentation()); | 1303 Variable var_index(this, MachineType::PointerRepresentation()); |
1304 Variable var_unique(this, MachineRepresentation::kTagged); | |
1305 var_unique.Bind(p->name); // Dummy initialization. | |
1306 Variable var_details(this, MachineRepresentation::kWord32); | 1304 Variable var_details(this, MachineRepresentation::kWord32); |
1307 Variable var_value(this, MachineRepresentation::kTagged); | 1305 Variable var_value(this, MachineRepresentation::kTagged); |
1308 Label if_index(this), if_unique_name(this), if_element_hole(this), | 1306 Label if_index(this), if_unique_name(this), if_element_hole(this), |
1309 if_oob(this), slow(this), stub_cache_miss(this), | 1307 if_oob(this), slow(this), stub_cache_miss(this), |
1310 if_property_dictionary(this), if_found_on_receiver(this); | 1308 if_property_dictionary(this), if_found_on_receiver(this); |
1311 | 1309 |
1312 Node* receiver = p->receiver; | 1310 Node* receiver = p->receiver; |
1313 GotoIf(TaggedIsSmi(receiver), &slow); | 1311 GotoIf(TaggedIsSmi(receiver), &slow); |
1314 Node* receiver_map = LoadMap(receiver); | 1312 Node* receiver_map = LoadMap(receiver); |
1315 Node* instance_type = LoadMapInstanceType(receiver_map); | 1313 Node* instance_type = LoadMapInstanceType(receiver_map); |
1316 // Receivers requiring non-standard element accesses (interceptors, access | 1314 // Receivers requiring non-standard element accesses (interceptors, access |
1317 // checks, strings and string wrappers, proxies) are handled in the runtime. | 1315 // checks, strings and string wrappers, proxies) are handled in the runtime. |
1318 GotoIf(Int32LessThanOrEqual(instance_type, | 1316 GotoIf(Int32LessThanOrEqual(instance_type, |
1319 Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)), | 1317 Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)), |
1320 &slow); | 1318 &slow); |
1321 | 1319 |
1322 TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique, | 1320 Node* key = p->name; |
1323 &slow); | 1321 TryToName(key, &if_index, &var_index, &if_unique_name, &slow); |
1324 | 1322 |
1325 Bind(&if_index); | 1323 Bind(&if_index); |
1326 { | 1324 { |
1327 Comment("integer index"); | 1325 Comment("integer index"); |
1328 Node* index = var_index.value(); | 1326 Node* index = var_index.value(); |
1329 Node* elements = LoadElements(receiver); | 1327 Node* elements = LoadElements(receiver); |
1330 Node* elements_kind = LoadMapElementsKind(receiver_map); | 1328 Node* elements_kind = LoadMapElementsKind(receiver_map); |
1331 Node* is_jsarray_condition = | 1329 Node* is_jsarray_condition = |
1332 Word32Equal(instance_type, Int32Constant(JS_ARRAY_TYPE)); | 1330 Word32Equal(instance_type, Int32Constant(JS_ARRAY_TYPE)); |
1333 Variable var_double_value(this, MachineRepresentation::kFloat64); | 1331 Variable var_double_value(this, MachineRepresentation::kFloat64); |
(...skipping 28 matching lines...) Expand all Loading... |
1362 BranchIfPrototypesHaveNoElements(receiver_map, &return_undefined, &slow); | 1360 BranchIfPrototypesHaveNoElements(receiver_map, &return_undefined, &slow); |
1363 | 1361 |
1364 Bind(&return_undefined); | 1362 Bind(&return_undefined); |
1365 Return(UndefinedConstant()); | 1363 Return(UndefinedConstant()); |
1366 } | 1364 } |
1367 | 1365 |
1368 Node* properties = nullptr; | 1366 Node* properties = nullptr; |
1369 Bind(&if_unique_name); | 1367 Bind(&if_unique_name); |
1370 { | 1368 { |
1371 Comment("key is unique name"); | 1369 Comment("key is unique name"); |
1372 Node* key = var_unique.value(); | |
1373 // Check if the receiver has fast or slow properties. | 1370 // Check if the receiver has fast or slow properties. |
1374 properties = LoadProperties(receiver); | 1371 properties = LoadProperties(receiver); |
1375 Node* properties_map = LoadMap(properties); | 1372 Node* properties_map = LoadMap(properties); |
1376 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), | 1373 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), |
1377 &if_property_dictionary); | 1374 &if_property_dictionary); |
1378 | 1375 |
1379 // Try looking up the property on the receiver; if unsuccessful, look | 1376 // Try looking up the property on the receiver; if unsuccessful, look |
1380 // for a handler in the stub cache. | 1377 // for a handler in the stub cache. |
1381 Comment("DescriptorArray lookup"); | 1378 Comment("DescriptorArray lookup"); |
1382 | 1379 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 } | 1418 } |
1422 } | 1419 } |
1423 } | 1420 } |
1424 | 1421 |
1425 Bind(&if_property_dictionary); | 1422 Bind(&if_property_dictionary); |
1426 { | 1423 { |
1427 Comment("dictionary property load"); | 1424 Comment("dictionary property load"); |
1428 // We checked for LAST_CUSTOM_ELEMENTS_RECEIVER before, which rules out | 1425 // We checked for LAST_CUSTOM_ELEMENTS_RECEIVER before, which rules out |
1429 // seeing global objects here (which would need special handling). | 1426 // seeing global objects here (which would need special handling). |
1430 | 1427 |
1431 Node* key = var_unique.value(); | |
1432 Variable var_name_index(this, MachineType::PointerRepresentation()); | 1428 Variable var_name_index(this, MachineType::PointerRepresentation()); |
1433 Label dictionary_found(this, &var_name_index); | 1429 Label dictionary_found(this, &var_name_index); |
1434 NameDictionaryLookup<NameDictionary>(properties, key, &dictionary_found, | 1430 NameDictionaryLookup<NameDictionary>(properties, key, &dictionary_found, |
1435 &var_name_index, &slow); | 1431 &var_name_index, &slow); |
1436 Bind(&dictionary_found); | 1432 Bind(&dictionary_found); |
1437 { | 1433 { |
1438 LoadPropertyFromNameDictionary(properties, var_name_index.value(), | 1434 LoadPropertyFromNameDictionary(properties, var_name_index.value(), |
1439 &var_details, &var_value); | 1435 &var_details, &var_value); |
1440 Goto(&if_found_on_receiver); | 1436 Goto(&if_found_on_receiver); |
1441 } | 1437 } |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 void AccessorAssembler::GenerateKeyedStoreICTrampolineTF( | 1827 void AccessorAssembler::GenerateKeyedStoreICTrampolineTF( |
1832 CodeAssemblerState* state, LanguageMode language_mode) { | 1828 CodeAssemblerState* state, LanguageMode language_mode) { |
1833 AccessorAssemblerImpl assembler(state); | 1829 AccessorAssemblerImpl assembler(state); |
1834 assembler.GenerateKeyedStoreICTrampolineTF(language_mode); | 1830 assembler.GenerateKeyedStoreICTrampolineTF(language_mode); |
1835 } | 1831 } |
1836 | 1832 |
1837 #undef ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE | 1833 #undef ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE |
1838 | 1834 |
1839 } // namespace internal | 1835 } // namespace internal |
1840 } // namespace v8 | 1836 } // namespace v8 |
OLD | NEW |