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 Address addr_0 = FlowGraphCompiler::ElementAddressForIntIndex( | 1251 const intptr_t index_scale = |
1252 kTypedDataUint32ArrayCid, | 1252 FlowGraphCompiler::ElementSizeFor(kTypedDataUint32ArrayCid); |
1253 FlowGraphCompiler::ElementSizeFor(kTypedDataUint32ArrayCid), | 1253 const intptr_t offset = |
1254 EBX, | 1254 FlowGraphCompiler::DataOffsetFor(kTypedDataUint32ArrayCid); |
1255 0); | 1255 Address addr_0 = FieldAddress(EBX, 0 * index_scale + offset); |
1256 Address addr_1 = FlowGraphCompiler::ElementAddressForIntIndex( | 1256 Address addr_1 = FieldAddress(EBX, 1 * index_scale + offset); |
1257 kTypedDataUint32ArrayCid, | |
1258 FlowGraphCompiler::ElementSizeFor(kTypedDataUint32ArrayCid), | |
1259 EBX, | |
1260 1); | |
1261 __ movl(EAX, Immediate(a_int32_value)); | 1257 __ movl(EAX, Immediate(a_int32_value)); |
1262 // 64-bit multiply EAX * value -> EDX:EAX. | 1258 // 64-bit multiply EAX * value -> EDX:EAX. |
1263 __ mull(addr_0); | 1259 __ mull(addr_0); |
1264 __ addl(EAX, addr_1); | 1260 __ addl(EAX, addr_1); |
1265 __ adcl(EDX, Immediate(0)); | 1261 __ adcl(EDX, Immediate(0)); |
1266 __ movl(addr_1, EDX); | 1262 __ movl(addr_1, EDX); |
1267 __ movl(addr_0, EAX); | 1263 __ movl(addr_0, EAX); |
1268 __ ret(); | 1264 __ ret(); |
1269 } | 1265 } |
1270 | 1266 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 Isolate::current_tag_offset()); | 1671 Isolate::current_tag_offset()); |
1676 // Set return value to Isolate::current_tag_. | 1672 // Set return value to Isolate::current_tag_. |
1677 __ movl(EAX, current_tag_addr); | 1673 __ movl(EAX, current_tag_addr); |
1678 __ ret(); | 1674 __ ret(); |
1679 } | 1675 } |
1680 | 1676 |
1681 #undef __ | 1677 #undef __ |
1682 } // namespace dart | 1678 } // namespace dart |
1683 | 1679 |
1684 #endif // defined TARGET_ARCH_IA32 | 1680 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |