| 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 "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2745 CheckStackOverflowInstr* instruction_; | 2745 CheckStackOverflowInstr* instruction_; |
| 2746 Label osr_entry_label_; | 2746 Label osr_entry_label_; |
| 2747 }; | 2747 }; |
| 2748 | 2748 |
| 2749 | 2749 |
| 2750 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2750 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2751 __ Comment("CheckStackOverflowInstr"); | 2751 __ Comment("CheckStackOverflowInstr"); |
| 2752 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 2752 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); |
| 2753 compiler->AddSlowPathCode(slow_path); | 2753 compiler->AddSlowPathCode(slow_path); |
| 2754 | 2754 |
| 2755 __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address()); | 2755 if (compiler->is_optimizing()) { |
| 2756 __ lw(CMPRES1, Address(TMP)); | 2756 __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address()); |
| 2757 __ lw(CMPRES1, Address(TMP)); |
| 2758 } else { |
| 2759 __ LoadIsolate(TMP); |
| 2760 __ lw(CMPRES1, Address(TMP, Isolate::stack_limit_offset())); |
| 2761 } |
| 2757 __ BranchUnsignedLessEqual(SP, CMPRES1, slow_path->entry_label()); | 2762 __ BranchUnsignedLessEqual(SP, CMPRES1, slow_path->entry_label()); |
| 2758 if (compiler->CanOSRFunction() && in_loop()) { | 2763 if (compiler->CanOSRFunction() && in_loop()) { |
| 2759 Register temp = locs()->temp(0).reg(); | 2764 Register temp = locs()->temp(0).reg(); |
| 2760 // In unoptimized code check the usage counter to trigger OSR at loop | 2765 // In unoptimized code check the usage counter to trigger OSR at loop |
| 2761 // stack checks. Use progressively higher thresholds for more deeply | 2766 // stack checks. Use progressively higher thresholds for more deeply |
| 2762 // nested loops to attempt to hit outer loops with OSR when possible. | 2767 // nested loops to attempt to hit outer loops with OSR when possible. |
| 2763 __ LoadObject(temp, compiler->parsed_function().function()); | 2768 __ LoadObject(temp, compiler->parsed_function().function()); |
| 2764 intptr_t threshold = | 2769 intptr_t threshold = |
| 2765 FLAG_optimization_counter_threshold * (loop_depth() + 1); | 2770 FLAG_optimization_counter_threshold * (loop_depth() + 1); |
| 2766 __ lw(temp, FieldAddress(temp, Function::usage_counter_offset())); | 2771 __ lw(temp, FieldAddress(temp, Function::usage_counter_offset())); |
| (...skipping 2824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5591 1, | 5596 1, |
| 5592 locs()); | 5597 locs()); |
| 5593 __ lw(result, Address(SP, 1 * kWordSize)); | 5598 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5594 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5599 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5595 } | 5600 } |
| 5596 | 5601 |
| 5597 | 5602 |
| 5598 } // namespace dart | 5603 } // namespace dart |
| 5599 | 5604 |
| 5600 #endif // defined TARGET_ARCH_MIPS | 5605 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |