| 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 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 | 1864 |
| 1865 // Allocates one-byte string of length 'end - start'. The content is not | 1865 // Allocates one-byte string of length 'end - start'. The content is not |
| 1866 // initialized. 'length-reg' contains tagged length. | 1866 // initialized. 'length-reg' contains tagged length. |
| 1867 // Returns new string as tagged pointer in EAX. | 1867 // Returns new string as tagged pointer in EAX. |
| 1868 static void TryAllocateOnebyteString(Assembler* assembler, | 1868 static void TryAllocateOnebyteString(Assembler* assembler, |
| 1869 Label* ok, | 1869 Label* ok, |
| 1870 Label* failure, | 1870 Label* failure, |
| 1871 Register length_reg) { | 1871 Register length_reg) { |
| 1872 __ MaybeTraceAllocation(kOneByteStringCid, EAX, failure, false); |
| 1872 if (length_reg != EDI) { | 1873 if (length_reg != EDI) { |
| 1873 __ movl(EDI, length_reg); | 1874 __ movl(EDI, length_reg); |
| 1874 } | 1875 } |
| 1875 Label pop_and_fail; | 1876 Label pop_and_fail; |
| 1876 __ pushl(EDI); // Preserve length. | 1877 __ pushl(EDI); // Preserve length. |
| 1877 __ SmiUntag(EDI); | 1878 __ SmiUntag(EDI); |
| 1878 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1; | 1879 const intptr_t fixed_size = sizeof(RawString) + kObjectAlignment - 1; |
| 1879 __ leal(EDI, Address(EDI, TIMES_1, fixed_size)); // EDI is untagged. | 1880 __ leal(EDI, Address(EDI, TIMES_1, fixed_size)); // EDI is untagged. |
| 1880 __ andl(EDI, Immediate(-kObjectAlignment)); | 1881 __ andl(EDI, Immediate(-kObjectAlignment)); |
| 1881 | 1882 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2154 Isolate::current_tag_offset()); | 2155 Isolate::current_tag_offset()); |
| 2155 // Set return value to Isolate::current_tag_. | 2156 // Set return value to Isolate::current_tag_. |
| 2156 __ movl(EAX, current_tag_addr); | 2157 __ movl(EAX, current_tag_addr); |
| 2157 __ ret(); | 2158 __ ret(); |
| 2158 } | 2159 } |
| 2159 | 2160 |
| 2160 #undef __ | 2161 #undef __ |
| 2161 } // namespace dart | 2162 } // namespace dart |
| 2162 | 2163 |
| 2163 #endif // defined TARGET_ARCH_IA32 | 2164 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |