Chromium Code Reviews| 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 // T2: Current user tag. | |
| 1787 __ lw(T2, Address(T1, Isolate::current_tag_offset())); | |
|
zra
2014/05/06 15:27:24
Same here.
Cutch
2014/05/06 17:00:25
Done.
| |
| 1786 // V0: UserTag. | 1788 // V0: UserTag. |
| 1787 __ lw(V0, Address(SP, + 0 * kWordSize)); | 1789 __ lw(V0, 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(V0, Address(T1, Isolate::current_tag_offset())); |
| 1790 // V0: UserTag's tag. | 1792 // V0: UserTag's tag. |
| 1791 __ lw(V0, FieldAddress(V0, UserTag::tag_offset())); | 1793 __ lw(V0, FieldAddress(V0, UserTag::tag_offset())); |
| 1792 // Set Isolate::user_tag_. | 1794 // Set Isolate::user_tag_. |
| 1793 __ sw(V0, Address(T1, Isolate::user_tag_offset())); | 1795 __ sw(V0, Address(T1, Isolate::user_tag_offset())); |
| 1794 // Set return value. | 1796 // Set return value. |
| 1795 __ Ret(); | 1797 __ Ret(); |
| 1796 __ delay_slot()->LoadImmediate(V0, reinterpret_cast<int32_t>(Object::null())); | 1798 __ delay_slot()->mov(V0, T2); |
|
Ivan Posva
2014/05/06 16:43:06
Zach, can you please make sure this is not allowed
| |
| 1799 } | |
| 1800 | |
| 1801 | |
| 1802 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) { | |
| 1803 Isolate* isolate = Isolate::Current(); | |
| 1804 // V0: Address of default tag. | |
| 1805 __ LoadImmediate(V0, | |
| 1806 reinterpret_cast<uword>(isolate->object_store()) + | |
| 1807 ObjectStore::default_tag_offset()); | |
| 1808 __ Ret(); | |
| 1809 __ delay_slot()->lw(V0, Address(V0, 0)); | |
| 1797 } | 1810 } |
| 1798 | 1811 |
| 1799 | 1812 |
| 1800 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 1813 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 1801 // V0: Isolate. | 1814 // V0: Isolate. |
| 1802 Isolate* isolate = Isolate::Current(); | 1815 Isolate* isolate = Isolate::Current(); |
| 1803 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); | 1816 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
| 1804 // Set return value. | 1817 // Set return value. |
| 1805 __ Ret(); | 1818 __ Ret(); |
| 1806 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 1819 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 1807 } | 1820 } |
| 1808 | 1821 |
| 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 | 1822 } // namespace dart |
| 1826 | 1823 |
| 1827 #endif // defined TARGET_ARCH_MIPS | 1824 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |