| 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 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 cmp(result, ip); | 1688 cmp(result, ip); |
| 1689 Check(eq, kUnexpectedAllocationTop); | 1689 Check(eq, kUnexpectedAllocationTop); |
| 1690 } | 1690 } |
| 1691 // Load allocation limit into ip. Result already contains allocation top. | 1691 // Load allocation limit into ip. Result already contains allocation top. |
| 1692 ldr(ip, MemOperand(topaddr, limit - top)); | 1692 ldr(ip, MemOperand(topaddr, limit - top)); |
| 1693 } | 1693 } |
| 1694 | 1694 |
| 1695 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1695 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1696 // Align the next allocation. Storing the filler map without checking top is | 1696 // Align the next allocation. Storing the filler map without checking top is |
| 1697 // safe in new-space because the limit of the heap is aligned there. | 1697 // safe in new-space because the limit of the heap is aligned there. |
| 1698 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
| 1699 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment); | 1698 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment); |
| 1700 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC); | 1699 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC); |
| 1701 Label aligned; | 1700 Label aligned; |
| 1702 b(eq, &aligned); | 1701 b(eq, &aligned); |
| 1703 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1702 if ((flags & PRETENURE) != 0) { |
| 1704 cmp(result, Operand(ip)); | 1703 cmp(result, Operand(ip)); |
| 1705 b(hs, gc_required); | 1704 b(hs, gc_required); |
| 1706 } | 1705 } |
| 1707 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); | 1706 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); |
| 1708 str(scratch2, MemOperand(result, kDoubleSize / 2, PostIndex)); | 1707 str(scratch2, MemOperand(result, kDoubleSize / 2, PostIndex)); |
| 1709 bind(&aligned); | 1708 bind(&aligned); |
| 1710 } | 1709 } |
| 1711 | 1710 |
| 1712 // Calculate new top and bail out if new space is exhausted. Use result | 1711 // Calculate new top and bail out if new space is exhausted. Use result |
| 1713 // to calculate the new top. We must preserve the ip register at this | 1712 // to calculate the new top. We must preserve the ip register at this |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 cmp(result, ip); | 1801 cmp(result, ip); |
| 1803 Check(eq, kUnexpectedAllocationTop); | 1802 Check(eq, kUnexpectedAllocationTop); |
| 1804 } | 1803 } |
| 1805 // Load allocation limit into ip. Result already contains allocation top. | 1804 // Load allocation limit into ip. Result already contains allocation top. |
| 1806 ldr(ip, MemOperand(topaddr, limit - top)); | 1805 ldr(ip, MemOperand(topaddr, limit - top)); |
| 1807 } | 1806 } |
| 1808 | 1807 |
| 1809 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1808 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1810 // Align the next allocation. Storing the filler map without checking top is | 1809 // Align the next allocation. Storing the filler map without checking top is |
| 1811 // safe in new-space because the limit of the heap is aligned there. | 1810 // safe in new-space because the limit of the heap is aligned there. |
| 1812 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
| 1813 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1811 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
| 1814 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC); | 1812 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC); |
| 1815 Label aligned; | 1813 Label aligned; |
| 1816 b(eq, &aligned); | 1814 b(eq, &aligned); |
| 1817 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1815 if ((flags & PRETENURE) != 0) { |
| 1818 cmp(result, Operand(ip)); | 1816 cmp(result, Operand(ip)); |
| 1819 b(hs, gc_required); | 1817 b(hs, gc_required); |
| 1820 } | 1818 } |
| 1821 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); | 1819 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); |
| 1822 str(scratch2, MemOperand(result, kDoubleSize / 2, PostIndex)); | 1820 str(scratch2, MemOperand(result, kDoubleSize / 2, PostIndex)); |
| 1823 bind(&aligned); | 1821 bind(&aligned); |
| 1824 } | 1822 } |
| 1825 | 1823 |
| 1826 // Calculate new top and bail out if new space is exhausted. Use result | 1824 // Calculate new top and bail out if new space is exhausted. Use result |
| 1827 // to calculate the new top. Object size may be in words so a shift is | 1825 // to calculate the new top. Object size may be in words so a shift is |
| (...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3894 } | 3892 } |
| 3895 } | 3893 } |
| 3896 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3894 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 3897 add(result, result, Operand(dividend, LSR, 31)); | 3895 add(result, result, Operand(dividend, LSR, 31)); |
| 3898 } | 3896 } |
| 3899 | 3897 |
| 3900 } // namespace internal | 3898 } // namespace internal |
| 3901 } // namespace v8 | 3899 } // namespace v8 |
| 3902 | 3900 |
| 3903 #endif // V8_TARGET_ARCH_ARM | 3901 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |