| 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 &miss, // When not a number. | 697 &miss, // When not a number. |
| 698 &miss, // When index out of range. | 698 &miss, // When index out of range. |
| 699 STRING_INDEX_IS_ARRAY_INDEX); | 699 STRING_INDEX_IS_ARRAY_INDEX); |
| 700 char_at_generator.GenerateFast(masm); | 700 char_at_generator.GenerateFast(masm); |
| 701 __ ret(0); | 701 __ ret(0); |
| 702 | 702 |
| 703 StubRuntimeCallHelper call_helper; | 703 StubRuntimeCallHelper call_helper; |
| 704 char_at_generator.GenerateSlow(masm, call_helper); | 704 char_at_generator.GenerateSlow(masm, call_helper); |
| 705 | 705 |
| 706 __ bind(&miss); | 706 __ bind(&miss); |
| 707 GenerateMiss(masm); | 707 GenerateMiss(masm, false); |
| 708 } | 708 } |
| 709 | 709 |
| 710 | 710 |
| 711 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 711 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
| 712 // ----------- S t a t e ------------- | 712 // ----------- S t a t e ------------- |
| 713 // -- eax : key | 713 // -- eax : key |
| 714 // -- edx : receiver | 714 // -- edx : receiver |
| 715 // -- esp[0] : return address | 715 // -- esp[0] : return address |
| 716 // ----------------------------------- | 716 // ----------------------------------- |
| 717 Label slow; | 717 Label slow; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 740 __ push(eax); // key | 740 __ push(eax); // key |
| 741 __ push(ecx); // return address | 741 __ push(ecx); // return address |
| 742 | 742 |
| 743 // Perform tail call to the entry. | 743 // Perform tail call to the entry. |
| 744 ExternalReference ref = | 744 ExternalReference ref = |
| 745 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 745 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
| 746 masm->isolate()); | 746 masm->isolate()); |
| 747 __ TailCallExternalReference(ref, 2, 1); | 747 __ TailCallExternalReference(ref, 2, 1); |
| 748 | 748 |
| 749 __ bind(&slow); | 749 __ bind(&slow); |
| 750 GenerateMiss(masm); | 750 GenerateMiss(masm, false); |
| 751 } | 751 } |
| 752 | 752 |
| 753 | 753 |
| 754 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, | 754 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
| 755 StrictModeFlag strict_mode) { | 755 StrictModeFlag strict_mode) { |
| 756 // ----------- S t a t e ------------- | 756 // ----------- S t a t e ------------- |
| 757 // -- eax : value | 757 // -- eax : value |
| 758 // -- ecx : key | 758 // -- ecx : key |
| 759 // -- edx : receiver | 759 // -- edx : receiver |
| 760 // -- esp[0] : return address | 760 // -- esp[0] : return address |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 __ push(ecx); // name | 1260 __ push(ecx); // name |
| 1261 __ push(ebx); // return address | 1261 __ push(ebx); // return address |
| 1262 | 1262 |
| 1263 // Perform tail call to the entry. | 1263 // Perform tail call to the entry. |
| 1264 ExternalReference ref = | 1264 ExternalReference ref = |
| 1265 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | 1265 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
| 1266 __ TailCallExternalReference(ref, 2, 1); | 1266 __ TailCallExternalReference(ref, 2, 1); |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 | 1269 |
| 1270 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 1270 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
| 1271 // ----------- S t a t e ------------- | 1271 // ----------- S t a t e ------------- |
| 1272 // -- eax : key | 1272 // -- eax : key |
| 1273 // -- edx : receiver | 1273 // -- edx : receiver |
| 1274 // -- esp[0] : return address | 1274 // -- esp[0] : return address |
| 1275 // ----------------------------------- | 1275 // ----------------------------------- |
| 1276 | 1276 |
| 1277 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); | 1277 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); |
| 1278 | 1278 |
| 1279 __ pop(ebx); | 1279 __ pop(ebx); |
| 1280 __ push(edx); // receiver | 1280 __ push(edx); // receiver |
| 1281 __ push(eax); // name | 1281 __ push(eax); // name |
| 1282 __ push(ebx); // return address | 1282 __ push(ebx); // return address |
| 1283 | 1283 |
| 1284 // Perform tail call to the entry. | 1284 // Perform tail call to the entry. |
| 1285 ExternalReference ref = | 1285 ExternalReference ref = force_generic |
| 1286 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 1286 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), |
| 1287 masm->isolate()) |
| 1288 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
| 1287 __ TailCallExternalReference(ref, 2, 1); | 1289 __ TailCallExternalReference(ref, 2, 1); |
| 1288 } | 1290 } |
| 1289 | 1291 |
| 1290 | 1292 |
| 1291 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1293 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| 1292 // ----------- S t a t e ------------- | 1294 // ----------- S t a t e ------------- |
| 1293 // -- eax : key | 1295 // -- eax : key |
| 1294 // -- edx : receiver | 1296 // -- edx : receiver |
| 1295 // -- esp[0] : return address | 1297 // -- esp[0] : return address |
| 1296 // ----------------------------------- | 1298 // ----------------------------------- |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 __ push(eax); | 1470 __ push(eax); |
| 1469 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes | 1471 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes |
| 1470 __ push(Immediate(Smi::FromInt(strict_mode))); // Strict mode. | 1472 __ push(Immediate(Smi::FromInt(strict_mode))); // Strict mode. |
| 1471 __ push(ebx); // return address | 1473 __ push(ebx); // return address |
| 1472 | 1474 |
| 1473 // Do tail-call to runtime routine. | 1475 // Do tail-call to runtime routine. |
| 1474 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); | 1476 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); |
| 1475 } | 1477 } |
| 1476 | 1478 |
| 1477 | 1479 |
| 1478 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 1480 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
| 1479 // ----------- S t a t e ------------- | 1481 // ----------- S t a t e ------------- |
| 1480 // -- eax : value | 1482 // -- eax : value |
| 1481 // -- ecx : key | 1483 // -- ecx : key |
| 1482 // -- edx : receiver | 1484 // -- edx : receiver |
| 1483 // -- esp[0] : return address | 1485 // -- esp[0] : return address |
| 1484 // ----------------------------------- | 1486 // ----------------------------------- |
| 1485 | 1487 |
| 1486 __ pop(ebx); | 1488 __ pop(ebx); |
| 1487 __ push(edx); | 1489 __ push(edx); |
| 1488 __ push(ecx); | 1490 __ push(ecx); |
| 1489 __ push(eax); | 1491 __ push(eax); |
| 1490 __ push(ebx); | 1492 __ push(ebx); |
| 1491 | 1493 |
| 1492 // Do tail-call to runtime routine. | 1494 // Do tail-call to runtime routine. |
| 1493 ExternalReference ref = | 1495 ExternalReference ref = force_generic |
| 1494 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 1496 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
| 1497 masm->isolate()) |
| 1498 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
| 1495 __ TailCallExternalReference(ref, 3, 1); | 1499 __ TailCallExternalReference(ref, 3, 1); |
| 1496 } | 1500 } |
| 1497 | 1501 |
| 1498 | 1502 |
| 1499 #undef __ | 1503 #undef __ |
| 1500 | 1504 |
| 1501 | 1505 |
| 1502 Condition CompareIC::ComputeCondition(Token::Value op) { | 1506 Condition CompareIC::ComputeCondition(Token::Value op) { |
| 1503 switch (op) { | 1507 switch (op) { |
| 1504 case Token::EQ_STRICT: | 1508 case Token::EQ_STRICT: |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1596 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
| 1593 ? not_zero | 1597 ? not_zero |
| 1594 : zero; | 1598 : zero; |
| 1595 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1599 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1596 } | 1600 } |
| 1597 | 1601 |
| 1598 | 1602 |
| 1599 } } // namespace v8::internal | 1603 } } // namespace v8::internal |
| 1600 | 1604 |
| 1601 #endif // V8_TARGET_ARCH_IA32 | 1605 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |