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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 ASSERT(!random_A_field.IsNull()); | 1241 ASSERT(!random_A_field.IsNull()); |
1242 ASSERT(random_A_field.is_const()); | 1242 ASSERT(random_A_field.is_const()); |
1243 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1243 const Instance& a_value = Instance::Handle(random_A_field.value()); |
1244 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1244 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
1245 // 'a_int_value' is a mask. | 1245 // 'a_int_value' is a mask. |
1246 ASSERT(Utils::IsUint(32, a_int_value)); | 1246 ASSERT(Utils::IsUint(32, a_int_value)); |
1247 int32_t a_int32_value = static_cast<int32_t>(a_int_value); | 1247 int32_t a_int32_value = static_cast<int32_t>(a_int_value); |
1248 __ movl(EAX, Address(ESP, + 1 * kWordSize)); // Receiver. | 1248 __ movl(EAX, Address(ESP, + 1 * kWordSize)); // Receiver. |
1249 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); // Field '_state'. | 1249 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); // Field '_state'. |
1250 // Addresses of _state[0] and _state[1]. | 1250 // Addresses of _state[0] and _state[1]. |
1251 const intptr_t index_scale = | 1251 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); |
1252 FlowGraphCompiler::ElementSizeFor(kTypedDataUint32ArrayCid); | 1252 const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid); |
1253 const intptr_t offset = | 1253 Address addr_0 = FieldAddress(EBX, 0 * scale + offset); |
1254 FlowGraphCompiler::DataOffsetFor(kTypedDataUint32ArrayCid); | 1254 Address addr_1 = FieldAddress(EBX, 1 * scale + offset); |
1255 Address addr_0 = FieldAddress(EBX, 0 * index_scale + offset); | |
1256 Address addr_1 = FieldAddress(EBX, 1 * index_scale + offset); | |
1257 __ movl(EAX, Immediate(a_int32_value)); | 1255 __ movl(EAX, Immediate(a_int32_value)); |
1258 // 64-bit multiply EAX * value -> EDX:EAX. | 1256 // 64-bit multiply EAX * value -> EDX:EAX. |
1259 __ mull(addr_0); | 1257 __ mull(addr_0); |
1260 __ addl(EAX, addr_1); | 1258 __ addl(EAX, addr_1); |
1261 __ adcl(EDX, Immediate(0)); | 1259 __ adcl(EDX, Immediate(0)); |
1262 __ movl(addr_1, EDX); | 1260 __ movl(addr_1, EDX); |
1263 __ movl(addr_0, EAX); | 1261 __ movl(addr_0, EAX); |
1264 __ ret(); | 1262 __ ret(); |
1265 } | 1263 } |
1266 | 1264 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1671 Isolate::current_tag_offset()); | 1669 Isolate::current_tag_offset()); |
1672 // Set return value to Isolate::current_tag_. | 1670 // Set return value to Isolate::current_tag_. |
1673 __ movl(EAX, current_tag_addr); | 1671 __ movl(EAX, current_tag_addr); |
1674 __ ret(); | 1672 __ ret(); |
1675 } | 1673 } |
1676 | 1674 |
1677 #undef __ | 1675 #undef __ |
1678 } // namespace dart | 1676 } // namespace dart |
1679 | 1677 |
1680 #endif // defined TARGET_ARCH_IA32 | 1678 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |