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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 const Class& random_class = | 1544 const Class& random_class = |
1545 Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1545 Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
1546 ASSERT(!random_class.IsNull()); | 1546 ASSERT(!random_class.IsNull()); |
1547 const Field& state_field = Field::ZoneHandle( | 1547 const Field& state_field = Field::ZoneHandle( |
1548 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); | 1548 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); |
1549 ASSERT(!state_field.IsNull()); | 1549 ASSERT(!state_field.IsNull()); |
1550 const Field& random_A_field = Field::ZoneHandle( | 1550 const Field& random_A_field = Field::ZoneHandle( |
1551 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); | 1551 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); |
1552 ASSERT(!random_A_field.IsNull()); | 1552 ASSERT(!random_A_field.IsNull()); |
1553 ASSERT(random_A_field.is_const()); | 1553 ASSERT(random_A_field.is_const()); |
1554 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); | 1554 Instance& a_value = Instance::Handle(random_A_field.StaticValue()); |
| 1555 if (a_value.raw() == Object::sentinel().raw() || |
| 1556 a_value.raw() == Object::transition_sentinel().raw()) { |
| 1557 random_A_field.EvaluateInitializer(); |
| 1558 a_value = random_A_field.StaticValue(); |
| 1559 } |
1555 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1560 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
1556 // 'a_int_value' is a mask. | 1561 // 'a_int_value' is a mask. |
1557 ASSERT(Utils::IsUint(32, a_int_value)); | 1562 ASSERT(Utils::IsUint(32, a_int_value)); |
1558 int32_t a_int32_value = static_cast<int32_t>(a_int_value); | 1563 int32_t a_int32_value = static_cast<int32_t>(a_int_value); |
1559 | 1564 |
1560 // Receiver. | 1565 // Receiver. |
1561 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1566 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1562 // Field '_state'. | 1567 // Field '_state'. |
1563 __ ldr(R1, FieldAddress(R0, state_field.Offset())); | 1568 __ ldr(R1, FieldAddress(R0, state_field.Offset())); |
1564 // Addresses of _state[0] and _state[1]. | 1569 // Addresses of _state[0] and _state[1]. |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); | 2294 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); |
2290 __ cmp(R0, Operand(0)); | 2295 __ cmp(R0, Operand(0)); |
2291 __ LoadObject(R0, Bool::True(), NE); | 2296 __ LoadObject(R0, Bool::True(), NE); |
2292 __ LoadObject(R0, Bool::False(), EQ); | 2297 __ LoadObject(R0, Bool::False(), EQ); |
2293 __ Ret(); | 2298 __ Ret(); |
2294 } | 2299 } |
2295 | 2300 |
2296 } // namespace dart | 2301 } // namespace dart |
2297 | 2302 |
2298 #endif // defined TARGET_ARCH_ARM | 2303 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |