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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 } | 1308 } |
1309 | 1309 |
1310 | 1310 |
1311 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; | 1311 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; |
1312 // _state[kSTATE_LO] = state & _MASK_32; | 1312 // _state[kSTATE_LO] = state & _MASK_32; |
1313 // _state[kSTATE_HI] = state >> 32; | 1313 // _state[kSTATE_HI] = state >> 32; |
1314 void Intrinsifier::Random_nextState(Assembler* assembler) { | 1314 void Intrinsifier::Random_nextState(Assembler* assembler) { |
1315 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 1315 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
1316 ASSERT(!math_lib.IsNull()); | 1316 ASSERT(!math_lib.IsNull()); |
1317 const Class& random_class = Class::Handle( | 1317 const Class& random_class = Class::Handle( |
1318 math_lib.LookupClassAllowPrivate(Symbols::_Random(), NULL)); | 1318 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
1319 ASSERT(!random_class.IsNull()); | 1319 ASSERT(!random_class.IsNull()); |
1320 const Field& state_field = Field::ZoneHandle( | 1320 const Field& state_field = Field::ZoneHandle( |
1321 random_class.LookupInstanceField(Symbols::_state())); | 1321 random_class.LookupInstanceField(Symbols::_state())); |
1322 ASSERT(!state_field.IsNull()); | 1322 ASSERT(!state_field.IsNull()); |
1323 const Field& random_A_field = Field::ZoneHandle( | 1323 const Field& random_A_field = Field::ZoneHandle( |
1324 random_class.LookupStaticField(Symbols::_A())); | 1324 random_class.LookupStaticField(Symbols::_A())); |
1325 ASSERT(!random_A_field.IsNull()); | 1325 ASSERT(!random_A_field.IsNull()); |
1326 ASSERT(random_A_field.is_const()); | 1326 ASSERT(random_A_field.is_const()); |
1327 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1327 const Instance& a_value = Instance::Handle(random_A_field.value()); |
1328 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1328 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 | 1649 |
1650 __ Bind(&fall_through); | 1650 __ Bind(&fall_through); |
1651 } | 1651 } |
1652 | 1652 |
1653 | 1653 |
1654 #undef __ | 1654 #undef __ |
1655 | 1655 |
1656 } // namespace dart | 1656 } // namespace dart |
1657 | 1657 |
1658 #endif // defined TARGET_ARCH_X64 | 1658 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |