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