OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 // Get the receiver of the function from the stack. | 656 // Get the receiver of the function from the stack. |
657 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); | 657 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); |
658 | 658 |
659 __ EnterInternalFrame(); | 659 __ EnterInternalFrame(); |
660 | 660 |
661 // Push the receiver and the name of the function. | 661 // Push the receiver and the name of the function. |
662 __ Push(r3, r2); | 662 __ Push(r3, r2); |
663 | 663 |
664 // Call the entry. | 664 // Call the entry. |
665 __ mov(r0, Operand(2)); | 665 __ mov(r0, Operand(2)); |
666 __ mov(r1, Operand(ExternalReference(IC_Utility(id)))); | 666 __ mov(r1, Operand(ExternalReference(IC_Utility(id), masm->isolate()))); |
667 | 667 |
668 CEntryStub stub(1); | 668 CEntryStub stub(1); |
669 __ CallStub(&stub); | 669 __ CallStub(&stub); |
670 | 670 |
671 // Move result to r1 and leave the internal frame. | 671 // Move result to r1 and leave the internal frame. |
672 __ mov(r1, Operand(r0)); | 672 __ mov(r1, Operand(r0)); |
673 __ LeaveInternalFrame(); | 673 __ LeaveInternalFrame(); |
674 | 674 |
675 // Check if the receiver is a global object of some sort. | 675 // Check if the receiver is a global object of some sort. |
676 // This can happen only for regular CallIC but not KeyedCallIC. | 676 // This can happen only for regular CallIC but not KeyedCallIC. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 // -- r0 : receiver | 911 // -- r0 : receiver |
912 // -- sp[0] : receiver | 912 // -- sp[0] : receiver |
913 // ----------------------------------- | 913 // ----------------------------------- |
914 | 914 |
915 __ IncrementCounter(COUNTERS->load_miss(), 1, r3, r4); | 915 __ IncrementCounter(COUNTERS->load_miss(), 1, r3, r4); |
916 | 916 |
917 __ mov(r3, r0); | 917 __ mov(r3, r0); |
918 __ Push(r3, r2); | 918 __ Push(r3, r2); |
919 | 919 |
920 // Perform tail call to the entry. | 920 // Perform tail call to the entry. |
921 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss)); | 921 ExternalReference ref = |
| 922 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
922 __ TailCallExternalReference(ref, 2, 1); | 923 __ TailCallExternalReference(ref, 2, 1); |
923 } | 924 } |
924 | 925 |
925 // Returns the code marker, or the 0 if the code is not marked. | 926 // Returns the code marker, or the 0 if the code is not marked. |
926 static inline int InlinedICSiteMarker(Address address, | 927 static inline int InlinedICSiteMarker(Address address, |
927 Address* inline_end_address) { | 928 Address* inline_end_address) { |
928 if (V8::UseCrankshaft()) return false; | 929 if (V8::UseCrankshaft()) return false; |
929 | 930 |
930 // If the instruction after the call site is not the pseudo instruction nop1 | 931 // If the instruction after the call site is not the pseudo instruction nop1 |
931 // then this is not related to an inlined in-object property load. The nop1 | 932 // then this is not related to an inlined in-object property load. The nop1 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 // ---------- S t a t e -------------- | 1142 // ---------- S t a t e -------------- |
1142 // -- lr : return address | 1143 // -- lr : return address |
1143 // -- r0 : key | 1144 // -- r0 : key |
1144 // -- r1 : receiver | 1145 // -- r1 : receiver |
1145 // ----------------------------------- | 1146 // ----------------------------------- |
1146 | 1147 |
1147 __ IncrementCounter(COUNTERS->keyed_load_miss(), 1, r3, r4); | 1148 __ IncrementCounter(COUNTERS->keyed_load_miss(), 1, r3, r4); |
1148 | 1149 |
1149 __ Push(r1, r0); | 1150 __ Push(r1, r0); |
1150 | 1151 |
1151 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss)); | 1152 ExternalReference ref = |
| 1153 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
1152 __ TailCallExternalReference(ref, 2, 1); | 1154 __ TailCallExternalReference(ref, 2, 1); |
1153 } | 1155 } |
1154 | 1156 |
1155 | 1157 |
1156 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1158 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
1157 // ---------- S t a t e -------------- | 1159 // ---------- S t a t e -------------- |
1158 // -- lr : return address | 1160 // -- lr : return address |
1159 // -- r0 : key | 1161 // -- r0 : key |
1160 // -- r1 : receiver | 1162 // -- r1 : receiver |
1161 // ----------------------------------- | 1163 // ----------------------------------- |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 // Load the map of the receiver, compute the keyed lookup cache hash | 1237 // Load the map of the receiver, compute the keyed lookup cache hash |
1236 // based on 32 bits of the map pointer and the string hash. | 1238 // based on 32 bits of the map pointer and the string hash. |
1237 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); | 1239 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); |
1238 __ mov(r3, Operand(r2, ASR, KeyedLookupCache::kMapHashShift)); | 1240 __ mov(r3, Operand(r2, ASR, KeyedLookupCache::kMapHashShift)); |
1239 __ ldr(r4, FieldMemOperand(r0, String::kHashFieldOffset)); | 1241 __ ldr(r4, FieldMemOperand(r0, String::kHashFieldOffset)); |
1240 __ eor(r3, r3, Operand(r4, ASR, String::kHashShift)); | 1242 __ eor(r3, r3, Operand(r4, ASR, String::kHashShift)); |
1241 __ And(r3, r3, Operand(KeyedLookupCache::kCapacityMask)); | 1243 __ And(r3, r3, Operand(KeyedLookupCache::kCapacityMask)); |
1242 | 1244 |
1243 // Load the key (consisting of map and symbol) from the cache and | 1245 // Load the key (consisting of map and symbol) from the cache and |
1244 // check for match. | 1246 // check for match. |
1245 ExternalReference cache_keys = ExternalReference::keyed_lookup_cache_keys(); | 1247 ExternalReference cache_keys = |
| 1248 ExternalReference::keyed_lookup_cache_keys(masm->isolate()); |
1246 __ mov(r4, Operand(cache_keys)); | 1249 __ mov(r4, Operand(cache_keys)); |
1247 __ add(r4, r4, Operand(r3, LSL, kPointerSizeLog2 + 1)); | 1250 __ add(r4, r4, Operand(r3, LSL, kPointerSizeLog2 + 1)); |
1248 __ ldr(r5, MemOperand(r4, kPointerSize, PostIndex)); // Move r4 to symbol. | 1251 __ ldr(r5, MemOperand(r4, kPointerSize, PostIndex)); // Move r4 to symbol. |
1249 __ cmp(r2, r5); | 1252 __ cmp(r2, r5); |
1250 __ b(ne, &slow); | 1253 __ b(ne, &slow); |
1251 __ ldr(r5, MemOperand(r4)); | 1254 __ ldr(r5, MemOperand(r4)); |
1252 __ cmp(r0, r5); | 1255 __ cmp(r0, r5); |
1253 __ b(ne, &slow); | 1256 __ b(ne, &slow); |
1254 | 1257 |
1255 // Get field offset. | 1258 // Get field offset. |
1256 // r0 : key | 1259 // r0 : key |
1257 // r1 : receiver | 1260 // r1 : receiver |
1258 // r2 : receiver's map | 1261 // r2 : receiver's map |
1259 // r3 : lookup cache index | 1262 // r3 : lookup cache index |
1260 ExternalReference cache_field_offsets | 1263 ExternalReference cache_field_offsets = |
1261 = ExternalReference::keyed_lookup_cache_field_offsets(); | 1264 ExternalReference::keyed_lookup_cache_field_offsets(masm->isolate()); |
1262 __ mov(r4, Operand(cache_field_offsets)); | 1265 __ mov(r4, Operand(cache_field_offsets)); |
1263 __ ldr(r5, MemOperand(r4, r3, LSL, kPointerSizeLog2)); | 1266 __ ldr(r5, MemOperand(r4, r3, LSL, kPointerSizeLog2)); |
1264 __ ldrb(r6, FieldMemOperand(r2, Map::kInObjectPropertiesOffset)); | 1267 __ ldrb(r6, FieldMemOperand(r2, Map::kInObjectPropertiesOffset)); |
1265 __ sub(r5, r5, r6, SetCC); | 1268 __ sub(r5, r5, r6, SetCC); |
1266 __ b(ge, &property_array_property); | 1269 __ b(ge, &property_array_property); |
1267 | 1270 |
1268 // Load in-object property. | 1271 // Load in-object property. |
1269 __ ldrb(r6, FieldMemOperand(r2, Map::kInstanceSizeOffset)); | 1272 __ ldrb(r6, FieldMemOperand(r2, Map::kInstanceSizeOffset)); |
1270 __ add(r6, r6, r5); // Index from start of object. | 1273 __ add(r6, r6, r5); // Index from start of object. |
1271 __ sub(r1, r1, Operand(kHeapObjectTag)); // Remove the heap tag. | 1274 __ sub(r1, r1, Operand(kHeapObjectTag)); // Remove the heap tag. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 // are not enabled for this object. | 1361 // are not enabled for this object. |
1359 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset)); | 1362 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset)); |
1360 __ and_(r3, r3, Operand(kSlowCaseBitFieldMask)); | 1363 __ and_(r3, r3, Operand(kSlowCaseBitFieldMask)); |
1361 __ cmp(r3, Operand(1 << Map::kHasIndexedInterceptor)); | 1364 __ cmp(r3, Operand(1 << Map::kHasIndexedInterceptor)); |
1362 __ b(ne, &slow); | 1365 __ b(ne, &slow); |
1363 | 1366 |
1364 // Everything is fine, call runtime. | 1367 // Everything is fine, call runtime. |
1365 __ Push(r1, r0); // Receiver, key. | 1368 __ Push(r1, r0); // Receiver, key. |
1366 | 1369 |
1367 // Perform tail call to the entry. | 1370 // Perform tail call to the entry. |
1368 __ TailCallExternalReference(ExternalReference( | 1371 __ TailCallExternalReference( |
1369 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); | 1372 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
| 1373 masm->isolate()), |
| 1374 2, |
| 1375 1); |
1370 | 1376 |
1371 __ bind(&slow); | 1377 __ bind(&slow); |
1372 GenerateMiss(masm); | 1378 GenerateMiss(masm); |
1373 } | 1379 } |
1374 | 1380 |
1375 | 1381 |
1376 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 1382 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
1377 // ---------- S t a t e -------------- | 1383 // ---------- S t a t e -------------- |
1378 // -- r0 : value | 1384 // -- r0 : value |
1379 // -- r1 : key | 1385 // -- r1 : key |
1380 // -- r2 : receiver | 1386 // -- r2 : receiver |
1381 // -- lr : return address | 1387 // -- lr : return address |
1382 // ----------------------------------- | 1388 // ----------------------------------- |
1383 | 1389 |
1384 // Push receiver, key and value for runtime call. | 1390 // Push receiver, key and value for runtime call. |
1385 __ Push(r2, r1, r0); | 1391 __ Push(r2, r1, r0); |
1386 | 1392 |
1387 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); | 1393 ExternalReference ref = |
| 1394 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
1388 __ TailCallExternalReference(ref, 3, 1); | 1395 __ TailCallExternalReference(ref, 3, 1); |
1389 } | 1396 } |
1390 | 1397 |
1391 | 1398 |
1392 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | 1399 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
1393 StrictModeFlag strict_mode) { | 1400 StrictModeFlag strict_mode) { |
1394 // ---------- S t a t e -------------- | 1401 // ---------- S t a t e -------------- |
1395 // -- r0 : value | 1402 // -- r0 : value |
1396 // -- r1 : key | 1403 // -- r1 : key |
1397 // -- r2 : receiver | 1404 // -- r2 : receiver |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 // ----------- S t a t e ------------- | 1550 // ----------- S t a t e ------------- |
1544 // -- r0 : value | 1551 // -- r0 : value |
1545 // -- r1 : receiver | 1552 // -- r1 : receiver |
1546 // -- r2 : name | 1553 // -- r2 : name |
1547 // -- lr : return address | 1554 // -- lr : return address |
1548 // ----------------------------------- | 1555 // ----------------------------------- |
1549 | 1556 |
1550 __ Push(r1, r2, r0); | 1557 __ Push(r1, r2, r0); |
1551 | 1558 |
1552 // Perform tail call to the entry. | 1559 // Perform tail call to the entry. |
1553 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss)); | 1560 ExternalReference ref = |
| 1561 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); |
1554 __ TailCallExternalReference(ref, 3, 1); | 1562 __ TailCallExternalReference(ref, 3, 1); |
1555 } | 1563 } |
1556 | 1564 |
1557 | 1565 |
1558 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { | 1566 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { |
1559 // ----------- S t a t e ------------- | 1567 // ----------- S t a t e ------------- |
1560 // -- r0 : value | 1568 // -- r0 : value |
1561 // -- r1 : receiver | 1569 // -- r1 : receiver |
1562 // -- r2 : name | 1570 // -- r2 : name |
1563 // -- lr : return address | 1571 // -- lr : return address |
(...skipping 24 matching lines...) Expand all Loading... |
1588 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset)); | 1596 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset)); |
1589 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE); | 1597 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE); |
1590 __ b(ne, &miss); | 1598 __ b(ne, &miss); |
1591 | 1599 |
1592 // Check that value is a smi. | 1600 // Check that value is a smi. |
1593 __ JumpIfNotSmi(value, &miss); | 1601 __ JumpIfNotSmi(value, &miss); |
1594 | 1602 |
1595 // Prepare tail call to StoreIC_ArrayLength. | 1603 // Prepare tail call to StoreIC_ArrayLength. |
1596 __ Push(receiver, value); | 1604 __ Push(receiver, value); |
1597 | 1605 |
1598 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength)); | 1606 ExternalReference ref = |
| 1607 ExternalReference(IC_Utility(kStoreIC_ArrayLength), masm->isolate()); |
1599 __ TailCallExternalReference(ref, 2, 1); | 1608 __ TailCallExternalReference(ref, 2, 1); |
1600 | 1609 |
1601 __ bind(&miss); | 1610 __ bind(&miss); |
1602 | 1611 |
1603 GenerateMiss(masm); | 1612 GenerateMiss(masm); |
1604 } | 1613 } |
1605 | 1614 |
1606 | 1615 |
1607 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 1616 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
1608 // ----------- S t a t e ------------- | 1617 // ----------- S t a t e ------------- |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 Register reg = Assembler::GetRn(instr_at_patch); | 1772 Register reg = Assembler::GetRn(instr_at_patch); |
1764 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1773 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
1765 patcher.EmitCondition(eq); | 1774 patcher.EmitCondition(eq); |
1766 } | 1775 } |
1767 } | 1776 } |
1768 | 1777 |
1769 | 1778 |
1770 } } // namespace v8::internal | 1779 } } // namespace v8::internal |
1771 | 1780 |
1772 #endif // V8_TARGET_ARCH_ARM | 1781 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |