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 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 | 1771 |
1772 void Intrinsifier::OneByteString_equality(Assembler* assembler) { | 1772 void Intrinsifier::OneByteString_equality(Assembler* assembler) { |
1773 StringEquality(assembler, kOneByteStringCid); | 1773 StringEquality(assembler, kOneByteStringCid); |
1774 } | 1774 } |
1775 | 1775 |
1776 | 1776 |
1777 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1777 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
1778 StringEquality(assembler, kTwoByteStringCid); | 1778 StringEquality(assembler, kTwoByteStringCid); |
1779 } | 1779 } |
1780 | 1780 |
| 1781 // On stack: user tag (+0). |
| 1782 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| 1783 // T1: Isolate. |
| 1784 Isolate* isolate = Isolate::Current(); |
| 1785 __ LoadImmediate(T1, reinterpret_cast<uword>(isolate)); |
| 1786 // V0: UserTag. |
| 1787 __ lw(V0, Address(SP, + 0 * kWordSize)); |
| 1788 // Set Isolate::current_tag_. |
| 1789 __ sw(V0, Address(T1, Isolate::current_tag_offset())); |
| 1790 // V0: UserTag's tag. |
| 1791 __ lw(V0, FieldAddress(V0, UserTag::tag_offset())); |
| 1792 // Set Isolate::user_tag_. |
| 1793 __ sw(V0, Address(T1, Isolate::user_tag_offset())); |
| 1794 // Set return value. |
| 1795 __ Ret(); |
| 1796 __ delay_slot()->LoadImmediate(V0, reinterpret_cast<int32_t>(Object::null())); |
| 1797 } |
| 1798 |
| 1799 |
| 1800 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 1801 // V0: Isolate. |
| 1802 Isolate* isolate = Isolate::Current(); |
| 1803 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
| 1804 // Set return value. |
| 1805 __ Ret(); |
| 1806 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 1807 } |
| 1808 |
| 1809 |
| 1810 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) { |
| 1811 // T1: Isolate. |
| 1812 Isolate* isolate = Isolate::Current(); |
| 1813 __ LoadImmediate(T1, reinterpret_cast<uword>(isolate)); |
| 1814 // Set return value to Isolate::current_tag_. |
| 1815 __ lw(V0, Address(T1, Isolate::current_tag_offset())); |
| 1816 // Clear Isolate::current_tag_. |
| 1817 const int32_t raw_null = reinterpret_cast<int32_t>(UserTag::null()); |
| 1818 __ LoadImmediate(T0, raw_null); |
| 1819 __ sw(T0, Address(T1, Isolate::current_tag_offset())); |
| 1820 // Clear Isolate::user_tag_. |
| 1821 __ Ret(); |
| 1822 __ delay_slot()->sw(ZR, Address(T1, Isolate::user_tag_offset())); |
| 1823 } |
| 1824 |
1781 } // namespace dart | 1825 } // namespace dart |
1782 | 1826 |
1783 #endif // defined TARGET_ARCH_MIPS | 1827 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |