| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
| 10 | 10 |
| (...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 } | 1868 } |
| 1869 str(scratch2, MemOperand(topaddr)); | 1869 str(scratch2, MemOperand(topaddr)); |
| 1870 | 1870 |
| 1871 // Tag object if requested. | 1871 // Tag object if requested. |
| 1872 if ((flags & TAG_OBJECT) != 0) { | 1872 if ((flags & TAG_OBJECT) != 0) { |
| 1873 add(result, result, Operand(kHeapObjectTag)); | 1873 add(result, result, Operand(kHeapObjectTag)); |
| 1874 } | 1874 } |
| 1875 } | 1875 } |
| 1876 | 1876 |
| 1877 | 1877 |
| 1878 void MacroAssembler::UndoAllocationInNewSpace(Register object, | |
| 1879 Register scratch) { | |
| 1880 ExternalReference new_space_allocation_top = | |
| 1881 ExternalReference::new_space_allocation_top_address(isolate()); | |
| 1882 | |
| 1883 // Make sure the object has no tag before resetting top. | |
| 1884 and_(object, object, Operand(~kHeapObjectTagMask)); | |
| 1885 #ifdef DEBUG | |
| 1886 // Check that the object un-allocated is below the current top. | |
| 1887 mov(scratch, Operand(new_space_allocation_top)); | |
| 1888 ldr(scratch, MemOperand(scratch)); | |
| 1889 cmp(object, scratch); | |
| 1890 Check(lt, kUndoAllocationOfNonAllocatedMemory); | |
| 1891 #endif | |
| 1892 // Write the address of the object to un-allocate as the current top. | |
| 1893 mov(scratch, Operand(new_space_allocation_top)); | |
| 1894 str(object, MemOperand(scratch)); | |
| 1895 } | |
| 1896 | |
| 1897 | |
| 1898 void MacroAssembler::AllocateTwoByteString(Register result, | 1878 void MacroAssembler::AllocateTwoByteString(Register result, |
| 1899 Register length, | 1879 Register length, |
| 1900 Register scratch1, | 1880 Register scratch1, |
| 1901 Register scratch2, | 1881 Register scratch2, |
| 1902 Register scratch3, | 1882 Register scratch3, |
| 1903 Label* gc_required) { | 1883 Label* gc_required) { |
| 1904 // Calculate the number of bytes needed for the characters in the string while | 1884 // Calculate the number of bytes needed for the characters in the string while |
| 1905 // observing object alignment. | 1885 // observing object alignment. |
| 1906 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); | 1886 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); |
| 1907 mov(scratch1, Operand(length, LSL, 1)); // Length in bytes, not chars. | 1887 mov(scratch1, Operand(length, LSL, 1)); // Length in bytes, not chars. |
| (...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3920 } | 3900 } |
| 3921 } | 3901 } |
| 3922 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3902 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 3923 add(result, result, Operand(dividend, LSR, 31)); | 3903 add(result, result, Operand(dividend, LSR, 31)); |
| 3924 } | 3904 } |
| 3925 | 3905 |
| 3926 } // namespace internal | 3906 } // namespace internal |
| 3927 } // namespace v8 | 3907 } // namespace v8 |
| 3928 | 3908 |
| 3929 #endif // V8_TARGET_ARCH_ARM | 3909 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |