| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 /* Special case for scaling by 16. */ \ | 216 /* Special case for scaling by 16. */ \ |
| 217 if (scale_factor == TIMES_16) { \ | 217 if (scale_factor == TIMES_16) { \ |
| 218 /* double length of array. */ \ | 218 /* double length of array. */ \ |
| 219 __ addl(EDI, EDI); \ | 219 __ addl(EDI, EDI); \ |
| 220 /* only scale by 8. */ \ | 220 /* only scale by 8. */ \ |
| 221 scale_factor = TIMES_8; \ | 221 scale_factor = TIMES_8; \ |
| 222 } \ | 222 } \ |
| 223 const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \ | 223 const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \ |
| 224 __ leal(EDI, Address(EDI, scale_factor, fixed_size)); \ | 224 __ leal(EDI, Address(EDI, scale_factor, fixed_size)); \ |
| 225 __ andl(EDI, Immediate(-kObjectAlignment)); \ | 225 __ andl(EDI, Immediate(-kObjectAlignment)); \ |
| 226 Heap::Space space = Heap::SpaceForAllocation(cid); \ | 226 Heap::Space space = Heap::kNew; \ |
| 227 __ movl(ECX, Address(THR, Thread::heap_offset())); \ | 227 __ movl(ECX, Address(THR, Thread::heap_offset())); \ |
| 228 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); \ | 228 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); \ |
| 229 __ movl(EBX, EAX); \ | 229 __ movl(EBX, EAX); \ |
| 230 \ | 230 \ |
| 231 /* EDI: allocation size. */ \ | 231 /* EDI: allocation size. */ \ |
| 232 __ addl(EBX, EDI); \ | 232 __ addl(EBX, EDI); \ |
| 233 __ j(CARRY, &fall_through); \ | 233 __ j(CARRY, &fall_through); \ |
| 234 \ | 234 \ |
| 235 /* Check if the allocation fits into the remaining space. */ \ | 235 /* Check if the allocation fits into the remaining space. */ \ |
| 236 /* EAX: potential new object start. */ \ | 236 /* EAX: potential new object start. */ \ |
| (...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 __ movl(EDI, length_reg); | 1864 __ movl(EDI, length_reg); |
| 1865 } | 1865 } |
| 1866 Label pop_and_fail; | 1866 Label pop_and_fail; |
| 1867 __ pushl(EDI); // Preserve length. | 1867 __ pushl(EDI); // Preserve length. |
| 1868 __ SmiUntag(EDI); | 1868 __ SmiUntag(EDI); |
| 1869 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1; | 1869 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1; |
| 1870 __ leal(EDI, Address(EDI, TIMES_1, fixed_size)); // EDI is untagged. | 1870 __ leal(EDI, Address(EDI, TIMES_1, fixed_size)); // EDI is untagged. |
| 1871 __ andl(EDI, Immediate(-kObjectAlignment)); | 1871 __ andl(EDI, Immediate(-kObjectAlignment)); |
| 1872 | 1872 |
| 1873 const intptr_t cid = kOneByteStringCid; | 1873 const intptr_t cid = kOneByteStringCid; |
| 1874 Heap::Space space = Heap::SpaceForAllocation(cid); | 1874 Heap::Space space = Heap::kNew; |
| 1875 __ movl(ECX, Address(THR, Thread::heap_offset())); | 1875 __ movl(ECX, Address(THR, Thread::heap_offset())); |
| 1876 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); | 1876 __ movl(EAX, Address(ECX, Heap::TopOffset(space))); |
| 1877 __ movl(EBX, EAX); | 1877 __ movl(EBX, EAX); |
| 1878 | 1878 |
| 1879 // EDI: allocation size. | 1879 // EDI: allocation size. |
| 1880 __ addl(EBX, EDI); | 1880 __ addl(EBX, EDI); |
| 1881 __ j(CARRY, &pop_and_fail); | 1881 __ j(CARRY, &pop_and_fail); |
| 1882 | 1882 |
| 1883 // Check if the allocation fits into the remaining space. | 1883 // Check if the allocation fits into the remaining space. |
| 1884 // EAX: potential new object start. | 1884 // EAX: potential new object start. |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 __ Bind(&true_label); | 2153 __ Bind(&true_label); |
| 2154 __ LoadObject(EAX, Bool::True()); | 2154 __ LoadObject(EAX, Bool::True()); |
| 2155 __ ret(); | 2155 __ ret(); |
| 2156 } | 2156 } |
| 2157 | 2157 |
| 2158 #undef __ | 2158 #undef __ |
| 2159 | 2159 |
| 2160 } // namespace dart | 2160 } // namespace dart |
| 2161 | 2161 |
| 2162 #endif // defined TARGET_ARCH_IA32 | 2162 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |