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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 | 170 |
171 void Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { | 171 void Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { |
172 return Array_getIndexed(assembler); | 172 return Array_getIndexed(assembler); |
173 } | 173 } |
174 | 174 |
175 | 175 |
176 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { | 176 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { |
177 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 177 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
178 const Class& cls = Class::Handle( | 178 const Class& cls = Class::Handle( |
179 core_lib.LookupClassAllowPrivate(Symbols::ObjectArray(), NULL)); | 179 core_lib.LookupClassAllowPrivate(Symbols::ObjectArray())); |
180 ASSERT(!cls.IsNull()); | 180 ASSERT(!cls.IsNull()); |
181 ASSERT(cls.HasTypeArguments()); | 181 ASSERT(cls.HasTypeArguments()); |
182 ASSERT(cls.NumTypeArguments() == 1); | 182 ASSERT(cls.NumTypeArguments() == 1); |
183 const intptr_t field_offset = cls.type_arguments_field_offset(); | 183 const intptr_t field_offset = cls.type_arguments_field_offset(); |
184 ASSERT(field_offset != Class::kNoTypeArguments); | 184 ASSERT(field_offset != Class::kNoTypeArguments); |
185 return field_offset; | 185 return field_offset; |
186 } | 186 } |
187 | 187 |
188 | 188 |
189 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 189 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 } | 1392 } |
1393 | 1393 |
1394 | 1394 |
1395 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; | 1395 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; |
1396 // _state[kSTATE_LO] = state & _MASK_32; | 1396 // _state[kSTATE_LO] = state & _MASK_32; |
1397 // _state[kSTATE_HI] = state >> 32; | 1397 // _state[kSTATE_HI] = state >> 32; |
1398 void Intrinsifier::Random_nextState(Assembler* assembler) { | 1398 void Intrinsifier::Random_nextState(Assembler* assembler) { |
1399 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 1399 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
1400 ASSERT(!math_lib.IsNull()); | 1400 ASSERT(!math_lib.IsNull()); |
1401 const Class& random_class = Class::Handle( | 1401 const Class& random_class = Class::Handle( |
1402 math_lib.LookupClassAllowPrivate(Symbols::_Random(), NULL)); | 1402 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
1403 ASSERT(!random_class.IsNull()); | 1403 ASSERT(!random_class.IsNull()); |
1404 const Field& state_field = Field::ZoneHandle( | 1404 const Field& state_field = Field::ZoneHandle( |
1405 random_class.LookupInstanceField(Symbols::_state())); | 1405 random_class.LookupInstanceField(Symbols::_state())); |
1406 ASSERT(!state_field.IsNull()); | 1406 ASSERT(!state_field.IsNull()); |
1407 const Field& random_A_field = Field::ZoneHandle( | 1407 const Field& random_A_field = Field::ZoneHandle( |
1408 random_class.LookupStaticField(Symbols::_A())); | 1408 random_class.LookupStaticField(Symbols::_A())); |
1409 ASSERT(!random_A_field.IsNull()); | 1409 ASSERT(!random_A_field.IsNull()); |
1410 ASSERT(random_A_field.is_const()); | 1410 ASSERT(random_A_field.is_const()); |
1411 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1411 const Instance& a_value = Instance::Handle(random_A_field.value()); |
1412 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1412 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 | 1734 |
1735 __ Bind(&ok); | 1735 __ Bind(&ok); |
1736 __ Ret(); | 1736 __ Ret(); |
1737 | 1737 |
1738 __ Bind(&fall_through); | 1738 __ Bind(&fall_through); |
1739 } | 1739 } |
1740 | 1740 |
1741 } // namespace dart | 1741 } // namespace dart |
1742 | 1742 |
1743 #endif // defined TARGET_ARCH_MIPS | 1743 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |