| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 __ b(&fall_through, LT); \ | 176 __ b(&fall_through, LT); \ |
| 177 __ SmiUntag(R2); \ | 177 __ SmiUntag(R2); \ |
| 178 /* Check for maximum allowed length. */ \ | 178 /* Check for maximum allowed length. */ \ |
| 179 /* R2: untagged array length. */ \ | 179 /* R2: untagged array length. */ \ |
| 180 __ CompareImmediate(R2, max_len); \ | 180 __ CompareImmediate(R2, max_len); \ |
| 181 __ b(&fall_through, GT); \ | 181 __ b(&fall_through, GT); \ |
| 182 __ mov(R2, Operand(R2, LSL, scale_shift)); \ | 182 __ mov(R2, Operand(R2, LSL, scale_shift)); \ |
| 183 const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \ | 183 const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \ |
| 184 __ AddImmediate(R2, fixed_size); \ | 184 __ AddImmediate(R2, fixed_size); \ |
| 185 __ bic(R2, R2, Operand(kObjectAlignment - 1)); \ | 185 __ bic(R2, R2, Operand(kObjectAlignment - 1)); \ |
| 186 Heap::Space space = Heap::SpaceForAllocation(cid); \ | 186 Heap::Space space = Heap::kNew; \ |
| 187 __ ldr(R3, Address(THR, Thread::heap_offset())); \ | 187 __ ldr(R3, Address(THR, Thread::heap_offset())); \ |
| 188 __ ldr(R0, Address(R3, Heap::TopOffset(space))); \ | 188 __ ldr(R0, Address(R3, Heap::TopOffset(space))); \ |
| 189 \ | 189 \ |
| 190 /* R2: allocation size. */ \ | 190 /* R2: allocation size. */ \ |
| 191 __ adds(R1, R0, Operand(R2)); \ | 191 __ adds(R1, R0, Operand(R2)); \ |
| 192 __ b(&fall_through, CS); /* Fail on unsigned overflow. */ \ | 192 __ b(&fall_through, CS); /* Fail on unsigned overflow. */ \ |
| 193 \ | 193 \ |
| 194 /* Check if the allocation fits into the remaining space. */ \ | 194 /* Check if the allocation fits into the remaining space. */ \ |
| 195 /* R0: potential new object start. */ \ | 195 /* R0: potential new object start. */ \ |
| 196 /* R1: potential next object start. */ \ | 196 /* R1: potential next object start. */ \ |
| (...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 Label fail; | 1826 Label fail; |
| 1827 __ MaybeTraceAllocation(kOneByteStringCid, R0, failure); | 1827 __ MaybeTraceAllocation(kOneByteStringCid, R0, failure); |
| 1828 __ mov(R8, Operand(length_reg)); // Save the length register. | 1828 __ mov(R8, Operand(length_reg)); // Save the length register. |
| 1829 // TODO(koda): Protect against negative length and overflow here. | 1829 // TODO(koda): Protect against negative length and overflow here. |
| 1830 __ SmiUntag(length_reg); | 1830 __ SmiUntag(length_reg); |
| 1831 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1; | 1831 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1; |
| 1832 __ AddImmediate(length_reg, fixed_size); | 1832 __ AddImmediate(length_reg, fixed_size); |
| 1833 __ bic(length_reg, length_reg, Operand(kObjectAlignment - 1)); | 1833 __ bic(length_reg, length_reg, Operand(kObjectAlignment - 1)); |
| 1834 | 1834 |
| 1835 const intptr_t cid = kOneByteStringCid; | 1835 const intptr_t cid = kOneByteStringCid; |
| 1836 Heap::Space space = Heap::SpaceForAllocation(cid); | 1836 Heap::Space space = Heap::kNew; |
| 1837 __ ldr(R3, Address(THR, Thread::heap_offset())); | 1837 __ ldr(R3, Address(THR, Thread::heap_offset())); |
| 1838 __ ldr(R0, Address(R3, Heap::TopOffset(space))); | 1838 __ ldr(R0, Address(R3, Heap::TopOffset(space))); |
| 1839 | 1839 |
| 1840 // length_reg: allocation size. | 1840 // length_reg: allocation size. |
| 1841 __ adds(R1, R0, Operand(length_reg)); | 1841 __ adds(R1, R0, Operand(length_reg)); |
| 1842 __ b(&fail, CS); // Fail on unsigned overflow. | 1842 __ b(&fail, CS); // Fail on unsigned overflow. |
| 1843 | 1843 |
| 1844 // Check if the allocation fits into the remaining space. | 1844 // Check if the allocation fits into the remaining space. |
| 1845 // R0: potential new object start. | 1845 // R0: potential new object start. |
| 1846 // R1: potential next object start. | 1846 // R1: potential next object start. |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); | 2127 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); |
| 2128 __ cmp(R0, Operand(0)); | 2128 __ cmp(R0, Operand(0)); |
| 2129 __ LoadObject(R0, Bool::True(), NE); | 2129 __ LoadObject(R0, Bool::True(), NE); |
| 2130 __ LoadObject(R0, Bool::False(), EQ); | 2130 __ LoadObject(R0, Bool::False(), EQ); |
| 2131 __ Ret(); | 2131 __ Ret(); |
| 2132 } | 2132 } |
| 2133 | 2133 |
| 2134 } // namespace dart | 2134 } // namespace dart |
| 2135 | 2135 |
| 2136 #endif // defined TARGET_ARCH_ARM | 2136 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |