| 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/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 private: | 2639 private: |
| 2640 CheckStackOverflowInstr* instruction_; | 2640 CheckStackOverflowInstr* instruction_; |
| 2641 Label osr_entry_label_; | 2641 Label osr_entry_label_; |
| 2642 }; | 2642 }; |
| 2643 | 2643 |
| 2644 | 2644 |
| 2645 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2645 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2646 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 2646 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); |
| 2647 compiler->AddSlowPathCode(slow_path); | 2647 compiler->AddSlowPathCode(slow_path); |
| 2648 | 2648 |
| 2649 __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address(), PP); | 2649 if (compiler->is_optimizing()) { |
| 2650 __ ldr(TMP, Address(TMP)); | 2650 __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address(), PP); |
| 2651 __ ldr(TMP, Address(TMP)); |
| 2652 } else { |
| 2653 __ LoadIsolate(TMP); |
| 2654 __ ldr(TMP, Address(TMP, Isolate::stack_limit_offset())); |
| 2655 } |
| 2651 __ CompareRegisters(SP, TMP); | 2656 __ CompareRegisters(SP, TMP); |
| 2652 __ b(slow_path->entry_label(), LS); | 2657 __ b(slow_path->entry_label(), LS); |
| 2653 if (compiler->CanOSRFunction() && in_loop()) { | 2658 if (compiler->CanOSRFunction() && in_loop()) { |
| 2654 const Register temp = locs()->temp(0).reg(); | 2659 const Register temp = locs()->temp(0).reg(); |
| 2655 // In unoptimized code check the usage counter to trigger OSR at loop | 2660 // In unoptimized code check the usage counter to trigger OSR at loop |
| 2656 // stack checks. Use progressively higher thresholds for more deeply | 2661 // stack checks. Use progressively higher thresholds for more deeply |
| 2657 // nested loops to attempt to hit outer loops with OSR when possible. | 2662 // nested loops to attempt to hit outer loops with OSR when possible. |
| 2658 __ LoadObject(temp, compiler->parsed_function().function(), PP); | 2663 __ LoadObject(temp, compiler->parsed_function().function(), PP); |
| 2659 intptr_t threshold = | 2664 intptr_t threshold = |
| 2660 FLAG_optimization_counter_threshold * (loop_depth() + 1); | 2665 FLAG_optimization_counter_threshold * (loop_depth() + 1); |
| (...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5626 1, | 5631 1, |
| 5627 locs()); | 5632 locs()); |
| 5628 __ Drop(1); | 5633 __ Drop(1); |
| 5629 __ Pop(result); | 5634 __ Pop(result); |
| 5630 } | 5635 } |
| 5631 | 5636 |
| 5632 | 5637 |
| 5633 } // namespace dart | 5638 } // namespace dart |
| 5634 | 5639 |
| 5635 #endif // defined TARGET_ARCH_ARM64 | 5640 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |