OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2642 CheckStackOverflowInstr* instruction_; | 2642 CheckStackOverflowInstr* instruction_; |
2643 Label osr_entry_label_; | 2643 Label osr_entry_label_; |
2644 }; | 2644 }; |
2645 | 2645 |
2646 | 2646 |
2647 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2647 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2648 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 2648 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); |
2649 compiler->AddSlowPathCode(slow_path); | 2649 compiler->AddSlowPathCode(slow_path); |
2650 | 2650 |
2651 __ ldr(TMP, Address(THR, Thread::stack_limit_offset())); | 2651 __ ldr(TMP, Address(THR, Thread::stack_limit_offset())); |
2652 __ CompareRegisters(SP, TMP); | 2652 // Compare to CSP not SP because CSP is closer to the stack limit. See |
| 2653 // Assembler::EnterFrame. |
| 2654 __ CompareRegisters(CSP, TMP); |
2653 __ b(slow_path->entry_label(), LS); | 2655 __ b(slow_path->entry_label(), LS); |
2654 if (compiler->CanOSRFunction() && in_loop()) { | 2656 if (compiler->CanOSRFunction() && in_loop()) { |
2655 const Register temp = locs()->temp(0).reg(); | 2657 const Register temp = locs()->temp(0).reg(); |
2656 // In unoptimized code check the usage counter to trigger OSR at loop | 2658 // In unoptimized code check the usage counter to trigger OSR at loop |
2657 // stack checks. Use progressively higher thresholds for more deeply | 2659 // stack checks. Use progressively higher thresholds for more deeply |
2658 // nested loops to attempt to hit outer loops with OSR when possible. | 2660 // nested loops to attempt to hit outer loops with OSR when possible. |
2659 __ LoadObject(temp, compiler->parsed_function().function()); | 2661 __ LoadObject(temp, compiler->parsed_function().function()); |
2660 intptr_t threshold = | 2662 intptr_t threshold = |
2661 FLAG_optimization_counter_threshold * (loop_depth() + 1); | 2663 FLAG_optimization_counter_threshold * (loop_depth() + 1); |
2662 __ LoadFieldFromOffset( | 2664 __ LoadFieldFromOffset( |
(...skipping 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5715 1, | 5717 1, |
5716 locs()); | 5718 locs()); |
5717 __ Drop(1); | 5719 __ Drop(1); |
5718 __ Pop(result); | 5720 __ Pop(result); |
5719 } | 5721 } |
5720 | 5722 |
5721 | 5723 |
5722 } // namespace dart | 5724 } // namespace dart |
5723 | 5725 |
5724 #endif // defined TARGET_ARCH_ARM64 | 5726 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |