| 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 __ Push(r2, r1, r0); | 1214 __ Push(r2, r1, r0); |
| 1215 | 1215 |
| 1216 // The slow case calls into the runtime to complete the store without causing | 1216 // The slow case calls into the runtime to complete the store without causing |
| 1217 // an IC miss that would otherwise cause a transition to the generic stub. | 1217 // an IC miss that would otherwise cause a transition to the generic stub. |
| 1218 ExternalReference ref = | 1218 ExternalReference ref = |
| 1219 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); | 1219 ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
| 1220 __ TailCallExternalReference(ref, 3, 1); | 1220 __ TailCallExternalReference(ref, 3, 1); |
| 1221 } | 1221 } |
| 1222 | 1222 |
| 1223 | 1223 |
| 1224 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { | |
| 1225 // ---------- S t a t e -------------- | |
| 1226 // -- r2 : receiver | |
| 1227 // -- r3 : target map | |
| 1228 // -- lr : return address | |
| 1229 // ----------------------------------- | |
| 1230 // Must return the modified receiver in r0. | |
| 1231 if (!FLAG_trace_elements_transitions) { | |
| 1232 Label fail; | |
| 1233 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, | |
| 1234 FAST_DOUBLE_ELEMENTS); | |
| 1235 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); | |
| 1236 __ mov(r0, r2); | |
| 1237 __ Ret(); | |
| 1238 __ bind(&fail); | |
| 1239 } | |
| 1240 | |
| 1241 __ push(r2); | |
| 1242 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); | |
| 1243 } | |
| 1244 | |
| 1245 | |
| 1246 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( | |
| 1247 MacroAssembler* masm) { | |
| 1248 // ---------- S t a t e -------------- | |
| 1249 // -- r2 : receiver | |
| 1250 // -- r3 : target map | |
| 1251 // -- lr : return address | |
| 1252 // ----------------------------------- | |
| 1253 // Must return the modified receiver in r0. | |
| 1254 if (!FLAG_trace_elements_transitions) { | |
| 1255 Label fail; | |
| 1256 AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, | |
| 1257 FAST_ELEMENTS); | |
| 1258 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); | |
| 1259 __ mov(r0, r2); | |
| 1260 __ Ret(); | |
| 1261 __ bind(&fail); | |
| 1262 } | |
| 1263 | |
| 1264 __ push(r2); | |
| 1265 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); | |
| 1266 } | |
| 1267 | |
| 1268 | |
| 1269 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | 1224 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 1270 StrictModeFlag strict_mode) { | 1225 StrictModeFlag strict_mode) { |
| 1271 // ---------- S t a t e -------------- | 1226 // ---------- S t a t e -------------- |
| 1272 // -- r0 : value | 1227 // -- r0 : value |
| 1273 // -- r1 : key | 1228 // -- r1 : key |
| 1274 // -- r2 : receiver | 1229 // -- r2 : receiver |
| 1275 // -- lr : return address | 1230 // -- lr : return address |
| 1276 // ----------------------------------- | 1231 // ----------------------------------- |
| 1277 | 1232 |
| 1278 // Push receiver, key and value for runtime call. | 1233 // Push receiver, key and value for runtime call. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 __ Ret(); | 1309 __ Ret(); |
| 1355 | 1310 |
| 1356 __ bind(fast_double); | 1311 __ bind(fast_double); |
| 1357 if (check_map == kCheckMap) { | 1312 if (check_map == kCheckMap) { |
| 1358 // Check for fast double array case. If this fails, call through to the | 1313 // Check for fast double array case. If this fails, call through to the |
| 1359 // runtime. | 1314 // runtime. |
| 1360 __ CompareRoot(elements_map, Heap::kFixedDoubleArrayMapRootIndex); | 1315 __ CompareRoot(elements_map, Heap::kFixedDoubleArrayMapRootIndex); |
| 1361 __ b(ne, slow); | 1316 __ b(ne, slow); |
| 1362 } | 1317 } |
| 1363 __ bind(&fast_double_without_map_check); | 1318 __ bind(&fast_double_without_map_check); |
| 1364 __ StoreNumberToDoubleElements(value, key, elements, r3, | 1319 __ StoreNumberToDoubleElements(value, key, elements, r3, d0, |
| 1365 &transition_double_elements); | 1320 &transition_double_elements); |
| 1366 if (increment_length == kIncrementLength) { | 1321 if (increment_length == kIncrementLength) { |
| 1367 // Add 1 to receiver->length. | 1322 // Add 1 to receiver->length. |
| 1368 __ add(scratch_value, key, Operand(Smi::FromInt(1))); | 1323 __ add(scratch_value, key, Operand(Smi::FromInt(1))); |
| 1369 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1324 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
| 1370 } | 1325 } |
| 1371 __ Ret(); | 1326 __ Ret(); |
| 1372 | 1327 |
| 1373 __ bind(&transition_smi_elements); | 1328 __ bind(&transition_smi_elements); |
| 1374 // Transition the array appropriately depending on the value type. | 1329 // Transition the array appropriately depending on the value type. |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 } else { | 1653 } else { |
| 1699 ASSERT(Assembler::GetCondition(branch_instr) == ne); | 1654 ASSERT(Assembler::GetCondition(branch_instr) == ne); |
| 1700 patcher.EmitCondition(eq); | 1655 patcher.EmitCondition(eq); |
| 1701 } | 1656 } |
| 1702 } | 1657 } |
| 1703 | 1658 |
| 1704 | 1659 |
| 1705 } } // namespace v8::internal | 1660 } } // namespace v8::internal |
| 1706 | 1661 |
| 1707 #endif // V8_TARGET_ARCH_ARM | 1662 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |