| 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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; | 1493 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; |
| 1494 // _state[kSTATE_LO] = state & _MASK_32; | 1494 // _state[kSTATE_LO] = state & _MASK_32; |
| 1495 // _state[kSTATE_HI] = state >> 32; | 1495 // _state[kSTATE_HI] = state >> 32; |
| 1496 void Intrinsifier::Random_nextState(Assembler* assembler) { | 1496 void Intrinsifier::Random_nextState(Assembler* assembler) { |
| 1497 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 1497 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
| 1498 ASSERT(!math_lib.IsNull()); | 1498 ASSERT(!math_lib.IsNull()); |
| 1499 const Class& random_class = Class::Handle( | 1499 const Class& random_class = Class::Handle( |
| 1500 math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1500 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
| 1501 ASSERT(!random_class.IsNull()); | 1501 ASSERT(!random_class.IsNull()); |
| 1502 const Field& state_field = Field::ZoneHandle( | 1502 const Field& state_field = Field::ZoneHandle( |
| 1503 random_class.LookupInstanceField(Symbols::_state())); | 1503 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state())); |
| 1504 ASSERT(!state_field.IsNull()); | 1504 ASSERT(!state_field.IsNull()); |
| 1505 const Field& random_A_field = Field::ZoneHandle( | 1505 const Field& random_A_field = Field::ZoneHandle( |
| 1506 random_class.LookupStaticField(Symbols::_A())); | 1506 random_class.LookupStaticFieldAllowPrivate(Symbols::_A())); |
| 1507 ASSERT(!random_A_field.IsNull()); | 1507 ASSERT(!random_A_field.IsNull()); |
| 1508 ASSERT(random_A_field.is_const()); | 1508 ASSERT(random_A_field.is_const()); |
| 1509 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); | 1509 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); |
| 1510 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1510 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
| 1511 // 'a_int_value' is a mask. | 1511 // 'a_int_value' is a mask. |
| 1512 ASSERT(Utils::IsUint(32, a_int_value)); | 1512 ASSERT(Utils::IsUint(32, a_int_value)); |
| 1513 int32_t a_int32_value = static_cast<int32_t>(a_int_value); | 1513 int32_t a_int32_value = static_cast<int32_t>(a_int_value); |
| 1514 | 1514 |
| 1515 // Receiver. | 1515 // Receiver. |
| 1516 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1516 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2134 | 2134 |
| 2135 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2135 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 2136 __ LoadIsolate(R0); | 2136 __ LoadIsolate(R0); |
| 2137 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); | 2137 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); |
| 2138 __ Ret(); | 2138 __ Ret(); |
| 2139 } | 2139 } |
| 2140 | 2140 |
| 2141 } // namespace dart | 2141 } // namespace dart |
| 2142 | 2142 |
| 2143 #endif // defined TARGET_ARCH_ARM | 2143 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |