| 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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 __ bind(&slow); | 1468 __ bind(&slow); |
| 1469 // Entry registers are intact. | 1469 // Entry registers are intact. |
| 1470 // r0: value. | 1470 // r0: value. |
| 1471 // r1: key. | 1471 // r1: key. |
| 1472 // r2: receiver. | 1472 // r2: receiver. |
| 1473 GenerateRuntimeSetProperty(masm); | 1473 GenerateRuntimeSetProperty(masm); |
| 1474 | 1474 |
| 1475 // Check whether the elements is a pixel array. | 1475 // Check whether the elements is a pixel array. |
| 1476 // r4: elements map. | 1476 // r4: elements map. |
| 1477 __ bind(&check_pixel_array); | 1477 __ bind(&check_pixel_array); |
| 1478 __ LoadRoot(ip, Heap::kPixelArrayMapRootIndex); | 1478 GenerateFastPixelArrayStore(masm, |
| 1479 __ cmp(r4, ip); | 1479 r2, |
| 1480 __ b(ne, &slow); | 1480 r1, |
| 1481 // Check that the value is a smi. If a conversion is needed call into the | 1481 r0, |
| 1482 // runtime to convert and clamp. | 1482 elements, |
| 1483 __ JumpIfNotSmi(value, &slow); | 1483 r4, |
| 1484 __ mov(r4, Operand(key, ASR, kSmiTagSize)); // Untag the key. | 1484 r5, |
| 1485 __ ldr(ip, FieldMemOperand(elements, PixelArray::kLengthOffset)); | 1485 r6, |
| 1486 __ cmp(r4, Operand(ip)); | 1486 false, |
| 1487 __ b(hs, &slow); | 1487 false, |
| 1488 __ mov(r5, Operand(value, ASR, kSmiTagSize)); // Untag the value. | 1488 NULL, |
| 1489 __ Usat(r5, 8, Operand(r5)); // Clamp the value to [0..255]. | 1489 &slow, |
| 1490 | 1490 &slow, |
| 1491 // Get the pointer to the external array. This clobbers elements. | 1491 &slow); |
| 1492 __ ldr(elements, | |
| 1493 FieldMemOperand(elements, PixelArray::kExternalPointerOffset)); | |
| 1494 __ strb(r5, MemOperand(elements, r4)); // Elements is now external array. | |
| 1495 __ Ret(); | |
| 1496 | 1492 |
| 1497 // Extra capacity case: Check if there is extra capacity to | 1493 // Extra capacity case: Check if there is extra capacity to |
| 1498 // perform the store and update the length. Used for adding one | 1494 // perform the store and update the length. Used for adding one |
| 1499 // element to the array by writing to array[array.length]. | 1495 // element to the array by writing to array[array.length]. |
| 1500 __ bind(&extra); | 1496 __ bind(&extra); |
| 1501 // Condition code from comparing key and array length is still available. | 1497 // Condition code from comparing key and array length is still available. |
| 1502 __ b(ne, &slow); // Only support writing to writing to array[array.length]. | 1498 __ b(ne, &slow); // Only support writing to writing to array[array.length]. |
| 1503 // Check for room in the elements backing store. | 1499 // Check for room in the elements backing store. |
| 1504 // Both the key and the length of FixedArray are smis. | 1500 // Both the key and the length of FixedArray are smis. |
| 1505 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 1501 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 Register reg = Assembler::GetRn(instr_at_patch); | 1779 Register reg = Assembler::GetRn(instr_at_patch); |
| 1784 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1780 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
| 1785 patcher.EmitCondition(eq); | 1781 patcher.EmitCondition(eq); |
| 1786 } | 1782 } |
| 1787 } | 1783 } |
| 1788 | 1784 |
| 1789 | 1785 |
| 1790 } } // namespace v8::internal | 1786 } } // namespace v8::internal |
| 1791 | 1787 |
| 1792 #endif // V8_TARGET_ARCH_ARM | 1788 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |