OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
9 | 9 |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 const Class& random_class = Class::Handle( | 1612 const Class& random_class = Class::Handle( |
1613 math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1613 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
1614 ASSERT(!random_class.IsNull()); | 1614 ASSERT(!random_class.IsNull()); |
1615 const Field& state_field = Field::ZoneHandle( | 1615 const Field& state_field = Field::ZoneHandle( |
1616 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); | 1616 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); |
1617 ASSERT(!state_field.IsNull()); | 1617 ASSERT(!state_field.IsNull()); |
1618 const Field& random_A_field = Field::ZoneHandle( | 1618 const Field& random_A_field = Field::ZoneHandle( |
1619 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); | 1619 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); |
1620 ASSERT(!random_A_field.IsNull()); | 1620 ASSERT(!random_A_field.IsNull()); |
1621 ASSERT(random_A_field.is_const()); | 1621 ASSERT(random_A_field.is_const()); |
1622 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); | 1622 Instance& a_value = Instance::Handle(random_A_field.StaticValue()); |
| 1623 if (a_value.raw() == Object::sentinel().raw() || |
| 1624 a_value.raw() == Object::transition_sentinel().raw()) { |
| 1625 random_A_field.EvaluateInitializer(); |
| 1626 a_value = random_A_field.StaticValue(); |
| 1627 } |
1623 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1628 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
1624 | 1629 |
1625 // Receiver. | 1630 // Receiver. |
1626 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1631 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1627 // Field '_state'. | 1632 // Field '_state'. |
1628 __ ldr(R1, FieldAddress(R0, state_field.Offset())); | 1633 __ ldr(R1, FieldAddress(R0, state_field.Offset())); |
1629 | 1634 |
1630 // Addresses of _state[0]. | 1635 // Addresses of _state[0]. |
1631 const int64_t disp = | 1636 const int64_t disp = |
1632 Instance::DataOffsetFor(kTypedDataUint32ArrayCid) - kHeapObjectTag; | 1637 Instance::DataOffsetFor(kTypedDataUint32ArrayCid) - kHeapObjectTag; |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2367 __ cmp(R0, Operand(0)); | 2372 __ cmp(R0, Operand(0)); |
2368 __ LoadObject(R0, Bool::False()); | 2373 __ LoadObject(R0, Bool::False()); |
2369 __ LoadObject(TMP, Bool::True()); | 2374 __ LoadObject(TMP, Bool::True()); |
2370 __ csel(R0, TMP, R0, NE); | 2375 __ csel(R0, TMP, R0, NE); |
2371 __ ret(); | 2376 __ ret(); |
2372 } | 2377 } |
2373 | 2378 |
2374 } // namespace dart | 2379 } // namespace dart |
2375 | 2380 |
2376 #endif // defined TARGET_ARCH_ARM64 | 2381 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |