| 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 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 const Class& random_class = | 1659 const Class& random_class = |
| 1660 Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1660 Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
| 1661 ASSERT(!random_class.IsNull()); | 1661 ASSERT(!random_class.IsNull()); |
| 1662 const Field& state_field = Field::ZoneHandle( | 1662 const Field& state_field = Field::ZoneHandle( |
| 1663 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); | 1663 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); |
| 1664 ASSERT(!state_field.IsNull()); | 1664 ASSERT(!state_field.IsNull()); |
| 1665 const Field& random_A_field = Field::ZoneHandle( | 1665 const Field& random_A_field = Field::ZoneHandle( |
| 1666 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); | 1666 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); |
| 1667 ASSERT(!random_A_field.IsNull()); | 1667 ASSERT(!random_A_field.IsNull()); |
| 1668 ASSERT(random_A_field.is_const()); | 1668 ASSERT(random_A_field.is_const()); |
| 1669 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); | 1669 Instance& a_value = Instance::Handle(random_A_field.StaticValue()); |
| 1670 if (a_value.raw() == Object::sentinel().raw() || |
| 1671 a_value.raw() == Object::transition_sentinel().raw()) { |
| 1672 random_A_field.EvaluateInitializer(); |
| 1673 a_value = random_A_field.StaticValue(); |
| 1674 } |
| 1670 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1675 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
| 1671 // 'a_int_value' is a mask. | 1676 // 'a_int_value' is a mask. |
| 1672 ASSERT(Utils::IsUint(32, a_int_value)); | 1677 ASSERT(Utils::IsUint(32, a_int_value)); |
| 1673 int32_t a_int32_value = static_cast<int32_t>(a_int_value); | 1678 int32_t a_int32_value = static_cast<int32_t>(a_int_value); |
| 1674 // Receiver. | 1679 // Receiver. |
| 1675 __ movl(EAX, Address(ESP, +1 * kWordSize)); | 1680 __ movl(EAX, Address(ESP, +1 * kWordSize)); |
| 1676 // Field '_state'. | 1681 // Field '_state'. |
| 1677 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); | 1682 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); |
| 1678 // Addresses of _state[0] and _state[1]. | 1683 // Addresses of _state[0] and _state[1]. |
| 1679 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); | 1684 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 __ Bind(&true_label); | 2313 __ Bind(&true_label); |
| 2309 __ LoadObject(EAX, Bool::True()); | 2314 __ LoadObject(EAX, Bool::True()); |
| 2310 __ ret(); | 2315 __ ret(); |
| 2311 } | 2316 } |
| 2312 | 2317 |
| 2313 #undef __ | 2318 #undef __ |
| 2314 | 2319 |
| 2315 } // namespace dart | 2320 } // namespace dart |
| 2316 | 2321 |
| 2317 #endif // defined TARGET_ARCH_IA32 | 2322 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |