OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 &miss, // When not a number. | 703 &miss, // When not a number. |
704 &miss, // When index out of range. | 704 &miss, // When index out of range. |
705 STRING_INDEX_IS_ARRAY_INDEX); | 705 STRING_INDEX_IS_ARRAY_INDEX); |
706 char_at_generator.GenerateFast(masm); | 706 char_at_generator.GenerateFast(masm); |
707 __ ret(0); | 707 __ ret(0); |
708 | 708 |
709 StubRuntimeCallHelper call_helper; | 709 StubRuntimeCallHelper call_helper; |
710 char_at_generator.GenerateSlow(masm, call_helper); | 710 char_at_generator.GenerateSlow(masm, call_helper); |
711 | 711 |
712 __ bind(&miss); | 712 __ bind(&miss); |
713 GenerateMiss(masm); | 713 GenerateMiss(masm, false); |
714 } | 714 } |
715 | 715 |
716 | 716 |
717 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 717 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
718 // ----------- S t a t e ------------- | 718 // ----------- S t a t e ------------- |
719 // -- rax : key | 719 // -- rax : key |
720 // -- rdx : receiver | 720 // -- rdx : receiver |
721 // -- rsp[0] : return address | 721 // -- rsp[0] : return address |
722 // ----------------------------------- | 722 // ----------------------------------- |
723 Label slow; | 723 Label slow; |
(...skipping 22 matching lines...) Expand all Loading... |
746 __ push(rcx); // return address | 746 __ push(rcx); // return address |
747 | 747 |
748 // Perform tail call to the entry. | 748 // Perform tail call to the entry. |
749 __ TailCallExternalReference( | 749 __ TailCallExternalReference( |
750 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 750 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
751 masm->isolate()), | 751 masm->isolate()), |
752 2, | 752 2, |
753 1); | 753 1); |
754 | 754 |
755 __ bind(&slow); | 755 __ bind(&slow); |
756 GenerateMiss(masm); | 756 GenerateMiss(masm, false); |
757 } | 757 } |
758 | 758 |
759 | 759 |
760 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, | 760 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
761 StrictModeFlag strict_mode) { | 761 StrictModeFlag strict_mode) { |
762 // ----------- S t a t e ------------- | 762 // ----------- S t a t e ------------- |
763 // -- rax : value | 763 // -- rax : value |
764 // -- rcx : key | 764 // -- rcx : key |
765 // -- rdx : receiver | 765 // -- rdx : receiver |
766 // -- rsp[0] : return address | 766 // -- rsp[0] : return address |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 __ push(rcx); // name | 1285 __ push(rcx); // name |
1286 __ push(rbx); // return address | 1286 __ push(rbx); // return address |
1287 | 1287 |
1288 // Perform tail call to the entry. | 1288 // Perform tail call to the entry. |
1289 ExternalReference ref = | 1289 ExternalReference ref = |
1290 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | 1290 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
1291 __ TailCallExternalReference(ref, 2, 1); | 1291 __ TailCallExternalReference(ref, 2, 1); |
1292 } | 1292 } |
1293 | 1293 |
1294 | 1294 |
1295 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 1295 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
1296 // ----------- S t a t e ------------- | 1296 // ----------- S t a t e ------------- |
1297 // -- rax : key | 1297 // -- rax : key |
1298 // -- rdx : receiver | 1298 // -- rdx : receiver |
1299 // -- rsp[0] : return address | 1299 // -- rsp[0] : return address |
1300 // ----------------------------------- | 1300 // ----------------------------------- |
1301 | 1301 |
1302 Counters* counters = masm->isolate()->counters(); | 1302 Counters* counters = masm->isolate()->counters(); |
1303 __ IncrementCounter(counters->keyed_load_miss(), 1); | 1303 __ IncrementCounter(counters->keyed_load_miss(), 1); |
1304 | 1304 |
1305 __ pop(rbx); | 1305 __ pop(rbx); |
1306 __ push(rdx); // receiver | 1306 __ push(rdx); // receiver |
1307 __ push(rax); // name | 1307 __ push(rax); // name |
1308 __ push(rbx); // return address | 1308 __ push(rbx); // return address |
1309 | 1309 |
1310 // Perform tail call to the entry. | 1310 // Perform tail call to the entry. |
1311 ExternalReference ref | 1311 ExternalReference ref = force_generic |
1312 = ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 1312 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), |
| 1313 masm->isolate()) |
| 1314 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
1313 __ TailCallExternalReference(ref, 2, 1); | 1315 __ TailCallExternalReference(ref, 2, 1); |
1314 } | 1316 } |
1315 | 1317 |
1316 | 1318 |
1317 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1319 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
1318 // ----------- S t a t e ------------- | 1320 // ----------- S t a t e ------------- |
1319 // -- rax : key | 1321 // -- rax : key |
1320 // -- rdx : receiver | 1322 // -- rdx : receiver |
1321 // -- rsp[0] : return address | 1323 // -- rsp[0] : return address |
1322 // ----------------------------------- | 1324 // ----------------------------------- |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 __ push(rax); // value | 1488 __ push(rax); // value |
1487 __ Push(Smi::FromInt(NONE)); // PropertyAttributes | 1489 __ Push(Smi::FromInt(NONE)); // PropertyAttributes |
1488 __ Push(Smi::FromInt(strict_mode)); // Strict mode. | 1490 __ Push(Smi::FromInt(strict_mode)); // Strict mode. |
1489 __ push(rbx); // return address | 1491 __ push(rbx); // return address |
1490 | 1492 |
1491 // Do tail-call to runtime routine. | 1493 // Do tail-call to runtime routine. |
1492 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); | 1494 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); |
1493 } | 1495 } |
1494 | 1496 |
1495 | 1497 |
1496 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 1498 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
1497 // ----------- S t a t e ------------- | 1499 // ----------- S t a t e ------------- |
1498 // -- rax : value | 1500 // -- rax : value |
1499 // -- rcx : key | 1501 // -- rcx : key |
1500 // -- rdx : receiver | 1502 // -- rdx : receiver |
1501 // -- rsp[0] : return address | 1503 // -- rsp[0] : return address |
1502 // ----------------------------------- | 1504 // ----------------------------------- |
1503 | 1505 |
1504 __ pop(rbx); | 1506 __ pop(rbx); |
1505 __ push(rdx); // receiver | 1507 __ push(rdx); // receiver |
1506 __ push(rcx); // key | 1508 __ push(rcx); // key |
1507 __ push(rax); // value | 1509 __ push(rax); // value |
1508 __ push(rbx); // return address | 1510 __ push(rbx); // return address |
1509 | 1511 |
1510 // Do tail-call to runtime routine. | 1512 // Do tail-call to runtime routine. |
1511 ExternalReference ref = | 1513 ExternalReference ref = force_generic |
1512 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 1514 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
| 1515 masm->isolate()) |
| 1516 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
1513 __ TailCallExternalReference(ref, 3, 1); | 1517 __ TailCallExternalReference(ref, 3, 1); |
1514 } | 1518 } |
1515 | 1519 |
1516 | 1520 |
1517 #undef __ | 1521 #undef __ |
1518 | 1522 |
1519 | 1523 |
1520 Condition CompareIC::ComputeCondition(Token::Value op) { | 1524 Condition CompareIC::ComputeCondition(Token::Value op) { |
1521 switch (op) { | 1525 switch (op) { |
1522 case Token::EQ_STRICT: | 1526 case Token::EQ_STRICT: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1613 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1610 ? not_zero | 1614 ? not_zero |
1611 : zero; | 1615 : zero; |
1612 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1616 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1613 } | 1617 } |
1614 | 1618 |
1615 | 1619 |
1616 } } // namespace v8::internal | 1620 } } // namespace v8::internal |
1617 | 1621 |
1618 #endif // V8_TARGET_ARCH_X64 | 1622 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |