| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2125 | 2125 |
| 2126 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2126 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2127 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); | 2127 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); |
| 2128 compiler->AddSlowPathCode(slow_path); | 2128 compiler->AddSlowPathCode(slow_path); |
| 2129 | 2129 |
| 2130 Register temp = locs()->temp(0).reg(); | 2130 Register temp = locs()->temp(0).reg(); |
| 2131 // Generate stack overflow check. | 2131 // Generate stack overflow check. |
| 2132 __ movq(temp, Immediate(Isolate::Current()->stack_limit_address())); | 2132 __ movq(temp, Immediate(Isolate::Current()->stack_limit_address())); |
| 2133 __ cmpq(RSP, Address(temp, 0)); | 2133 __ cmpq(RSP, Address(temp, 0)); |
| 2134 __ j(BELOW_EQUAL, slow_path->entry_label()); | 2134 __ j(BELOW_EQUAL, slow_path->entry_label()); |
| 2135 if (FLAG_use_osr && !compiler->is_optimizing() && in_loop()) { | 2135 if (FLAG_use_osr && compiler->CanOptimizeFunction() && |
| 2136 !compiler->is_optimizing() && in_loop()) { |
| 2136 // In unoptimized code check the usage counter to trigger OSR at loop | 2137 // In unoptimized code check the usage counter to trigger OSR at loop |
| 2137 // stack checks. | 2138 // stack checks. |
| 2138 __ LoadObject(temp, compiler->parsed_function().function()); | 2139 __ LoadObject(temp, compiler->parsed_function().function()); |
| 2139 __ cmpq(FieldAddress(temp, Function::usage_counter_offset()), | 2140 __ cmpq(FieldAddress(temp, Function::usage_counter_offset()), |
| 2140 Immediate(2 * FLAG_optimization_counter_threshold)); | 2141 Immediate(2 * FLAG_optimization_counter_threshold)); |
| 2141 __ j(GREATER_EQUAL, slow_path->entry_label()); | 2142 __ j(GREATER_EQUAL, slow_path->entry_label()); |
| 2142 } | 2143 } |
| 2143 __ Bind(slow_path->exit_label()); | 2144 __ Bind(slow_path->exit_label()); |
| 2144 } | 2145 } |
| 2145 | 2146 |
| (...skipping 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4429 PcDescriptors::kOther, | 4430 PcDescriptors::kOther, |
| 4430 locs()); | 4431 locs()); |
| 4431 __ Drop(2); // Discard type arguments and receiver. | 4432 __ Drop(2); // Discard type arguments and receiver. |
| 4432 } | 4433 } |
| 4433 | 4434 |
| 4434 } // namespace dart | 4435 } // namespace dart |
| 4435 | 4436 |
| 4436 #undef __ | 4437 #undef __ |
| 4437 | 4438 |
| 4438 #endif // defined TARGET_ARCH_X64 | 4439 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |