OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 case 16: return 4; | 191 case 16: return 4; |
192 } | 192 } |
193 UNREACHABLE(); | 193 UNREACHABLE(); |
194 return -1; | 194 return -1; |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_shift) \ | 198 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_shift) \ |
199 Label fall_through; \ | 199 Label fall_through; \ |
200 const intptr_t kArrayLengthStackOffset = 0 * kWordSize; \ | 200 const intptr_t kArrayLengthStackOffset = 0 * kWordSize; \ |
| 201 __ MaybeTraceAllocation(cid, R2, kNoPP, &fall_through); \ |
201 __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \ | 202 __ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \ |
202 /* Check that length is a positive Smi. */ \ | 203 /* Check that length is a positive Smi. */ \ |
203 /* R2: requested array length argument. */ \ | 204 /* R2: requested array length argument. */ \ |
204 __ tsti(R2, Immediate(kSmiTagMask)); \ | 205 __ tsti(R2, Immediate(kSmiTagMask)); \ |
205 __ b(&fall_through, NE); \ | 206 __ b(&fall_through, NE); \ |
206 __ CompareRegisters(R2, ZR); \ | 207 __ CompareRegisters(R2, ZR); \ |
207 __ b(&fall_through, LT); \ | 208 __ b(&fall_through, LT); \ |
208 __ SmiUntag(R2); \ | 209 __ SmiUntag(R2); \ |
209 /* Check for maximum allowed length. */ \ | 210 /* Check for maximum allowed length. */ \ |
210 /* R2: untagged array length. */ \ | 211 /* R2: untagged array length. */ \ |
(...skipping 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2137 Isolate* isolate = Isolate::Current(); | 2138 Isolate* isolate = Isolate::Current(); |
2138 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); | 2139 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); |
2139 // Set return value to Isolate::current_tag_. | 2140 // Set return value to Isolate::current_tag_. |
2140 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2141 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
2141 __ ret(); | 2142 __ ret(); |
2142 } | 2143 } |
2143 | 2144 |
2144 } // namespace dart | 2145 } // namespace dart |
2145 | 2146 |
2146 #endif // defined TARGET_ARCH_ARM64 | 2147 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |