| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 Register result = locs()->in(0).reg(); | 78 Register result = locs()->in(0).reg(); |
| 79 ASSERT(result == V0); | 79 ASSERT(result == V0); |
| 80 #if defined(DEBUG) | 80 #if defined(DEBUG) |
| 81 // TODO(srdjan): Fix for functions with finally clause. | 81 // TODO(srdjan): Fix for functions with finally clause. |
| 82 // A finally clause may leave a previously pushed return value if it | 82 // A finally clause may leave a previously pushed return value if it |
| 83 // has its own return instruction. Method that have finally are currently | 83 // has its own return instruction. Method that have finally are currently |
| 84 // not optimized. | 84 // not optimized. |
| 85 if (!compiler->HasFinally()) { | 85 if (!compiler->HasFinally()) { |
| 86 Label stack_ok; | 86 Label stack_ok; |
| 87 __ Comment("Stack Check"); | 87 __ Comment("Stack Check"); |
| 88 const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1); | 88 const intptr_t fp_sp_dist = |
| 89 __ subu(T2, FP, SP); | 89 (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize; |
| 90 ASSERT(fp_sp_dist <= 0); |
| 91 __ subu(T2, SP, FP); |
| 90 | 92 |
| 91 __ BranchEqual(T2, sp_fp_dist * kWordSize, &stack_ok); | 93 __ BranchEqual(T2, fp_sp_dist, &stack_ok); |
| 92 __ break_(0); | 94 __ break_(0); |
| 93 | 95 |
| 94 __ Bind(&stack_ok); | 96 __ Bind(&stack_ok); |
| 95 } | 97 } |
| 96 #endif | 98 #endif |
| 97 __ LeaveDartFrame(); | 99 __ LeaveDartFrame(); |
| 98 __ Ret(); | 100 __ Ret(); |
| 99 | 101 |
| 100 // Generate 2 NOP instructions so that the debugger can patch the return | 102 // Generate 2 NOP instructions so that the debugger can patch the return |
| 101 // pattern (1 instruction) with a call to the debug stub (3 instructions). | 103 // pattern (1 instruction) with a call to the debug stub (3 instructions). |
| (...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 | 1848 |
| 1847 | 1849 |
| 1848 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1850 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1849 UNIMPLEMENTED(); | 1851 UNIMPLEMENTED(); |
| 1850 } | 1852 } |
| 1851 | 1853 |
| 1852 } // namespace dart | 1854 } // namespace dart |
| 1853 | 1855 |
| 1854 #endif // defined TARGET_ARCH_MIPS | 1856 #endif // defined TARGET_ARCH_MIPS |
| 1855 | 1857 |
| OLD | NEW |