| 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 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1627 const Class& random_class = Class::Handle( | 1627 const Class& random_class = Class::Handle( |
| 1628 math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1628 math_lib.LookupClassAllowPrivate(Symbols::_Random())); |
| 1629 ASSERT(!random_class.IsNull()); | 1629 ASSERT(!random_class.IsNull()); |
| 1630 const Field& state_field = Field::ZoneHandle( | 1630 const Field& state_field = Field::ZoneHandle( |
| 1631 random_class.LookupInstanceField(Symbols::_state())); | 1631 random_class.LookupInstanceField(Symbols::_state())); |
| 1632 ASSERT(!state_field.IsNull()); | 1632 ASSERT(!state_field.IsNull()); |
| 1633 const Field& random_A_field = Field::ZoneHandle( | 1633 const Field& random_A_field = Field::ZoneHandle( |
| 1634 random_class.LookupStaticField(Symbols::_A())); | 1634 random_class.LookupStaticField(Symbols::_A())); |
| 1635 ASSERT(!random_A_field.IsNull()); | 1635 ASSERT(!random_A_field.IsNull()); |
| 1636 ASSERT(random_A_field.is_const()); | 1636 ASSERT(random_A_field.is_const()); |
| 1637 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1637 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); |
| 1638 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1638 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
| 1639 // 'a_int_value' is a mask. | 1639 // 'a_int_value' is a mask. |
| 1640 ASSERT(Utils::IsUint(32, a_int_value)); | 1640 ASSERT(Utils::IsUint(32, a_int_value)); |
| 1641 int32_t a_int32_value = static_cast<int32_t>(a_int_value); | 1641 int32_t a_int32_value = static_cast<int32_t>(a_int_value); |
| 1642 | 1642 |
| 1643 __ lw(T0, Address(SP, 0 * kWordSize)); // Receiver. | 1643 // Receiver. |
| 1644 __ lw(T1, FieldAddress(T0, state_field.Offset())); // Field '_state'. | 1644 __ lw(T0, Address(SP, 0 * kWordSize)); |
| 1645 // Field '_state'. |
| 1646 __ lw(T1, FieldAddress(T0, state_field.Offset())); |
| 1645 | 1647 |
| 1646 // Addresses of _state[0] and _state[1]. | 1648 // Addresses of _state[0] and _state[1]. |
| 1647 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); | 1649 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); |
| 1648 const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid); | 1650 const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid); |
| 1649 const Address& addr_0 = FieldAddress(T1, 0 * scale + offset); | 1651 const Address& addr_0 = FieldAddress(T1, 0 * scale + offset); |
| 1650 const Address& addr_1 = FieldAddress(T1, 1 * scale + offset); | 1652 const Address& addr_1 = FieldAddress(T1, 1 * scale + offset); |
| 1651 | 1653 |
| 1652 __ LoadImmediate(T0, a_int32_value); | 1654 __ LoadImmediate(T0, a_int32_value); |
| 1653 __ lw(T2, addr_0); | 1655 __ lw(T2, addr_0); |
| 1654 __ lw(T3, addr_1); | 1656 __ lw(T3, addr_1); |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 | 2176 |
| 2175 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2177 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 2176 __ LoadIsolate(V0); | 2178 __ LoadIsolate(V0); |
| 2177 __ Ret(); | 2179 __ Ret(); |
| 2178 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2180 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 2179 } | 2181 } |
| 2180 | 2182 |
| 2181 } // namespace dart | 2183 } // namespace dart |
| 2182 | 2184 |
| 2183 #endif // defined TARGET_ARCH_MIPS | 2185 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |