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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 __ AddImmediateDetectOverflow(T4, T4, Smi::RawValue(1), T5, T6); | 1805 __ AddImmediateDetectOverflow(T4, T4, Smi::RawValue(1), T5, T6); |
1806 | 1806 |
1807 __ bgez(T5, &call_target_function); // No overflow. | 1807 __ bgez(T5, &call_target_function); // No overflow. |
1808 __ delay_slot()->sw(T4, Address(T0, count_offset)); | 1808 __ delay_slot()->sw(T4, Address(T0, count_offset)); |
1809 | 1809 |
1810 __ LoadImmediate(T1, Smi::RawValue(Smi::kMaxValue)); | 1810 __ LoadImmediate(T1, Smi::RawValue(Smi::kMaxValue)); |
1811 __ sw(T1, Address(T0, count_offset)); | 1811 __ sw(T1, Address(T0, count_offset)); |
1812 | 1812 |
1813 __ Bind(&call_target_function); | 1813 __ Bind(&call_target_function); |
1814 // T3: Target function. | 1814 // T3: Target function. |
1815 __ lw(T3, FieldAddress(T3, Function::code_offset())); | 1815 Label is_compiled; |
1816 __ lw(T3, FieldAddress(T3, Code::instructions_offset())); | 1816 __ lw(T4, FieldAddress(T3, Function::code_offset())); |
| 1817 if (FLAG_collect_code) { |
| 1818 __ BranchNotEqual(T4, reinterpret_cast<int32_t>(Object::null()), |
| 1819 &is_compiled); |
| 1820 __ EnterStubFrame(); |
| 1821 __ addiu(SP, SP, Immediate(-3 * kWordSize)); |
| 1822 __ sw(S5, Address(SP, 2 * kWordSize)); // Preserve IC data. |
| 1823 __ sw(S4, Address(SP, 1 * kWordSize)); // Preserve arg desc. |
| 1824 __ sw(T3, Address(SP, 0 * kWordSize)); // Function argument. |
| 1825 __ CallRuntime(kCompileFunctionRuntimeEntry, 1); |
| 1826 __ lw(T3, Address(SP, 0 * kWordSize)); // Restore Function. |
| 1827 __ lw(S4, Address(SP, 1 * kWordSize)); // Restore arg desc. |
| 1828 __ lw(S5, Address(SP, 2 * kWordSize)); // Restore IC data. |
| 1829 __ addiu(SP, SP, Immediate(3 * kWordSize)); |
| 1830 __ LeaveStubFrame(); |
| 1831 __ lw(T4, FieldAddress(T3, Function::code_offset())); |
| 1832 __ Bind(&is_compiled); |
| 1833 } |
| 1834 __ lw(T3, FieldAddress(T4, Code::instructions_offset())); |
1817 __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag); | 1835 __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag); |
1818 __ jr(T3); | 1836 __ jr(T3); |
1819 | 1837 |
1820 // Instance in T3, return its class-id in T3 as Smi. | 1838 // Instance in T3, return its class-id in T3 as Smi. |
1821 __ Bind(&get_class_id_as_smi); | 1839 __ Bind(&get_class_id_as_smi); |
1822 Label not_smi; | 1840 Label not_smi; |
1823 // Test if Smi -> load Smi class for comparison. | 1841 // Test if Smi -> load Smi class for comparison. |
1824 __ andi(CMPRES1, T3, Immediate(kSmiTagMask)); | 1842 __ andi(CMPRES1, T3, Immediate(kSmiTagMask)); |
1825 __ bne(CMPRES1, ZR, ¬_smi); | 1843 __ bne(CMPRES1, ZR, ¬_smi); |
1826 __ jr(RA); | 1844 __ jr(RA); |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2396 __ lw(left, Address(SP, 1 * kWordSize)); | 2414 __ lw(left, Address(SP, 1 * kWordSize)); |
2397 __ lw(temp2, Address(SP, 2 * kWordSize)); | 2415 __ lw(temp2, Address(SP, 2 * kWordSize)); |
2398 __ lw(temp1, Address(SP, 3 * kWordSize)); | 2416 __ lw(temp1, Address(SP, 3 * kWordSize)); |
2399 __ Ret(); | 2417 __ Ret(); |
2400 __ delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize)); | 2418 __ delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize)); |
2401 } | 2419 } |
2402 | 2420 |
2403 } // namespace dart | 2421 } // namespace dart |
2404 | 2422 |
2405 #endif // defined TARGET_ARCH_MIPS | 2423 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |