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 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1628 const Class& random_class = Class::Handle( | 1628 const Class& random_class = Class::Handle( |
1629 math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1629 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
1630 ASSERT(!random_class.IsNull()); | 1630 ASSERT(!random_class.IsNull()); |
1631 const Field& state_field = Field::ZoneHandle( | 1631 const Field& state_field = Field::ZoneHandle( |
1632 random_class.LookupInstanceField(Symbols::_state())); | 1632 random_class.LookupInstanceField(Symbols::_state())); |
1633 ASSERT(!state_field.IsNull()); | 1633 ASSERT(!state_field.IsNull()); |
1634 const Field& random_A_field = Field::ZoneHandle( | 1634 const Field& random_A_field = Field::ZoneHandle( |
1635 random_class.LookupStaticField(Symbols::_A())); | 1635 random_class.LookupStaticField(Symbols::_A())); |
1636 ASSERT(!random_A_field.IsNull()); | 1636 ASSERT(!random_A_field.IsNull()); |
1637 ASSERT(random_A_field.is_const()); | 1637 ASSERT(random_A_field.is_const()); |
1638 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1638 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); |
1639 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1639 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
1640 // 'a_int_value' is a mask. | 1640 // 'a_int_value' is a mask. |
1641 ASSERT(Utils::IsUint(32, a_int_value)); | 1641 ASSERT(Utils::IsUint(32, a_int_value)); |
1642 int32_t a_int32_value = static_cast<int32_t>(a_int_value); | 1642 int32_t a_int32_value = static_cast<int32_t>(a_int_value); |
1643 __ movl(EAX, Address(ESP, + 1 * kWordSize)); // Receiver. | 1643 // Receiver. |
1644 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); // Field '_state'. | 1644 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
| 1645 // Field '_state'. |
| 1646 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); |
1645 // Addresses of _state[0] and _state[1]. | 1647 // Addresses of _state[0] and _state[1]. |
1646 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); | 1648 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); |
1647 const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid); | 1649 const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid); |
1648 Address addr_0 = FieldAddress(EBX, 0 * scale + offset); | 1650 Address addr_0 = FieldAddress(EBX, 0 * scale + offset); |
1649 Address addr_1 = FieldAddress(EBX, 1 * scale + offset); | 1651 Address addr_1 = FieldAddress(EBX, 1 * scale + offset); |
1650 __ movl(EAX, Immediate(a_int32_value)); | 1652 __ movl(EAX, Immediate(a_int32_value)); |
1651 // 64-bit multiply EAX * value -> EDX:EAX. | 1653 // 64-bit multiply EAX * value -> EDX:EAX. |
1652 __ mull(addr_0); | 1654 __ mull(addr_0); |
1653 __ addl(EAX, addr_1); | 1655 __ addl(EAX, addr_1); |
1654 __ adcl(EDX, Immediate(0)); | 1656 __ adcl(EDX, Immediate(0)); |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2146 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2148 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
2147 __ LoadIsolate(EAX); | 2149 __ LoadIsolate(EAX); |
2148 __ movl(EAX, Address(EAX, Isolate::current_tag_offset())); | 2150 __ movl(EAX, Address(EAX, Isolate::current_tag_offset())); |
2149 __ ret(); | 2151 __ ret(); |
2150 } | 2152 } |
2151 | 2153 |
2152 #undef __ | 2154 #undef __ |
2153 } // namespace dart | 2155 } // namespace dart |
2154 | 2156 |
2155 #endif // defined TARGET_ARCH_IA32 | 2157 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |