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 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 const Class& random_class = Class::Handle( | 1663 const Class& random_class = Class::Handle( |
1664 math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1664 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
1665 ASSERT(!random_class.IsNull()); | 1665 ASSERT(!random_class.IsNull()); |
1666 const Field& state_field = Field::ZoneHandle( | 1666 const Field& state_field = Field::ZoneHandle( |
1667 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); | 1667 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); |
1668 ASSERT(!state_field.IsNull()); | 1668 ASSERT(!state_field.IsNull()); |
1669 const Field& random_A_field = Field::ZoneHandle( | 1669 const Field& random_A_field = Field::ZoneHandle( |
1670 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); | 1670 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); |
1671 ASSERT(!random_A_field.IsNull()); | 1671 ASSERT(!random_A_field.IsNull()); |
1672 ASSERT(random_A_field.is_const()); | 1672 ASSERT(random_A_field.is_const()); |
1673 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); | 1673 Instance& a_value = Instance::Handle(random_A_field.StaticValue()); |
| 1674 if (a_value.raw() == Object::sentinel().raw() || |
| 1675 a_value.raw() == Object::transition_sentinel().raw()) { |
| 1676 random_A_field.EvaluateInitializer(); |
| 1677 a_value = random_A_field.StaticValue(); |
| 1678 } |
1674 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1679 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
1675 // 'a_int_value' is a mask. | 1680 // 'a_int_value' is a mask. |
1676 ASSERT(Utils::IsUint(32, a_int_value)); | 1681 ASSERT(Utils::IsUint(32, a_int_value)); |
1677 int32_t a_int32_value = static_cast<int32_t>(a_int_value); | 1682 int32_t a_int32_value = static_cast<int32_t>(a_int_value); |
1678 // Receiver. | 1683 // Receiver. |
1679 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | 1684 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
1680 // Field '_state'. | 1685 // Field '_state'. |
1681 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); | 1686 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); |
1682 // Addresses of _state[0] and _state[1]. | 1687 // Addresses of _state[0] and _state[1]. |
1683 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); | 1688 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2331 __ Bind(&true_label); | 2336 __ Bind(&true_label); |
2332 __ LoadObject(EAX, Bool::True()); | 2337 __ LoadObject(EAX, Bool::True()); |
2333 __ ret(); | 2338 __ ret(); |
2334 } | 2339 } |
2335 | 2340 |
2336 #undef __ | 2341 #undef __ |
2337 | 2342 |
2338 } // namespace dart | 2343 } // namespace dart |
2339 | 2344 |
2340 #endif // defined TARGET_ARCH_IA32 | 2345 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |