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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // This snippet of inlined code uses the following registers: | 107 // This snippet of inlined code uses the following registers: |
108 // EAX, EBX | 108 // EAX, EBX |
109 // and the newly allocated object is returned in EAX. | 109 // and the newly allocated object is returned in EAX. |
110 const intptr_t kTypeArgumentsOffset = 2 * kWordSize; | 110 const intptr_t kTypeArgumentsOffset = 2 * kWordSize; |
111 const intptr_t kArrayOffset = 1 * kWordSize; | 111 const intptr_t kArrayOffset = 1 * kWordSize; |
112 Label fall_through; | 112 Label fall_through; |
113 | 113 |
114 // Try allocating in new space. | 114 // Try allocating in new space. |
115 const Class& cls = Class::Handle( | 115 const Class& cls = Class::Handle( |
116 Isolate::Current()->object_store()->growable_object_array_class()); | 116 Isolate::Current()->object_store()->growable_object_array_class()); |
117 const bool jump_length = VerifiedMemory::enabled() ? | 117 __ TryAllocate(cls, &fall_through, Assembler::kNearJump, EAX, EBX); |
118 Assembler::kFarJump : | |
119 Assembler::kNearJump; | |
120 __ TryAllocate(cls, &fall_through, jump_length, EAX, EBX); | |
121 | 118 |
122 // Store backing array object in growable array object. | 119 // Store backing array object in growable array object. |
123 __ movl(EBX, Address(ESP, kArrayOffset)); // data argument. | 120 __ movl(EBX, Address(ESP, kArrayOffset)); // data argument. |
124 // EAX is new, no barrier needed. | 121 // EAX is new, no barrier needed. |
125 __ StoreIntoObjectNoBarrier( | 122 __ StoreIntoObjectNoBarrier( |
126 EAX, | 123 EAX, |
127 FieldAddress(EAX, GrowableObjectArray::data_offset()), | 124 FieldAddress(EAX, GrowableObjectArray::data_offset()), |
128 EBX); | 125 EBX); |
129 | 126 |
130 // EAX: new growable array object start as a tagged pointer. | 127 // EAX: new growable array object start as a tagged pointer. |
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 Isolate::current_tag_offset()); | 2090 Isolate::current_tag_offset()); |
2094 // Set return value to Isolate::current_tag_. | 2091 // Set return value to Isolate::current_tag_. |
2095 __ movl(EAX, current_tag_addr); | 2092 __ movl(EAX, current_tag_addr); |
2096 __ ret(); | 2093 __ ret(); |
2097 } | 2094 } |
2098 | 2095 |
2099 #undef __ | 2096 #undef __ |
2100 } // namespace dart | 2097 } // namespace dart |
2101 | 2098 |
2102 #endif // defined TARGET_ARCH_IA32 | 2099 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |