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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 Bind(&miss); | 1387 Bind(&miss); |
1388 { | 1388 { |
1389 Comment("KeyedLoadIC_miss"); | 1389 Comment("KeyedLoadIC_miss"); |
1390 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, p->context, p->receiver, | 1390 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, p->context, p->receiver, |
1391 p->name, p->slot, p->vector); | 1391 p->name, p->slot, p->vector); |
1392 } | 1392 } |
1393 } | 1393 } |
1394 | 1394 |
1395 void AccessorAssemblerImpl::KeyedLoadICGeneric(const LoadICParameters* p) { | 1395 void AccessorAssemblerImpl::KeyedLoadICGeneric(const LoadICParameters* p) { |
1396 Variable var_index(this, MachineType::PointerRepresentation()); | 1396 Variable var_index(this, MachineType::PointerRepresentation()); |
| 1397 Variable var_unique(this, MachineRepresentation::kTagged); |
| 1398 var_unique.Bind(p->name); // Dummy initialization. |
1397 Variable var_details(this, MachineRepresentation::kWord32); | 1399 Variable var_details(this, MachineRepresentation::kWord32); |
1398 Variable var_value(this, MachineRepresentation::kTagged); | 1400 Variable var_value(this, MachineRepresentation::kTagged); |
1399 Label if_index(this), if_unique_name(this), if_element_hole(this), | 1401 Label if_index(this), if_unique_name(this), if_element_hole(this), |
1400 if_oob(this), slow(this), stub_cache_miss(this), | 1402 if_oob(this), slow(this), stub_cache_miss(this), |
1401 if_property_dictionary(this), if_found_on_receiver(this); | 1403 if_property_dictionary(this), if_found_on_receiver(this); |
1402 | 1404 |
1403 Node* receiver = p->receiver; | 1405 Node* receiver = p->receiver; |
1404 GotoIf(TaggedIsSmi(receiver), &slow); | 1406 GotoIf(TaggedIsSmi(receiver), &slow); |
1405 Node* receiver_map = LoadMap(receiver); | 1407 Node* receiver_map = LoadMap(receiver); |
1406 Node* instance_type = LoadMapInstanceType(receiver_map); | 1408 Node* instance_type = LoadMapInstanceType(receiver_map); |
1407 // Receivers requiring non-standard element accesses (interceptors, access | 1409 // Receivers requiring non-standard element accesses (interceptors, access |
1408 // checks, strings and string wrappers, proxies) are handled in the runtime. | 1410 // checks, strings and string wrappers, proxies) are handled in the runtime. |
1409 GotoIf(Int32LessThanOrEqual(instance_type, | 1411 GotoIf(Int32LessThanOrEqual(instance_type, |
1410 Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)), | 1412 Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)), |
1411 &slow); | 1413 &slow); |
1412 | 1414 |
1413 Node* key = p->name; | 1415 TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique, |
1414 TryToName(key, &if_index, &var_index, &if_unique_name, &slow); | 1416 &slow); |
1415 | 1417 |
1416 Bind(&if_index); | 1418 Bind(&if_index); |
1417 { | 1419 { |
1418 Comment("integer index"); | 1420 Comment("integer index"); |
1419 Node* index = var_index.value(); | 1421 Node* index = var_index.value(); |
1420 Node* elements = LoadElements(receiver); | 1422 Node* elements = LoadElements(receiver); |
1421 Node* elements_kind = LoadMapElementsKind(receiver_map); | 1423 Node* elements_kind = LoadMapElementsKind(receiver_map); |
1422 Node* is_jsarray_condition = | 1424 Node* is_jsarray_condition = |
1423 Word32Equal(instance_type, Int32Constant(JS_ARRAY_TYPE)); | 1425 Word32Equal(instance_type, Int32Constant(JS_ARRAY_TYPE)); |
1424 Variable var_double_value(this, MachineRepresentation::kFloat64); | 1426 Variable var_double_value(this, MachineRepresentation::kFloat64); |
(...skipping 28 matching lines...) Expand all Loading... |
1453 BranchIfPrototypesHaveNoElements(receiver_map, &return_undefined, &slow); | 1455 BranchIfPrototypesHaveNoElements(receiver_map, &return_undefined, &slow); |
1454 | 1456 |
1455 Bind(&return_undefined); | 1457 Bind(&return_undefined); |
1456 Return(UndefinedConstant()); | 1458 Return(UndefinedConstant()); |
1457 } | 1459 } |
1458 | 1460 |
1459 Node* properties = nullptr; | 1461 Node* properties = nullptr; |
1460 Bind(&if_unique_name); | 1462 Bind(&if_unique_name); |
1461 { | 1463 { |
1462 Comment("key is unique name"); | 1464 Comment("key is unique name"); |
| 1465 Node* key = var_unique.value(); |
1463 // Check if the receiver has fast or slow properties. | 1466 // Check if the receiver has fast or slow properties. |
1464 properties = LoadProperties(receiver); | 1467 properties = LoadProperties(receiver); |
1465 Node* properties_map = LoadMap(properties); | 1468 Node* properties_map = LoadMap(properties); |
1466 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), | 1469 GotoIf(WordEqual(properties_map, LoadRoot(Heap::kHashTableMapRootIndex)), |
1467 &if_property_dictionary); | 1470 &if_property_dictionary); |
1468 | 1471 |
1469 // Try looking up the property on the receiver; if unsuccessful, look | 1472 // Try looking up the property on the receiver; if unsuccessful, look |
1470 // for a handler in the stub cache. | 1473 // for a handler in the stub cache. |
1471 Comment("DescriptorArray lookup"); | 1474 Comment("DescriptorArray lookup"); |
1472 | 1475 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 } | 1514 } |
1512 } | 1515 } |
1513 } | 1516 } |
1514 | 1517 |
1515 Bind(&if_property_dictionary); | 1518 Bind(&if_property_dictionary); |
1516 { | 1519 { |
1517 Comment("dictionary property load"); | 1520 Comment("dictionary property load"); |
1518 // We checked for LAST_CUSTOM_ELEMENTS_RECEIVER before, which rules out | 1521 // We checked for LAST_CUSTOM_ELEMENTS_RECEIVER before, which rules out |
1519 // seeing global objects here (which would need special handling). | 1522 // seeing global objects here (which would need special handling). |
1520 | 1523 |
| 1524 Node* key = var_unique.value(); |
1521 Variable var_name_index(this, MachineType::PointerRepresentation()); | 1525 Variable var_name_index(this, MachineType::PointerRepresentation()); |
1522 Label dictionary_found(this, &var_name_index); | 1526 Label dictionary_found(this, &var_name_index); |
1523 NameDictionaryLookup<NameDictionary>(properties, key, &dictionary_found, | 1527 NameDictionaryLookup<NameDictionary>(properties, key, &dictionary_found, |
1524 &var_name_index, &slow); | 1528 &var_name_index, &slow); |
1525 Bind(&dictionary_found); | 1529 Bind(&dictionary_found); |
1526 { | 1530 { |
1527 LoadPropertyFromNameDictionary(properties, var_name_index.value(), | 1531 LoadPropertyFromNameDictionary(properties, var_name_index.value(), |
1528 &var_details, &var_value); | 1532 &var_details, &var_value); |
1529 Goto(&if_found_on_receiver); | 1533 Goto(&if_found_on_receiver); |
1530 } | 1534 } |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 void AccessorAssembler::GenerateKeyedStoreICTrampolineTF( | 1924 void AccessorAssembler::GenerateKeyedStoreICTrampolineTF( |
1921 CodeAssemblerState* state, LanguageMode language_mode) { | 1925 CodeAssemblerState* state, LanguageMode language_mode) { |
1922 AccessorAssemblerImpl assembler(state); | 1926 AccessorAssemblerImpl assembler(state); |
1923 assembler.GenerateKeyedStoreICTrampolineTF(language_mode); | 1927 assembler.GenerateKeyedStoreICTrampolineTF(language_mode); |
1924 } | 1928 } |
1925 | 1929 |
1926 #undef ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE | 1930 #undef ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE |
1927 | 1931 |
1928 } // namespace internal | 1932 } // namespace internal |
1929 } // namespace v8 | 1933 } // namespace v8 |
OLD | NEW |