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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 &miss, // When not a number. | 651 &miss, // When not a number. |
652 &miss, // When index out of range. | 652 &miss, // When index out of range. |
653 STRING_INDEX_IS_ARRAY_INDEX); | 653 STRING_INDEX_IS_ARRAY_INDEX); |
654 char_at_generator.GenerateFast(masm); | 654 char_at_generator.GenerateFast(masm); |
655 __ ret(0); | 655 __ ret(0); |
656 | 656 |
657 StubRuntimeCallHelper call_helper; | 657 StubRuntimeCallHelper call_helper; |
658 char_at_generator.GenerateSlow(masm, call_helper); | 658 char_at_generator.GenerateSlow(masm, call_helper); |
659 | 659 |
660 __ bind(&miss); | 660 __ bind(&miss); |
661 GenerateMiss(masm); | 661 GenerateMiss(masm, false); |
662 } | 662 } |
663 | 663 |
664 | 664 |
665 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 665 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
666 // ----------- S t a t e ------------- | 666 // ----------- S t a t e ------------- |
667 // -- rax : key | 667 // -- rax : key |
668 // -- rdx : receiver | 668 // -- rdx : receiver |
669 // -- rsp[0] : return address | 669 // -- rsp[0] : return address |
670 // ----------------------------------- | 670 // ----------------------------------- |
671 Label slow; | 671 Label slow; |
(...skipping 22 matching lines...) Expand all Loading... |
694 __ push(rcx); // return address | 694 __ push(rcx); // return address |
695 | 695 |
696 // Perform tail call to the entry. | 696 // Perform tail call to the entry. |
697 __ TailCallExternalReference( | 697 __ TailCallExternalReference( |
698 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 698 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
699 masm->isolate()), | 699 masm->isolate()), |
700 2, | 700 2, |
701 1); | 701 1); |
702 | 702 |
703 __ bind(&slow); | 703 __ bind(&slow); |
704 GenerateMiss(masm); | 704 GenerateMiss(masm, false); |
705 } | 705 } |
706 | 706 |
707 | 707 |
708 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, | 708 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
709 StrictModeFlag strict_mode) { | 709 StrictModeFlag strict_mode) { |
710 // ----------- S t a t e ------------- | 710 // ----------- S t a t e ------------- |
711 // -- rax : value | 711 // -- rax : value |
712 // -- rcx : key | 712 // -- rcx : key |
713 // -- rdx : receiver | 713 // -- rdx : receiver |
714 // -- rsp[0] : return address | 714 // -- rsp[0] : return address |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 __ push(rcx); // name | 1233 __ push(rcx); // name |
1234 __ push(rbx); // return address | 1234 __ push(rbx); // return address |
1235 | 1235 |
1236 // Perform tail call to the entry. | 1236 // Perform tail call to the entry. |
1237 ExternalReference ref = | 1237 ExternalReference ref = |
1238 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | 1238 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
1239 __ TailCallExternalReference(ref, 2, 1); | 1239 __ TailCallExternalReference(ref, 2, 1); |
1240 } | 1240 } |
1241 | 1241 |
1242 | 1242 |
1243 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 1243 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
1244 // ----------- S t a t e ------------- | 1244 // ----------- S t a t e ------------- |
1245 // -- rax : key | 1245 // -- rax : key |
1246 // -- rdx : receiver | 1246 // -- rdx : receiver |
1247 // -- rsp[0] : return address | 1247 // -- rsp[0] : return address |
1248 // ----------------------------------- | 1248 // ----------------------------------- |
1249 | 1249 |
1250 Counters* counters = masm->isolate()->counters(); | 1250 Counters* counters = masm->isolate()->counters(); |
1251 __ IncrementCounter(counters->keyed_load_miss(), 1); | 1251 __ IncrementCounter(counters->keyed_load_miss(), 1); |
1252 | 1252 |
1253 __ pop(rbx); | 1253 __ pop(rbx); |
1254 __ push(rdx); // receiver | 1254 __ push(rdx); // receiver |
1255 __ push(rax); // name | 1255 __ push(rax); // name |
1256 __ push(rbx); // return address | 1256 __ push(rbx); // return address |
1257 | 1257 |
1258 // Perform tail call to the entry. | 1258 // Perform tail call to the entry. |
1259 ExternalReference ref | 1259 ExternalReference ref = force_generic |
1260 = ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 1260 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), |
| 1261 masm->isolate()) |
| 1262 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
1261 __ TailCallExternalReference(ref, 2, 1); | 1263 __ TailCallExternalReference(ref, 2, 1); |
1262 } | 1264 } |
1263 | 1265 |
1264 | 1266 |
1265 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1267 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
1266 // ----------- S t a t e ------------- | 1268 // ----------- S t a t e ------------- |
1267 // -- rax : key | 1269 // -- rax : key |
1268 // -- rdx : receiver | 1270 // -- rdx : receiver |
1269 // -- rsp[0] : return address | 1271 // -- rsp[0] : return address |
1270 // ----------------------------------- | 1272 // ----------------------------------- |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 __ push(rax); // value | 1436 __ push(rax); // value |
1435 __ Push(Smi::FromInt(NONE)); // PropertyAttributes | 1437 __ Push(Smi::FromInt(NONE)); // PropertyAttributes |
1436 __ Push(Smi::FromInt(strict_mode)); // Strict mode. | 1438 __ Push(Smi::FromInt(strict_mode)); // Strict mode. |
1437 __ push(rbx); // return address | 1439 __ push(rbx); // return address |
1438 | 1440 |
1439 // Do tail-call to runtime routine. | 1441 // Do tail-call to runtime routine. |
1440 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); | 1442 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); |
1441 } | 1443 } |
1442 | 1444 |
1443 | 1445 |
1444 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 1446 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { |
1445 // ----------- S t a t e ------------- | 1447 // ----------- S t a t e ------------- |
1446 // -- rax : value | 1448 // -- rax : value |
1447 // -- rcx : key | 1449 // -- rcx : key |
1448 // -- rdx : receiver | 1450 // -- rdx : receiver |
1449 // -- rsp[0] : return address | 1451 // -- rsp[0] : return address |
1450 // ----------------------------------- | 1452 // ----------------------------------- |
1451 | 1453 |
1452 __ pop(rbx); | 1454 __ pop(rbx); |
1453 __ push(rdx); // receiver | 1455 __ push(rdx); // receiver |
1454 __ push(rcx); // key | 1456 __ push(rcx); // key |
1455 __ push(rax); // value | 1457 __ push(rax); // value |
1456 __ push(rbx); // return address | 1458 __ push(rbx); // return address |
1457 | 1459 |
1458 // Do tail-call to runtime routine. | 1460 // Do tail-call to runtime routine. |
1459 ExternalReference ref = | 1461 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
1460 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | |
1461 __ TailCallExternalReference(ref, 3, 1); | 1462 __ TailCallExternalReference(ref, 3, 1); |
1462 } | 1463 } |
1463 | 1464 |
| 1465 |
| 1466 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
| 1467 // ----------- S t a t e ------------- |
| 1468 // -- rax : value |
| 1469 // -- rcx : key |
| 1470 // -- rdx : receiver |
| 1471 // -- rsp[0] : return address |
| 1472 // ----------------------------------- |
| 1473 |
| 1474 __ pop(rbx); |
| 1475 __ push(rdx); // receiver |
| 1476 __ push(rcx); // key |
| 1477 __ push(rax); // value |
| 1478 __ push(rbx); // return address |
| 1479 |
| 1480 // Do tail-call to runtime routine. |
| 1481 ExternalReference ref = force_generic |
| 1482 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
| 1483 masm->isolate()) |
| 1484 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
| 1485 __ TailCallExternalReference(ref, 3, 1); |
| 1486 } |
| 1487 |
1464 | 1488 |
1465 #undef __ | 1489 #undef __ |
1466 | 1490 |
1467 | 1491 |
1468 Condition CompareIC::ComputeCondition(Token::Value op) { | 1492 Condition CompareIC::ComputeCondition(Token::Value op) { |
1469 switch (op) { | 1493 switch (op) { |
1470 case Token::EQ_STRICT: | 1494 case Token::EQ_STRICT: |
1471 case Token::EQ: | 1495 case Token::EQ: |
1472 return equal; | 1496 return equal; |
1473 case Token::LT: | 1497 case Token::LT: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1581 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1558 ? not_zero | 1582 ? not_zero |
1559 : zero; | 1583 : zero; |
1560 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1584 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1561 } | 1585 } |
1562 | 1586 |
1563 | 1587 |
1564 } } // namespace v8::internal | 1588 } } // namespace v8::internal |
1565 | 1589 |
1566 #endif // V8_TARGET_ARCH_X64 | 1590 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |