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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 // Fast case: Do the store, could be either Object or double. | 1261 // Fast case: Do the store, could be either Object or double. |
1262 __ bind(fast_object); | 1262 __ bind(fast_object); |
1263 Register scratch_value = r4; | 1263 Register scratch_value = r4; |
1264 Register address = r5; | 1264 Register address = r5; |
1265 if (check_map == kCheckMap) { | 1265 if (check_map == kCheckMap) { |
1266 __ ldr(elements_map, FieldMemOperand(elements, HeapObject::kMapOffset)); | 1266 __ ldr(elements_map, FieldMemOperand(elements, HeapObject::kMapOffset)); |
1267 __ cmp(elements_map, | 1267 __ cmp(elements_map, |
1268 Operand(masm->isolate()->factory()->fixed_array_map())); | 1268 Operand(masm->isolate()->factory()->fixed_array_map())); |
1269 __ b(ne, fast_double); | 1269 __ b(ne, fast_double); |
1270 } | 1270 } |
| 1271 |
| 1272 // HOLECHECK: guards "A[i] = V" |
| 1273 // We have to go to the runtime if the current value is the hole because |
| 1274 // there may be a callback on the element |
| 1275 Label holecheck_passed1; |
| 1276 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 1277 __ ldr(scratch_value, |
| 1278 MemOperand::PointerAddressFromSmiKey(address, key, PreIndex)); |
| 1279 __ cmp(scratch_value, Operand(masm->isolate()->factory()->the_hole_value())); |
| 1280 __ b(ne, &holecheck_passed1); |
| 1281 __ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch_value, |
| 1282 slow); |
| 1283 |
| 1284 __ bind(&holecheck_passed1); |
| 1285 |
1271 // Smi stores don't require further checks. | 1286 // Smi stores don't require further checks. |
1272 Label non_smi_value; | 1287 Label non_smi_value; |
1273 __ JumpIfNotSmi(value, &non_smi_value); | 1288 __ JumpIfNotSmi(value, &non_smi_value); |
1274 | 1289 |
1275 if (increment_length == kIncrementLength) { | 1290 if (increment_length == kIncrementLength) { |
1276 // Add 1 to receiver->length. | 1291 // Add 1 to receiver->length. |
1277 __ add(scratch_value, key, Operand(Smi::FromInt(1))); | 1292 __ add(scratch_value, key, Operand(Smi::FromInt(1))); |
1278 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1293 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
1279 } | 1294 } |
1280 // It's irrelevant whether array is smi-only or not when writing a smi. | 1295 // It's irrelevant whether array is smi-only or not when writing a smi. |
(...skipping 27 matching lines...) Expand all Loading... |
1308 OMIT_SMI_CHECK); | 1323 OMIT_SMI_CHECK); |
1309 __ Ret(); | 1324 __ Ret(); |
1310 | 1325 |
1311 __ bind(fast_double); | 1326 __ bind(fast_double); |
1312 if (check_map == kCheckMap) { | 1327 if (check_map == kCheckMap) { |
1313 // Check for fast double array case. If this fails, call through to the | 1328 // Check for fast double array case. If this fails, call through to the |
1314 // runtime. | 1329 // runtime. |
1315 __ CompareRoot(elements_map, Heap::kFixedDoubleArrayMapRootIndex); | 1330 __ CompareRoot(elements_map, Heap::kFixedDoubleArrayMapRootIndex); |
1316 __ b(ne, slow); | 1331 __ b(ne, slow); |
1317 } | 1332 } |
| 1333 |
| 1334 // HOLECHECK: guards "A[i] double hole?" |
| 1335 // We have to see if the double version of the hole is present. If so |
| 1336 // go to the runtime. |
| 1337 __ add(address, elements, |
| 1338 Operand((FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32)) |
| 1339 - kHeapObjectTag)); |
| 1340 __ ldr(scratch_value, |
| 1341 MemOperand(address, key, LSL, kPointerSizeLog2, PreIndex)); |
| 1342 __ cmp(scratch_value, Operand(kHoleNanUpper32)); |
| 1343 __ b(ne, &fast_double_without_map_check); |
| 1344 __ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch_value, |
| 1345 slow); |
| 1346 |
1318 __ bind(&fast_double_without_map_check); | 1347 __ bind(&fast_double_without_map_check); |
1319 __ StoreNumberToDoubleElements(value, key, elements, r3, d0, | 1348 __ StoreNumberToDoubleElements(value, key, elements, r3, d0, |
1320 &transition_double_elements); | 1349 &transition_double_elements); |
1321 if (increment_length == kIncrementLength) { | 1350 if (increment_length == kIncrementLength) { |
1322 // Add 1 to receiver->length. | 1351 // Add 1 to receiver->length. |
1323 __ add(scratch_value, key, Operand(Smi::FromInt(1))); | 1352 __ add(scratch_value, key, Operand(Smi::FromInt(1))); |
1324 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1353 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
1325 } | 1354 } |
1326 __ Ret(); | 1355 __ Ret(); |
1327 | 1356 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 } else { | 1682 } else { |
1654 ASSERT(Assembler::GetCondition(branch_instr) == ne); | 1683 ASSERT(Assembler::GetCondition(branch_instr) == ne); |
1655 patcher.EmitCondition(eq); | 1684 patcher.EmitCondition(eq); |
1656 } | 1685 } |
1657 } | 1686 } |
1658 | 1687 |
1659 | 1688 |
1660 } } // namespace v8::internal | 1689 } } // namespace v8::internal |
1661 | 1690 |
1662 #endif // V8_TARGET_ARCH_ARM | 1691 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |