| 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 // The unmapped lookup expects that the parameter map is in r2. | 820 // The unmapped lookup expects that the parameter map is in r2. |
| 821 MemOperand unmapped_location = | 821 MemOperand unmapped_location = |
| 822 GenerateUnmappedArgumentsLookup(masm, r0, r2, r3, &slow); | 822 GenerateUnmappedArgumentsLookup(masm, r0, r2, r3, &slow); |
| 823 __ ldr(r2, unmapped_location); | 823 __ ldr(r2, unmapped_location); |
| 824 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 824 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
| 825 __ cmp(r2, r3); | 825 __ cmp(r2, r3); |
| 826 __ b(eq, &slow); | 826 __ b(eq, &slow); |
| 827 __ mov(r0, r2); | 827 __ mov(r0, r2); |
| 828 __ Ret(); | 828 __ Ret(); |
| 829 __ bind(&slow); | 829 __ bind(&slow); |
| 830 GenerateMiss(masm, MISS); | 830 GenerateMiss(masm); |
| 831 } | 831 } |
| 832 | 832 |
| 833 | 833 |
| 834 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 834 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { |
| 835 // ---------- S t a t e -------------- | 835 // ---------- S t a t e -------------- |
| 836 // -- r0 : value | 836 // -- r0 : value |
| 837 // -- r1 : key | 837 // -- r1 : key |
| 838 // -- r2 : receiver | 838 // -- r2 : receiver |
| 839 // -- lr : return address | 839 // -- lr : return address |
| 840 // ----------------------------------- | 840 // ----------------------------------- |
| 841 Label slow, notin; | 841 Label slow, notin; |
| 842 MemOperand mapped_location = | 842 MemOperand mapped_location = |
| 843 GenerateMappedArgumentsLookup(masm, r2, r1, r3, r4, r5, ¬in, &slow); | 843 GenerateMappedArgumentsLookup(masm, r2, r1, r3, r4, r5, ¬in, &slow); |
| 844 __ str(r0, mapped_location); | 844 __ str(r0, mapped_location); |
| 845 __ add(r6, r3, r5); | 845 __ add(r6, r3, r5); |
| 846 __ mov(r9, r0); | 846 __ mov(r9, r0); |
| 847 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs); | 847 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs); |
| 848 __ Ret(); | 848 __ Ret(); |
| 849 __ bind(¬in); | 849 __ bind(¬in); |
| 850 // The unmapped lookup expects that the parameter map is in r3. | 850 // The unmapped lookup expects that the parameter map is in r3. |
| 851 MemOperand unmapped_location = | 851 MemOperand unmapped_location = |
| 852 GenerateUnmappedArgumentsLookup(masm, r1, r3, r4, &slow); | 852 GenerateUnmappedArgumentsLookup(masm, r1, r3, r4, &slow); |
| 853 __ str(r0, unmapped_location); | 853 __ str(r0, unmapped_location); |
| 854 __ add(r6, r3, r4); | 854 __ add(r6, r3, r4); |
| 855 __ mov(r9, r0); | 855 __ mov(r9, r0); |
| 856 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs); | 856 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs); |
| 857 __ Ret(); | 857 __ Ret(); |
| 858 __ bind(&slow); | 858 __ bind(&slow); |
| 859 GenerateMiss(masm, MISS); | 859 GenerateMiss(masm); |
| 860 } | 860 } |
| 861 | 861 |
| 862 | 862 |
| 863 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, | 863 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, |
| 864 int argc) { | 864 int argc) { |
| 865 // ----------- S t a t e ------------- | 865 // ----------- S t a t e ------------- |
| 866 // -- r2 : name | 866 // -- r2 : name |
| 867 // -- lr : return address | 867 // -- lr : return address |
| 868 // ----------------------------------- | 868 // ----------------------------------- |
| 869 Label slow, notin; | 869 Label slow, notin; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 880 __ ldr(r1, unmapped_location); | 880 __ ldr(r1, unmapped_location); |
| 881 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 881 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
| 882 __ cmp(r1, r3); | 882 __ cmp(r1, r3); |
| 883 __ b(eq, &slow); | 883 __ b(eq, &slow); |
| 884 GenerateFunctionTailCall(masm, argc, &slow, r3); | 884 GenerateFunctionTailCall(masm, argc, &slow, r3); |
| 885 __ bind(&slow); | 885 __ bind(&slow); |
| 886 GenerateMiss(masm, argc); | 886 GenerateMiss(masm, argc); |
| 887 } | 887 } |
| 888 | 888 |
| 889 | 889 |
| 890 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { | 890 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| 891 // ---------- S t a t e -------------- | 891 // ---------- S t a t e -------------- |
| 892 // -- lr : return address | 892 // -- lr : return address |
| 893 // -- r0 : key | 893 // -- r0 : key |
| 894 // -- r1 : receiver | 894 // -- r1 : receiver |
| 895 // ----------------------------------- | 895 // ----------------------------------- |
| 896 Isolate* isolate = masm->isolate(); | 896 Isolate* isolate = masm->isolate(); |
| 897 | 897 |
| 898 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); | 898 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); |
| 899 | 899 |
| 900 __ Push(r1, r0); | 900 __ Push(r1, r0); |
| 901 | 901 |
| 902 // Perform tail call to the entry. | 902 // Perform tail call to the entry. |
| 903 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC | 903 ExternalReference ref = |
| 904 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), isolate) | 904 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
| 905 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | |
| 906 | 905 |
| 907 __ TailCallExternalReference(ref, 2, 1); | 906 __ TailCallExternalReference(ref, 2, 1); |
| 908 } | 907 } |
| 909 | 908 |
| 910 | 909 |
| 911 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 910 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| 912 // ---------- S t a t e -------------- | 911 // ---------- S t a t e -------------- |
| 913 // -- lr : return address | 912 // -- lr : return address |
| 914 // -- r0 : key | 913 // -- r0 : key |
| 915 // -- r1 : receiver | 914 // -- r1 : receiver |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 &miss, // When not a number. | 1112 &miss, // When not a number. |
| 1114 &miss, // When index out of range. | 1113 &miss, // When index out of range. |
| 1115 STRING_INDEX_IS_ARRAY_INDEX); | 1114 STRING_INDEX_IS_ARRAY_INDEX); |
| 1116 char_at_generator.GenerateFast(masm); | 1115 char_at_generator.GenerateFast(masm); |
| 1117 __ Ret(); | 1116 __ Ret(); |
| 1118 | 1117 |
| 1119 StubRuntimeCallHelper call_helper; | 1118 StubRuntimeCallHelper call_helper; |
| 1120 char_at_generator.GenerateSlow(masm, call_helper); | 1119 char_at_generator.GenerateSlow(masm, call_helper); |
| 1121 | 1120 |
| 1122 __ bind(&miss); | 1121 __ bind(&miss); |
| 1123 GenerateMiss(masm, MISS); | 1122 GenerateMiss(masm); |
| 1124 } | 1123 } |
| 1125 | 1124 |
| 1126 | 1125 |
| 1127 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 1126 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
| 1128 // ---------- S t a t e -------------- | 1127 // ---------- S t a t e -------------- |
| 1129 // -- lr : return address | 1128 // -- lr : return address |
| 1130 // -- r0 : key | 1129 // -- r0 : key |
| 1131 // -- r1 : receiver | 1130 // -- r1 : receiver |
| 1132 // ----------------------------------- | 1131 // ----------------------------------- |
| 1133 Label slow; | 1132 Label slow; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1153 __ Push(r1, r0); // Receiver, key. | 1152 __ Push(r1, r0); // Receiver, key. |
| 1154 | 1153 |
| 1155 // Perform tail call to the entry. | 1154 // Perform tail call to the entry. |
| 1156 __ TailCallExternalReference( | 1155 __ TailCallExternalReference( |
| 1157 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 1156 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
| 1158 masm->isolate()), | 1157 masm->isolate()), |
| 1159 2, | 1158 2, |
| 1160 1); | 1159 1); |
| 1161 | 1160 |
| 1162 __ bind(&slow); | 1161 __ bind(&slow); |
| 1163 GenerateMiss(masm, MISS); | 1162 GenerateMiss(masm); |
| 1164 } | 1163 } |
| 1165 | 1164 |
| 1166 | 1165 |
| 1167 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { | 1166 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
| 1168 // ---------- S t a t e -------------- | 1167 // ---------- S t a t e -------------- |
| 1169 // -- r0 : value | 1168 // -- r0 : value |
| 1170 // -- r1 : key | 1169 // -- r1 : key |
| 1171 // -- r2 : receiver | 1170 // -- r2 : receiver |
| 1172 // -- lr : return address | 1171 // -- lr : return address |
| 1173 // ----------------------------------- | 1172 // ----------------------------------- |
| 1174 | 1173 |
| 1175 // Push receiver, key and value for runtime call. | 1174 // Push receiver, key and value for runtime call. |
| 1176 __ Push(r2, r1, r0); | 1175 __ Push(r2, r1, r0); |
| 1177 | 1176 |
| 1178 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC | 1177 ExternalReference ref = |
| 1179 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), | 1178 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
| 1180 masm->isolate()) | |
| 1181 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | |
| 1182 __ TailCallExternalReference(ref, 3, 1); | 1179 __ TailCallExternalReference(ref, 3, 1); |
| 1183 } | 1180 } |
| 1184 | 1181 |
| 1185 | 1182 |
| 1186 void StoreIC::GenerateSlow(MacroAssembler* masm) { | 1183 void StoreIC::GenerateSlow(MacroAssembler* masm) { |
| 1187 // ---------- S t a t e -------------- | 1184 // ---------- S t a t e -------------- |
| 1188 // -- r0 : value | 1185 // -- r0 : value |
| 1189 // -- r2 : key | 1186 // -- r2 : key |
| 1190 // -- r1 : receiver | 1187 // -- r1 : receiver |
| 1191 // -- lr : return address | 1188 // -- lr : return address |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 Register elements_map = r6; | 1422 Register elements_map = r6; |
| 1426 Register elements = r9; // Elements array of the receiver. | 1423 Register elements = r9; // Elements array of the receiver. |
| 1427 // r4 and r5 are used as general scratch registers. | 1424 // r4 and r5 are used as general scratch registers. |
| 1428 | 1425 |
| 1429 // Check that the key is a smi. | 1426 // Check that the key is a smi. |
| 1430 __ JumpIfNotSmi(key, &slow); | 1427 __ JumpIfNotSmi(key, &slow); |
| 1431 // Check that the object isn't a smi. | 1428 // Check that the object isn't a smi. |
| 1432 __ JumpIfSmi(receiver, &slow); | 1429 __ JumpIfSmi(receiver, &slow); |
| 1433 // Get the map of the object. | 1430 // Get the map of the object. |
| 1434 __ ldr(receiver_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1431 __ ldr(receiver_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 1435 // Check that the receiver does not require access checks. We need | 1432 // Check that the receiver does not require access checks and is not observed. |
| 1436 // to do this because this generic stub does not perform map checks. | 1433 // The generic stub does not perform map checks or handle observed objects. |
| 1437 __ ldrb(ip, FieldMemOperand(receiver_map, Map::kBitFieldOffset)); | 1434 __ ldrb(ip, FieldMemOperand(receiver_map, Map::kBitFieldOffset)); |
| 1438 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded)); | 1435 __ tst(ip, Operand(1 << Map::kIsAccessCheckNeeded | 1 << Map::kIsObserved)); |
| 1439 __ b(ne, &slow); | 1436 __ b(ne, &slow); |
| 1440 // Check if the object is a JS array or not. | 1437 // Check if the object is a JS array or not. |
| 1441 __ ldrb(r4, FieldMemOperand(receiver_map, Map::kInstanceTypeOffset)); | 1438 __ ldrb(r4, FieldMemOperand(receiver_map, Map::kInstanceTypeOffset)); |
| 1442 __ cmp(r4, Operand(JS_ARRAY_TYPE)); | 1439 __ cmp(r4, Operand(JS_ARRAY_TYPE)); |
| 1443 __ b(eq, &array); | 1440 __ b(eq, &array); |
| 1444 // Check that the object is some kind of JSObject. | 1441 // Check that the object is some kind of JSObject. |
| 1445 __ cmp(r4, Operand(FIRST_JS_OBJECT_TYPE)); | 1442 __ cmp(r4, Operand(FIRST_JS_OBJECT_TYPE)); |
| 1446 __ b(lt, &slow); | 1443 __ b(lt, &slow); |
| 1447 | 1444 |
| 1448 // Object case: Check key against length in the elements array. | 1445 // Object case: Check key against length in the elements array. |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 } else { | 1679 } else { |
| 1683 ASSERT(Assembler::GetCondition(branch_instr) == ne); | 1680 ASSERT(Assembler::GetCondition(branch_instr) == ne); |
| 1684 patcher.EmitCondition(eq); | 1681 patcher.EmitCondition(eq); |
| 1685 } | 1682 } |
| 1686 } | 1683 } |
| 1687 | 1684 |
| 1688 | 1685 |
| 1689 } } // namespace v8::internal | 1686 } } // namespace v8::internal |
| 1690 | 1687 |
| 1691 #endif // V8_TARGET_ARCH_ARM | 1688 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |