| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 | 173 |
| 174 bool Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { | 174 bool Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { |
| 175 return Array_getIndexed(assembler); | 175 return Array_getIndexed(assembler); |
| 176 } | 176 } |
| 177 | 177 |
| 178 | 178 |
| 179 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { | 179 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { |
| 180 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 180 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| 181 const Class& cls = | 181 const Class& cls = Class::Handle( |
| 182 Class::Handle(core_lib.LookupClassAllowPrivate(Symbols::ObjectArray())); | 182 core_lib.LookupClassAllowPrivate(Symbols::ObjectArray(), NULL)); |
| 183 ASSERT(!cls.IsNull()); | 183 ASSERT(!cls.IsNull()); |
| 184 ASSERT(cls.HasTypeArguments()); | 184 ASSERT(cls.HasTypeArguments()); |
| 185 ASSERT(cls.NumTypeArguments() == 1); | 185 ASSERT(cls.NumTypeArguments() == 1); |
| 186 const intptr_t field_offset = cls.type_arguments_field_offset(); | 186 const intptr_t field_offset = cls.type_arguments_field_offset(); |
| 187 ASSERT(field_offset != Class::kNoTypeArguments); | 187 ASSERT(field_offset != Class::kNoTypeArguments); |
| 188 return field_offset; | 188 return field_offset; |
| 189 } | 189 } |
| 190 | 190 |
| 191 | 191 |
| 192 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 192 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
| (...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 return false; | 1422 return false; |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 | 1425 |
| 1426 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; | 1426 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; |
| 1427 // _state[kSTATE_LO] = state & _MASK_32; | 1427 // _state[kSTATE_LO] = state & _MASK_32; |
| 1428 // _state[kSTATE_HI] = state >> 32; | 1428 // _state[kSTATE_HI] = state >> 32; |
| 1429 bool Intrinsifier::Random_nextState(Assembler* assembler) { | 1429 bool Intrinsifier::Random_nextState(Assembler* assembler) { |
| 1430 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 1430 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
| 1431 ASSERT(!math_lib.IsNull()); | 1431 ASSERT(!math_lib.IsNull()); |
| 1432 const Class& random_class = | 1432 const Class& random_class = Class::Handle( |
| 1433 Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1433 math_lib.LookupClassAllowPrivate(Symbols::_Random(), NULL)); |
| 1434 ASSERT(!random_class.IsNull()); | 1434 ASSERT(!random_class.IsNull()); |
| 1435 const Field& state_field = Field::ZoneHandle( | 1435 const Field& state_field = Field::ZoneHandle( |
| 1436 random_class.LookupInstanceField(Symbols::_state())); | 1436 random_class.LookupInstanceField(Symbols::_state())); |
| 1437 ASSERT(!state_field.IsNull()); | 1437 ASSERT(!state_field.IsNull()); |
| 1438 const Field& random_A_field = Field::ZoneHandle( | 1438 const Field& random_A_field = Field::ZoneHandle( |
| 1439 random_class.LookupStaticField(Symbols::_A())); | 1439 random_class.LookupStaticField(Symbols::_A())); |
| 1440 ASSERT(!random_A_field.IsNull()); | 1440 ASSERT(!random_A_field.IsNull()); |
| 1441 ASSERT(random_A_field.is_const()); | 1441 ASSERT(random_A_field.is_const()); |
| 1442 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1442 const Instance& a_value = Instance::Handle(random_A_field.value()); |
| 1443 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1443 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 __ Bind(&ok); | 1775 __ Bind(&ok); |
| 1776 __ Ret(); | 1776 __ Ret(); |
| 1777 | 1777 |
| 1778 __ Bind(&fall_through); | 1778 __ Bind(&fall_through); |
| 1779 return false; | 1779 return false; |
| 1780 } | 1780 } |
| 1781 | 1781 |
| 1782 } // namespace dart | 1782 } // namespace dart |
| 1783 | 1783 |
| 1784 #endif // defined TARGET_ARCH_MIPS | 1784 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |