| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2563 | 2563 |
| 2564 private: | 2564 private: |
| 2565 CheckStackOverflowInstr* instruction_; | 2565 CheckStackOverflowInstr* instruction_; |
| 2566 }; | 2566 }; |
| 2567 | 2567 |
| 2568 | 2568 |
| 2569 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2569 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2570 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 2570 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); |
| 2571 compiler->AddSlowPathCode(slow_path); | 2571 compiler->AddSlowPathCode(slow_path); |
| 2572 | 2572 |
| 2573 if (compiler->ShouldDeoptimizeFunction()) { |
| 2574 __ jmp(slow_path->entry_label()); |
| 2575 } |
| 2573 __ cmpl(ESP, | 2576 __ cmpl(ESP, |
| 2574 Address::Absolute(Isolate::Current()->stack_limit_address())); | 2577 Address::Absolute(Isolate::Current()->stack_limit_address())); |
| 2575 __ j(BELOW_EQUAL, slow_path->entry_label()); | 2578 __ j(BELOW_EQUAL, slow_path->entry_label()); |
| 2576 if (compiler->CanOSRFunction() && in_loop()) { | 2579 if (compiler->CanOSRFunction() && in_loop()) { |
| 2577 // In unoptimized code check the usage counter to trigger OSR at loop | 2580 // In unoptimized code check the usage counter to trigger OSR at loop |
| 2578 // stack checks. Use progressively higher thresholds for more deeply | 2581 // stack checks. Use progressively higher thresholds for more deeply |
| 2579 // nested loops to attempt to hit outer loops with OSR when possible. | 2582 // nested loops to attempt to hit outer loops with OSR when possible. |
| 2580 __ LoadObject(EDI, compiler->parsed_function().function()); | 2583 __ LoadObject(EDI, compiler->parsed_function().function()); |
| 2581 intptr_t threshold = | 2584 intptr_t threshold = |
| 2582 FLAG_optimization_counter_threshold * (loop_depth() + 1); | 2585 FLAG_optimization_counter_threshold * (loop_depth() + 1); |
| (...skipping 3256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5839 PcDescriptors::kOther, | 5842 PcDescriptors::kOther, |
| 5840 locs()); | 5843 locs()); |
| 5841 __ Drop(ArgumentCount()); // Discard arguments. | 5844 __ Drop(ArgumentCount()); // Discard arguments. |
| 5842 } | 5845 } |
| 5843 | 5846 |
| 5844 } // namespace dart | 5847 } // namespace dart |
| 5845 | 5848 |
| 5846 #undef __ | 5849 #undef __ |
| 5847 | 5850 |
| 5848 #endif // defined TARGET_ARCH_IA32 | 5851 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |