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 // The intrinsic code below is executed before a method has built its frame. | 5 // The intrinsic code below is executed before a method has built its frame. |
6 // The return address is on the stack and the arguments below it. | 6 // The return address is on the stack and the arguments below it. |
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. | 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. |
8 // Each intrinsification method returns true if the corresponding | 8 // Each intrinsification method returns true if the corresponding |
9 // Dart method was intrinsified. | 9 // Dart method was intrinsified. |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 Immediate(reinterpret_cast<int32_t>(Object::null())); | 179 Immediate(reinterpret_cast<int32_t>(Object::null())); |
180 __ movl(EAX, raw_null); | 180 __ movl(EAX, raw_null); |
181 __ ret(); | 181 __ ret(); |
182 __ Bind(&fall_through); | 182 __ Bind(&fall_through); |
183 } | 183 } |
184 | 184 |
185 | 185 |
186 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \ | 186 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \ |
187 Label fall_through; \ | 187 Label fall_through; \ |
188 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \ | 188 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \ |
| 189 __ MaybeTraceAllocation(cid, EDI, &fall_through, false); \ |
189 __ movl(EDI, Address(ESP, kArrayLengthStackOffset)); /* Array length. */ \ | 190 __ movl(EDI, Address(ESP, kArrayLengthStackOffset)); /* Array length. */ \ |
190 /* Check that length is a positive Smi. */ \ | 191 /* Check that length is a positive Smi. */ \ |
191 /* EDI: requested array length argument. */ \ | 192 /* EDI: requested array length argument. */ \ |
192 __ testl(EDI, Immediate(kSmiTagMask)); \ | 193 __ testl(EDI, Immediate(kSmiTagMask)); \ |
193 __ j(NOT_ZERO, &fall_through); \ | 194 __ j(NOT_ZERO, &fall_through); \ |
194 __ cmpl(EDI, Immediate(0)); \ | 195 __ cmpl(EDI, Immediate(0)); \ |
195 __ j(LESS, &fall_through); \ | 196 __ j(LESS, &fall_through); \ |
196 __ SmiUntag(EDI); \ | 197 __ SmiUntag(EDI); \ |
197 /* Check for maximum allowed length. */ \ | 198 /* Check for maximum allowed length. */ \ |
198 /* EDI: untagged array length. */ \ | 199 /* EDI: untagged array length. */ \ |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 Isolate::current_tag_offset()); | 2154 Isolate::current_tag_offset()); |
2154 // Set return value to Isolate::current_tag_. | 2155 // Set return value to Isolate::current_tag_. |
2155 __ movl(EAX, current_tag_addr); | 2156 __ movl(EAX, current_tag_addr); |
2156 __ ret(); | 2157 __ ret(); |
2157 } | 2158 } |
2158 | 2159 |
2159 #undef __ | 2160 #undef __ |
2160 } // namespace dart | 2161 } // namespace dart |
2161 | 2162 |
2162 #endif // defined TARGET_ARCH_IA32 | 2163 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |