| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 | 162 |
| 163 void Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { | 163 void Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { |
| 164 return Array_getIndexed(assembler); | 164 return Array_getIndexed(assembler); |
| 165 } | 165 } |
| 166 | 166 |
| 167 | 167 |
| 168 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { | 168 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { |
| 169 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 169 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| 170 const Class& cls = Class::Handle( | 170 const Class& cls = Class::Handle( |
| 171 core_lib.LookupClassAllowPrivate(Symbols::ObjectArray(), NULL)); | 171 core_lib.LookupClassAllowPrivate(Symbols::ObjectArray())); |
| 172 ASSERT(!cls.IsNull()); | 172 ASSERT(!cls.IsNull()); |
| 173 ASSERT(cls.HasTypeArguments()); | 173 ASSERT(cls.HasTypeArguments()); |
| 174 ASSERT(cls.NumTypeArguments() == 1); | 174 ASSERT(cls.NumTypeArguments() == 1); |
| 175 const intptr_t field_offset = cls.type_arguments_field_offset(); | 175 const intptr_t field_offset = cls.type_arguments_field_offset(); |
| 176 ASSERT(field_offset != Class::kNoTypeArguments); | 176 ASSERT(field_offset != Class::kNoTypeArguments); |
| 177 return field_offset; | 177 return field_offset; |
| 178 } | 178 } |
| 179 | 179 |
| 180 | 180 |
| 181 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 181 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 } | 1330 } |
| 1331 | 1331 |
| 1332 | 1332 |
| 1333 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; | 1333 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; |
| 1334 // _state[kSTATE_LO] = state & _MASK_32; | 1334 // _state[kSTATE_LO] = state & _MASK_32; |
| 1335 // _state[kSTATE_HI] = state >> 32; | 1335 // _state[kSTATE_HI] = state >> 32; |
| 1336 void Intrinsifier::Random_nextState(Assembler* assembler) { | 1336 void Intrinsifier::Random_nextState(Assembler* assembler) { |
| 1337 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 1337 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
| 1338 ASSERT(!math_lib.IsNull()); | 1338 ASSERT(!math_lib.IsNull()); |
| 1339 const Class& random_class = Class::Handle( | 1339 const Class& random_class = Class::Handle( |
| 1340 math_lib.LookupClassAllowPrivate(Symbols::_Random(), NULL)); | 1340 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
| 1341 ASSERT(!random_class.IsNull()); | 1341 ASSERT(!random_class.IsNull()); |
| 1342 const Field& state_field = Field::ZoneHandle( | 1342 const Field& state_field = Field::ZoneHandle( |
| 1343 random_class.LookupInstanceField(Symbols::_state())); | 1343 random_class.LookupInstanceField(Symbols::_state())); |
| 1344 ASSERT(!state_field.IsNull()); | 1344 ASSERT(!state_field.IsNull()); |
| 1345 const Field& random_A_field = Field::ZoneHandle( | 1345 const Field& random_A_field = Field::ZoneHandle( |
| 1346 random_class.LookupStaticField(Symbols::_A())); | 1346 random_class.LookupStaticField(Symbols::_A())); |
| 1347 ASSERT(!random_A_field.IsNull()); | 1347 ASSERT(!random_A_field.IsNull()); |
| 1348 ASSERT(random_A_field.is_const()); | 1348 ASSERT(random_A_field.is_const()); |
| 1349 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1349 const Instance& a_value = Instance::Handle(random_A_field.value()); |
| 1350 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1350 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1651 | 1651 |
| 1652 __ Bind(&ok); | 1652 __ Bind(&ok); |
| 1653 __ Ret(); | 1653 __ Ret(); |
| 1654 | 1654 |
| 1655 __ Bind(&fall_through); | 1655 __ Bind(&fall_through); |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 } // namespace dart | 1658 } // namespace dart |
| 1659 | 1659 |
| 1660 #endif // defined TARGET_ARCH_ARM | 1660 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |