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 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 __ lw(T1, Address(SP, 1 * kWordSize)); | 1668 __ lw(T1, Address(SP, 1 * kWordSize)); |
1669 __ beq(T0, T1, &is_true); | 1669 __ beq(T0, T1, &is_true); |
1670 __ LoadObject(V0, Bool::False()); | 1670 __ LoadObject(V0, Bool::False()); |
1671 __ Ret(); | 1671 __ Ret(); |
1672 __ Bind(&is_true); | 1672 __ Bind(&is_true); |
1673 __ LoadObject(V0, Bool::True()); | 1673 __ LoadObject(V0, Bool::True()); |
1674 __ Ret(); | 1674 __ Ret(); |
1675 } | 1675 } |
1676 | 1676 |
1677 | 1677 |
| 1678 // Return type quickly for simple types (not parameterized and not signature). |
| 1679 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { |
| 1680 Label fall_through; |
| 1681 __ lw(T0, Address(SP, 0 * kWordSize)); |
| 1682 __ LoadClassIdMayBeSmi(T1, T0); |
| 1683 __ LoadClassById(T2, T1); |
| 1684 // T2: class of instance (T0). |
| 1685 |
| 1686 __ lw(T1, FieldAddress(T2, Class::signature_function_offset())); |
| 1687 __ BranchNotEqual(T1, Object::null_object(), &fall_through); |
| 1688 |
| 1689 __ lhu(T1, FieldAddress(T2, Class::num_type_arguments_offset())); |
| 1690 __ BranchNotEqual(T1, Immediate(0), &fall_through); |
| 1691 |
| 1692 __ lw(V0, FieldAddress(T2, Class::canonical_types_offset())); |
| 1693 __ BranchEqual(V0, Object::null_object(), &fall_through); |
| 1694 __ Ret(); |
| 1695 |
| 1696 __ Bind(&fall_through); |
| 1697 } |
| 1698 |
| 1699 |
1678 void Intrinsifier::String_getHashCode(Assembler* assembler) { | 1700 void Intrinsifier::String_getHashCode(Assembler* assembler) { |
1679 Label fall_through; | 1701 Label fall_through; |
1680 __ lw(T0, Address(SP, 0 * kWordSize)); | 1702 __ lw(T0, Address(SP, 0 * kWordSize)); |
1681 __ lw(V0, FieldAddress(T0, String::hash_offset())); | 1703 __ lw(V0, FieldAddress(T0, String::hash_offset())); |
1682 __ beq(V0, ZR, &fall_through); | 1704 __ beq(V0, ZR, &fall_through); |
1683 __ Ret(); | 1705 __ Ret(); |
1684 __ Bind(&fall_through); // Hash not yet computed. | 1706 __ Bind(&fall_through); // Hash not yet computed. |
1685 } | 1707 } |
1686 | 1708 |
1687 | 1709 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 Isolate* isolate = Isolate::Current(); | 2164 Isolate* isolate = Isolate::Current(); |
2143 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); | 2165 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
2144 // Set return value. | 2166 // Set return value. |
2145 __ Ret(); | 2167 __ Ret(); |
2146 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2168 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
2147 } | 2169 } |
2148 | 2170 |
2149 } // namespace dart | 2171 } // namespace dart |
2150 | 2172 |
2151 #endif // defined TARGET_ARCH_MIPS | 2173 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |