| 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 867 |
| 868 __ mov(a3, a0); | 868 __ mov(a3, a0); |
| 869 __ Push(a3, a2); | 869 __ Push(a3, a2); |
| 870 | 870 |
| 871 // Perform tail call to the entry. | 871 // Perform tail call to the entry. |
| 872 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 872 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); |
| 873 __ TailCallExternalReference(ref, 2, 1); | 873 __ TailCallExternalReference(ref, 2, 1); |
| 874 } | 874 } |
| 875 | 875 |
| 876 | 876 |
| 877 Object* KeyedLoadIC_Miss(Arguments args); | 877 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
| 878 | |
| 879 | |
| 880 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | |
| 881 // ---------- S t a t e -------------- | 878 // ---------- S t a t e -------------- |
| 882 // -- ra : return address | 879 // -- ra : return address |
| 883 // -- a0 : key | 880 // -- a0 : key |
| 884 // -- a1 : receiver | 881 // -- a1 : receiver |
| 885 // ----------------------------------- | 882 // ----------------------------------- |
| 886 Isolate* isolate = masm->isolate(); | 883 Isolate* isolate = masm->isolate(); |
| 887 | 884 |
| 888 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, t0); | 885 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, t0); |
| 889 | 886 |
| 890 __ Push(a1, a0); | 887 __ Push(a1, a0); |
| 891 | 888 |
| 892 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss), | 889 // Perform tail call to the entry. |
| 893 isolate); | 890 ExternalReference ref = force_generic |
| 891 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), isolate) |
| 892 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
| 893 |
| 894 __ TailCallExternalReference(ref, 2, 1); | 894 __ TailCallExternalReference(ref, 2, 1); |
| 895 } | 895 } |
| 896 | 896 |
| 897 | 897 |
| 898 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 898 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| 899 // ---------- S t a t e -------------- | 899 // ---------- S t a t e -------------- |
| 900 // -- ra : return address | 900 // -- ra : return address |
| 901 // -- a0 : key | 901 // -- a0 : key |
| 902 // -- a1 : receiver | 902 // -- a1 : receiver |
| 903 // ----------------------------------- | 903 // ----------------------------------- |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 &miss, // When not a number. | 1090 &miss, // When not a number. |
| 1091 &miss, // When index out of range. | 1091 &miss, // When index out of range. |
| 1092 STRING_INDEX_IS_ARRAY_INDEX); | 1092 STRING_INDEX_IS_ARRAY_INDEX); |
| 1093 char_at_generator.GenerateFast(masm); | 1093 char_at_generator.GenerateFast(masm); |
| 1094 __ Ret(); | 1094 __ Ret(); |
| 1095 | 1095 |
| 1096 StubRuntimeCallHelper call_helper; | 1096 StubRuntimeCallHelper call_helper; |
| 1097 char_at_generator.GenerateSlow(masm, call_helper); | 1097 char_at_generator.GenerateSlow(masm, call_helper); |
| 1098 | 1098 |
| 1099 __ bind(&miss); | 1099 __ bind(&miss); |
| 1100 GenerateMiss(masm); | 1100 GenerateMiss(masm, false); |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 | 1103 |
| 1104 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | 1104 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 1105 StrictModeFlag strict_mode) { | 1105 StrictModeFlag strict_mode) { |
| 1106 // ---------- S t a t e -------------- | 1106 // ---------- S t a t e -------------- |
| 1107 // -- a0 : value | 1107 // -- a0 : value |
| 1108 // -- a1 : key | 1108 // -- a1 : key |
| 1109 // -- a2 : receiver | 1109 // -- a2 : receiver |
| 1110 // -- ra : return address | 1110 // -- ra : return address |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 __ And(a3, a3, Operand(kSlowCaseBitFieldMask)); | 1256 __ And(a3, a3, Operand(kSlowCaseBitFieldMask)); |
| 1257 __ Branch(&slow, ne, a3, Operand(1 << Map::kHasIndexedInterceptor)); | 1257 __ Branch(&slow, ne, a3, Operand(1 << Map::kHasIndexedInterceptor)); |
| 1258 // Everything is fine, call runtime. | 1258 // Everything is fine, call runtime. |
| 1259 __ Push(a1, a0); // Receiver, key. | 1259 __ Push(a1, a0); // Receiver, key. |
| 1260 | 1260 |
| 1261 // Perform tail call to the entry. | 1261 // Perform tail call to the entry. |
| 1262 __ TailCallExternalReference(ExternalReference( | 1262 __ TailCallExternalReference(ExternalReference( |
| 1263 IC_Utility(kKeyedLoadPropertyWithInterceptor), masm->isolate()), 2, 1); | 1263 IC_Utility(kKeyedLoadPropertyWithInterceptor), masm->isolate()), 2, 1); |
| 1264 | 1264 |
| 1265 __ bind(&slow); | 1265 __ bind(&slow); |
| 1266 GenerateMiss(masm); | 1266 GenerateMiss(masm, false); |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 | 1269 |
| 1270 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 1270 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) { |
| 1271 // ---------- S t a t e -------------- | 1271 // ---------- S t a t e -------------- |
| 1272 // -- a0 : value | 1272 // -- a0 : value |
| 1273 // -- a1 : key | 1273 // -- a1 : key |
| 1274 // -- a2 : receiver |
| 1275 // -- ra : return address |
| 1276 // ----------------------------------- |
| 1277 |
| 1278 // Push receiver, key and value for runtime call. |
| 1279 __ Push(a2, a1, a0); |
| 1280 |
| 1281 ExternalReference ref = force_generic |
| 1282 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
| 1283 masm->isolate()) |
| 1284 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
| 1285 __ TailCallExternalReference(ref, 3, 1); |
| 1286 } |
| 1287 |
| 1288 |
| 1289 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { |
| 1290 // ---------- S t a t e -------------- |
| 1291 // -- a0 : value |
| 1292 // -- a1 : key |
| 1274 // -- a2 : receiver | 1293 // -- a2 : receiver |
| 1275 // -- ra : return address | 1294 // -- ra : return address |
| 1276 // ----------------------------------- | 1295 // ----------------------------------- |
| 1277 | 1296 |
| 1278 // Push receiver, key and value for runtime call. | 1297 // Push receiver, key and value for runtime call. |
| 1279 // We can't use MultiPush as the order of the registers is important. | 1298 // We can't use MultiPush as the order of the registers is important. |
| 1280 __ Push(a2, a1, a0); | 1299 __ Push(a2, a1, a0); |
| 1281 | 1300 |
| 1282 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss), | 1301 // The slow case calls into the runtime to complete the store without causing |
| 1283 masm->isolate()); | 1302 // an IC miss that would otherwise cause a transition to the generic stub. |
| 1303 ExternalReference ref = |
| 1304 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
| 1305 |
| 1284 __ TailCallExternalReference(ref, 3, 1); | 1306 __ TailCallExternalReference(ref, 3, 1); |
| 1285 } | 1307 } |
| 1286 | 1308 |
| 1287 | 1309 |
| 1288 void StoreIC::GenerateMegamorphic(MacroAssembler* masm, | 1310 void StoreIC::GenerateMegamorphic(MacroAssembler* masm, |
| 1289 StrictModeFlag strict_mode) { | 1311 StrictModeFlag strict_mode) { |
| 1290 // ----------- S t a t e ------------- | 1312 // ----------- S t a t e ------------- |
| 1291 // -- a0 : value | 1313 // -- a0 : value |
| 1292 // -- a1 : receiver | 1314 // -- a1 : receiver |
| 1293 // -- a2 : name | 1315 // -- a2 : name |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1531 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1553 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); |
| 1532 patcher.masm()->andi(at, reg, kSmiTagMask); | 1554 patcher.masm()->andi(at, reg, kSmiTagMask); |
| 1533 patcher.ChangeBranchCondition(eq); | 1555 patcher.ChangeBranchCondition(eq); |
| 1534 } | 1556 } |
| 1535 } | 1557 } |
| 1536 | 1558 |
| 1537 | 1559 |
| 1538 } } // namespace v8::internal | 1560 } } // namespace v8::internal |
| 1539 | 1561 |
| 1540 #endif // V8_TARGET_ARCH_MIPS | 1562 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |