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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 | 164 |
165 | 165 |
166 bool Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { | 166 bool Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { |
167 return Array_getIndexed(assembler); | 167 return Array_getIndexed(assembler); |
168 } | 168 } |
169 | 169 |
170 | 170 |
171 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { | 171 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { |
172 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 172 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
173 const Class& cls = | 173 const Class& cls = Class::Handle( |
174 Class::Handle(core_lib.LookupClassAllowPrivate(Symbols::ObjectArray())); | 174 core_lib.LookupClassAllowPrivate(Symbols::ObjectArray(), NULL)); |
175 ASSERT(!cls.IsNull()); | 175 ASSERT(!cls.IsNull()); |
176 ASSERT(cls.HasTypeArguments()); | 176 ASSERT(cls.HasTypeArguments()); |
177 ASSERT(cls.NumTypeArguments() == 1); | 177 ASSERT(cls.NumTypeArguments() == 1); |
178 const intptr_t field_offset = cls.type_arguments_field_offset(); | 178 const intptr_t field_offset = cls.type_arguments_field_offset(); |
179 ASSERT(field_offset != Class::kNoTypeArguments); | 179 ASSERT(field_offset != Class::kNoTypeArguments); |
180 return field_offset; | 180 return field_offset; |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 184 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 return false; | 1361 return false; |
1362 } | 1362 } |
1363 | 1363 |
1364 | 1364 |
1365 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; | 1365 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; |
1366 // _state[kSTATE_LO] = state & _MASK_32; | 1366 // _state[kSTATE_LO] = state & _MASK_32; |
1367 // _state[kSTATE_HI] = state >> 32; | 1367 // _state[kSTATE_HI] = state >> 32; |
1368 bool Intrinsifier::Random_nextState(Assembler* assembler) { | 1368 bool Intrinsifier::Random_nextState(Assembler* assembler) { |
1369 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 1369 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
1370 ASSERT(!math_lib.IsNull()); | 1370 ASSERT(!math_lib.IsNull()); |
1371 const Class& random_class = | 1371 const Class& random_class = Class::Handle( |
1372 Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1372 math_lib.LookupClassAllowPrivate(Symbols::_Random(), NULL)); |
1373 ASSERT(!random_class.IsNull()); | 1373 ASSERT(!random_class.IsNull()); |
1374 const Field& state_field = Field::ZoneHandle( | 1374 const Field& state_field = Field::ZoneHandle( |
1375 random_class.LookupInstanceField(Symbols::_state())); | 1375 random_class.LookupInstanceField(Symbols::_state())); |
1376 ASSERT(!state_field.IsNull()); | 1376 ASSERT(!state_field.IsNull()); |
1377 const Field& random_A_field = Field::ZoneHandle( | 1377 const Field& random_A_field = Field::ZoneHandle( |
1378 random_class.LookupStaticField(Symbols::_A())); | 1378 random_class.LookupStaticField(Symbols::_A())); |
1379 ASSERT(!random_A_field.IsNull()); | 1379 ASSERT(!random_A_field.IsNull()); |
1380 ASSERT(random_A_field.is_const()); | 1380 ASSERT(random_A_field.is_const()); |
1381 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1381 const Instance& a_value = Instance::Handle(random_A_field.value()); |
1382 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1382 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 __ Bind(&ok); | 1693 __ Bind(&ok); |
1694 __ Ret(); | 1694 __ Ret(); |
1695 | 1695 |
1696 __ Bind(&fall_through); | 1696 __ Bind(&fall_through); |
1697 return false; | 1697 return false; |
1698 } | 1698 } |
1699 | 1699 |
1700 } // namespace dart | 1700 } // namespace dart |
1701 | 1701 |
1702 #endif // defined TARGET_ARCH_ARM | 1702 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |