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 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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). | 1781 // On stack: user tag (+0). |
1782 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { | 1782 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
1783 // T1: Isolate. | 1783 // T1: Isolate. |
1784 Isolate* isolate = Isolate::Current(); | 1784 Isolate* isolate = Isolate::Current(); |
1785 __ LoadImmediate(T1, reinterpret_cast<uword>(isolate)); | 1785 __ LoadImmediate(T1, reinterpret_cast<uword>(isolate)); |
1786 // V0: UserTag. | 1786 // V0: Current user tag. |
1787 __ lw(V0, Address(SP, + 0 * kWordSize)); | 1787 __ lw(V0, Address(T1, Isolate::current_tag_offset())); |
| 1788 // T2: UserTag. |
| 1789 __ lw(T2, Address(SP, + 0 * kWordSize)); |
1788 // Set Isolate::current_tag_. | 1790 // Set Isolate::current_tag_. |
1789 __ sw(V0, Address(T1, Isolate::current_tag_offset())); | 1791 __ sw(T2, Address(T1, Isolate::current_tag_offset())); |
1790 // V0: UserTag's tag. | 1792 // T2: UserTag's tag. |
1791 __ lw(V0, FieldAddress(V0, UserTag::tag_offset())); | 1793 __ lw(T2, FieldAddress(T2, UserTag::tag_offset())); |
1792 // Set Isolate::user_tag_. | 1794 // Set Isolate::user_tag_. |
1793 __ sw(V0, Address(T1, Isolate::user_tag_offset())); | 1795 __ sw(T2, Address(T1, Isolate::user_tag_offset())); |
1794 // Set return value. | |
1795 __ Ret(); | 1796 __ Ret(); |
1796 __ delay_slot()->LoadImmediate(V0, reinterpret_cast<int32_t>(Object::null())); | 1797 __ delay_slot()->sw(T2, Address(T1, Isolate::user_tag_offset())); |
| 1798 } |
| 1799 |
| 1800 |
| 1801 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) { |
| 1802 Isolate* isolate = Isolate::Current(); |
| 1803 // V0: Address of default tag. |
| 1804 __ LoadImmediate(V0, |
| 1805 reinterpret_cast<uword>(isolate->object_store()) + |
| 1806 ObjectStore::default_tag_offset()); |
| 1807 __ Ret(); |
| 1808 __ delay_slot()->lw(V0, Address(V0, 0)); |
1797 } | 1809 } |
1798 | 1810 |
1799 | 1811 |
1800 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 1812 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
1801 // V0: Isolate. | 1813 // V0: Isolate. |
1802 Isolate* isolate = Isolate::Current(); | 1814 Isolate* isolate = Isolate::Current(); |
1803 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); | 1815 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
1804 // Set return value. | 1816 // Set return value. |
1805 __ Ret(); | 1817 __ Ret(); |
1806 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 1818 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
1807 } | 1819 } |
1808 | 1820 |
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 | |
1825 } // namespace dart | 1821 } // namespace dart |
1826 | 1822 |
1827 #endif // defined TARGET_ARCH_MIPS | 1823 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |