| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // TODO(srdjan): Fix for functions with finally clause. | 80 // TODO(srdjan): Fix for functions with finally clause. |
| 81 // A finally clause may leave a previously pushed return value if it | 81 // A finally clause may leave a previously pushed return value if it |
| 82 // has its own return instruction. Method that have finally are currently | 82 // has its own return instruction. Method that have finally are currently |
| 83 // not optimized. | 83 // not optimized. |
| 84 if (!compiler->HasFinally()) { | 84 if (!compiler->HasFinally()) { |
| 85 Label stack_ok; | 85 Label stack_ok; |
| 86 __ Comment("Stack Check"); | 86 __ Comment("Stack Check"); |
| 87 const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1); | 87 const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1); |
| 88 __ subu(T2, FP, SP); | 88 __ subu(T2, FP, SP); |
| 89 | 89 |
| 90 __ addiu(T2, T2, Immediate(-sp_fp_dist * kWordSize)); | 90 __ BranchEqual(T2, sp_fp_dist * kWordSize, &stack_ok); |
| 91 __ beq(T2, ZR, &stack_ok); | |
| 92 __ break_(0); | 91 __ break_(0); |
| 93 | 92 |
| 94 __ Bind(&stack_ok); | 93 __ Bind(&stack_ok); |
| 95 } | 94 } |
| 96 #endif | 95 #endif |
| 97 __ LeaveDartFrame(); | 96 __ LeaveDartFrame(); |
| 98 __ Ret(); | 97 __ Ret(); |
| 99 | 98 |
| 100 // Generate 2 NOP instructions so that the debugger can patch the return | 99 // 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). | 100 // pattern (1 instruction) with a call to the debug stub (3 instructions). |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 529 |
| 531 private: | 530 private: |
| 532 CheckStackOverflowInstr* instruction_; | 531 CheckStackOverflowInstr* instruction_; |
| 533 }; | 532 }; |
| 534 | 533 |
| 535 | 534 |
| 536 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 535 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 537 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 536 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); |
| 538 compiler->AddSlowPathCode(slow_path); | 537 compiler->AddSlowPathCode(slow_path); |
| 539 | 538 |
| 540 __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address()); | 539 __ LoadImmediate(TMP1, Isolate::Current()->stack_limit_address()); |
| 541 | 540 |
| 542 __ lw(TMP, Address(TMP)); | 541 __ lw(TMP1, Address(TMP1)); |
| 543 __ subu(TMP, SP, TMP); | 542 __ BranchLessEqual(SP, TMP1, slow_path->entry_label()); |
| 544 __ blez(TMP, slow_path->entry_label()); | |
| 545 | 543 |
| 546 __ Bind(slow_path->exit_label()); | 544 __ Bind(slow_path->exit_label()); |
| 547 } | 545 } |
| 548 | 546 |
| 549 | 547 |
| 550 LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const { | 548 LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const { |
| 551 UNIMPLEMENTED(); | 549 UNIMPLEMENTED(); |
| 552 return NULL; | 550 return NULL; |
| 553 } | 551 } |
| 554 | 552 |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 | 917 |
| 920 | 918 |
| 921 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 919 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 922 UNIMPLEMENTED(); | 920 UNIMPLEMENTED(); |
| 923 } | 921 } |
| 924 | 922 |
| 925 } // namespace dart | 923 } // namespace dart |
| 926 | 924 |
| 927 #endif // defined TARGET_ARCH_MIPS | 925 #endif // defined TARGET_ARCH_MIPS |
| 928 | 926 |
| OLD | NEW |