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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 RAX); | 123 RAX); |
124 __ LoadObject(RAX, Object::null_object(), PP); | 124 __ LoadObject(RAX, Object::null_object(), PP); |
125 __ ret(); | 125 __ ret(); |
126 __ Bind(&fall_through); | 126 __ Bind(&fall_through); |
127 } | 127 } |
128 | 128 |
129 | 129 |
130 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \ | 130 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \ |
131 Label fall_through; \ | 131 Label fall_through; \ |
132 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \ | 132 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \ |
| 133 __ MaybeTraceAllocation(cid, &fall_through, false); \ |
133 __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \ | 134 __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \ |
134 /* Check that length is a positive Smi. */ \ | 135 /* Check that length is a positive Smi. */ \ |
135 /* RDI: requested array length argument. */ \ | 136 /* RDI: requested array length argument. */ \ |
136 __ testq(RDI, Immediate(kSmiTagMask)); \ | 137 __ testq(RDI, Immediate(kSmiTagMask)); \ |
137 __ j(NOT_ZERO, &fall_through); \ | 138 __ j(NOT_ZERO, &fall_through); \ |
138 __ cmpq(RDI, Immediate(0)); \ | 139 __ cmpq(RDI, Immediate(0)); \ |
139 __ j(LESS, &fall_through); \ | 140 __ j(LESS, &fall_through); \ |
140 __ SmiUntag(RDI); \ | 141 __ SmiUntag(RDI); \ |
141 /* Check for maximum allowed length. */ \ | 142 /* Check for maximum allowed length. */ \ |
142 /* RDI: untagged array length. */ \ | 143 /* RDI: untagged array length. */ \ |
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 // Set return value to Isolate::current_tag_. | 2016 // Set return value to Isolate::current_tag_. |
2016 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 2017 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
2017 __ ret(); | 2018 __ ret(); |
2018 } | 2019 } |
2019 | 2020 |
2020 #undef __ | 2021 #undef __ |
2021 | 2022 |
2022 } // namespace dart | 2023 } // namespace dart |
2023 | 2024 |
2024 #endif // defined TARGET_ARCH_X64 | 2025 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |