OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 &miss, // When not a number. | 569 &miss, // When not a number. |
570 &miss, // When index out of range. | 570 &miss, // When index out of range. |
571 STRING_INDEX_IS_ARRAY_INDEX); | 571 STRING_INDEX_IS_ARRAY_INDEX); |
572 char_at_generator.GenerateFast(masm); | 572 char_at_generator.GenerateFast(masm); |
573 __ ret(0); | 573 __ ret(0); |
574 | 574 |
575 StubRuntimeCallHelper call_helper; | 575 StubRuntimeCallHelper call_helper; |
576 char_at_generator.GenerateSlow(masm, call_helper); | 576 char_at_generator.GenerateSlow(masm, call_helper); |
577 | 577 |
578 __ bind(&miss); | 578 __ bind(&miss); |
579 GenerateMiss(masm, false); | 579 GenerateMiss(masm, MISS); |
580 } | 580 } |
581 | 581 |
582 | 582 |
583 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 583 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
584 // ----------- S t a t e ------------- | 584 // ----------- S t a t e ------------- |
585 // -- rax : key | 585 // -- rax : key |
586 // -- rdx : receiver | 586 // -- rdx : receiver |
587 // -- rsp[0] : return address | 587 // -- rsp[0] : return address |
588 // ----------------------------------- | 588 // ----------------------------------- |
589 Label slow; | 589 Label slow; |
(...skipping 22 matching lines...) Expand all Loading... |
612 __ push(rcx); // return address | 612 __ push(rcx); // return address |
613 | 613 |
614 // Perform tail call to the entry. | 614 // Perform tail call to the entry. |
615 __ TailCallExternalReference( | 615 __ TailCallExternalReference( |
616 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 616 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
617 masm->isolate()), | 617 masm->isolate()), |
618 2, | 618 2, |
619 1); | 619 1); |
620 | 620 |
621 __ bind(&slow); | 621 __ bind(&slow); |
622 GenerateMiss(masm, false); | 622 GenerateMiss(masm, MISS); |
623 } | 623 } |
624 | 624 |
625 | 625 |
626 static void KeyedStoreGenerateGenericHelper( | 626 static void KeyedStoreGenerateGenericHelper( |
627 MacroAssembler* masm, | 627 MacroAssembler* masm, |
628 Label* fast_object, | 628 Label* fast_object, |
629 Label* fast_double, | 629 Label* fast_double, |
630 Label* slow, | 630 Label* slow, |
631 KeyedStoreCheckMap check_map, | 631 KeyedStoreCheckMap check_map, |
632 KeyedStoreIncrementLength increment_length) { | 632 KeyedStoreIncrementLength increment_length) { |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 __ Ret(); | 1271 __ Ret(); |
1272 __ bind(¬in); | 1272 __ bind(¬in); |
1273 // The unmapped lookup expects that the parameter map is in rbx. | 1273 // The unmapped lookup expects that the parameter map is in rbx. |
1274 Operand unmapped_location = | 1274 Operand unmapped_location = |
1275 GenerateUnmappedArgumentsLookup(masm, rax, rbx, rcx, &slow); | 1275 GenerateUnmappedArgumentsLookup(masm, rax, rbx, rcx, &slow); |
1276 __ CompareRoot(unmapped_location, Heap::kTheHoleValueRootIndex); | 1276 __ CompareRoot(unmapped_location, Heap::kTheHoleValueRootIndex); |
1277 __ j(equal, &slow); | 1277 __ j(equal, &slow); |
1278 __ movq(rax, unmapped_location); | 1278 __ movq(rax, unmapped_location); |
1279 __ Ret(); | 1279 __ Ret(); |
1280 __ bind(&slow); | 1280 __ bind(&slow); |
1281 GenerateMiss(masm, false); | 1281 GenerateMiss(masm, MISS); |
1282 } | 1282 } |
1283 | 1283 |
1284 | 1284 |
1285 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 1285 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { |
1286 // ----------- S t a t e ------------- | 1286 // ----------- S t a t e ------------- |
1287 // -- rax : value | 1287 // -- rax : value |
1288 // -- rcx : key | 1288 // -- rcx : key |
1289 // -- rdx : receiver | 1289 // -- rdx : receiver |
1290 // -- rsp[0] : return address | 1290 // -- rsp[0] : return address |
1291 // ----------------------------------- | 1291 // ----------------------------------- |
(...skipping 18 matching lines...) Expand all Loading... |
1310 __ lea(r9, unmapped_location); | 1310 __ lea(r9, unmapped_location); |
1311 __ movq(r8, rax); | 1311 __ movq(r8, rax); |
1312 __ RecordWrite(rbx, | 1312 __ RecordWrite(rbx, |
1313 r9, | 1313 r9, |
1314 r8, | 1314 r8, |
1315 kDontSaveFPRegs, | 1315 kDontSaveFPRegs, |
1316 EMIT_REMEMBERED_SET, | 1316 EMIT_REMEMBERED_SET, |
1317 INLINE_SMI_CHECK); | 1317 INLINE_SMI_CHECK); |
1318 __ Ret(); | 1318 __ Ret(); |
1319 __ bind(&slow); | 1319 __ bind(&slow); |
1320 GenerateMiss(masm, false); | 1320 GenerateMiss(masm, MISS); |
1321 } | 1321 } |
1322 | 1322 |
1323 | 1323 |
1324 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, | 1324 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, |
1325 int argc) { | 1325 int argc) { |
1326 // ----------- S t a t e ------------- | 1326 // ----------- S t a t e ------------- |
1327 // rcx : function name | 1327 // rcx : function name |
1328 // rsp[0] : return address | 1328 // rsp[0] : return address |
1329 // rsp[8] : argument argc | 1329 // rsp[8] : argument argc |
1330 // rsp[16] : argument argc - 1 | 1330 // rsp[16] : argument argc - 1 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 __ push(rcx); // name | 1404 __ push(rcx); // name |
1405 __ push(rbx); // return address | 1405 __ push(rbx); // return address |
1406 | 1406 |
1407 // Perform tail call to the entry. | 1407 // Perform tail call to the entry. |
1408 ExternalReference ref = | 1408 ExternalReference ref = |
1409 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | 1409 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
1410 __ TailCallExternalReference(ref, 2, 1); | 1410 __ TailCallExternalReference(ref, 2, 1); |
1411 } | 1411 } |
1412 | 1412 |
1413 | 1413 |
1414 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { | 1414 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { |
1415 // ----------- S t a t e ------------- | 1415 // ----------- S t a t e ------------- |
1416 // -- rax : key | 1416 // -- rax : key |
1417 // -- rdx : receiver | 1417 // -- rdx : receiver |
1418 // -- rsp[0] : return address | 1418 // -- rsp[0] : return address |
1419 // ----------------------------------- | 1419 // ----------------------------------- |
1420 | 1420 |
1421 Counters* counters = masm->isolate()->counters(); | 1421 Counters* counters = masm->isolate()->counters(); |
1422 __ IncrementCounter(counters->keyed_load_miss(), 1); | 1422 __ IncrementCounter(counters->keyed_load_miss(), 1); |
1423 | 1423 |
1424 __ pop(rbx); | 1424 __ pop(rbx); |
1425 __ push(rdx); // receiver | 1425 __ push(rdx); // receiver |
1426 __ push(rax); // name | 1426 __ push(rax); // name |
1427 __ push(rbx); // return address | 1427 __ push(rbx); // return address |
1428 | 1428 |
1429 // Perform tail call to the entry. | 1429 // Perform tail call to the entry. |
1430 ExternalReference ref = force_generic | 1430 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC |
1431 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), | 1431 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), |
1432 masm->isolate()) | 1432 masm->isolate()) |
1433 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 1433 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
1434 __ TailCallExternalReference(ref, 2, 1); | 1434 __ TailCallExternalReference(ref, 2, 1); |
1435 } | 1435 } |
1436 | 1436 |
1437 | 1437 |
1438 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1438 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
1439 // ----------- S t a t e ------------- | 1439 // ----------- S t a t e ------------- |
1440 // -- rax : key | 1440 // -- rax : key |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 __ push(rcx); // key | 1631 __ push(rcx); // key |
1632 __ push(rax); // value | 1632 __ push(rax); // value |
1633 __ push(rbx); // return address | 1633 __ push(rbx); // return address |
1634 | 1634 |
1635 // Do tail-call to runtime routine. | 1635 // Do tail-call to runtime routine. |
1636 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); | 1636 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
1637 __ TailCallExternalReference(ref, 3, 1); | 1637 __ TailCallExternalReference(ref, 3, 1); |
1638 } | 1638 } |
1639 | 1639 |
1640 | 1640 |
1641 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { | 1641 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { |
1642 // ----------- S t a t e ------------- | 1642 // ----------- S t a t e ------------- |
1643 // -- rax : value | 1643 // -- rax : value |
1644 // -- rcx : key | 1644 // -- rcx : key |
1645 // -- rdx : receiver | 1645 // -- rdx : receiver |
1646 // -- rsp[0] : return address | 1646 // -- rsp[0] : return address |
1647 // ----------------------------------- | 1647 // ----------------------------------- |
1648 | 1648 |
1649 __ pop(rbx); | 1649 __ pop(rbx); |
1650 __ push(rdx); // receiver | 1650 __ push(rdx); // receiver |
1651 __ push(rcx); // key | 1651 __ push(rcx); // key |
1652 __ push(rax); // value | 1652 __ push(rax); // value |
1653 __ push(rbx); // return address | 1653 __ push(rbx); // return address |
1654 | 1654 |
1655 // Do tail-call to runtime routine. | 1655 // Do tail-call to runtime routine. |
1656 ExternalReference ref = force_generic | 1656 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC |
1657 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), | 1657 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
1658 masm->isolate()) | 1658 masm->isolate()) |
1659 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 1659 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
1660 __ TailCallExternalReference(ref, 3, 1); | 1660 __ TailCallExternalReference(ref, 3, 1); |
1661 } | 1661 } |
1662 | 1662 |
1663 | 1663 |
1664 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { | 1664 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { |
1665 // ----------- S t a t e ------------- | 1665 // ----------- S t a t e ------------- |
1666 // -- rbx : target map | 1666 // -- rbx : target map |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1773 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
1774 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1774 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
1775 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1775 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
1776 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1776 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1777 } | 1777 } |
1778 | 1778 |
1779 | 1779 |
1780 } } // namespace v8::internal | 1780 } } // namespace v8::internal |
1781 | 1781 |
1782 #endif // V8_TARGET_ARCH_X64 | 1782 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |