Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 17315006: Scale the OSR optimization threshold by loop nesting depth. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after
2147 2147
2148 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2148 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2149 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); 2149 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
2150 compiler->AddSlowPathCode(slow_path); 2150 compiler->AddSlowPathCode(slow_path);
2151 2151
2152 __ cmpl(ESP, 2152 __ cmpl(ESP,
2153 Address::Absolute(Isolate::Current()->stack_limit_address())); 2153 Address::Absolute(Isolate::Current()->stack_limit_address()));
2154 __ j(BELOW_EQUAL, slow_path->entry_label()); 2154 __ j(BELOW_EQUAL, slow_path->entry_label());
2155 if (compiler->CanOSRFunction() && in_loop()) { 2155 if (compiler->CanOSRFunction() && in_loop()) {
2156 // In unoptimized code check the usage counter to trigger OSR at loop 2156 // In unoptimized code check the usage counter to trigger OSR at loop
2157 // stack checks. 2157 // stack checks. Use progressively higher thresholds for more deeply
2158 // nested loops to attempt to hit outer loops with OSR when possible.
2158 __ LoadObject(EDI, compiler->parsed_function().function()); 2159 __ LoadObject(EDI, compiler->parsed_function().function());
2160 intptr_t threshold =
2161 FLAG_optimization_counter_threshold * (loop_depth() + 1);
2159 __ cmpl(FieldAddress(EDI, Function::usage_counter_offset()), 2162 __ cmpl(FieldAddress(EDI, Function::usage_counter_offset()),
2160 Immediate(2 * FLAG_optimization_counter_threshold)); 2163 Immediate(threshold));
2161 __ j(GREATER_EQUAL, slow_path->entry_label()); 2164 __ j(GREATER_EQUAL, slow_path->entry_label());
2162 } 2165 }
2163 __ Bind(slow_path->exit_label()); 2166 __ Bind(slow_path->exit_label());
2164 } 2167 }
2165 2168
2166 2169
2167 static void EmitSmiShiftLeft(FlowGraphCompiler* compiler, 2170 static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
2168 BinarySmiOpInstr* shift_left) { 2171 BinarySmiOpInstr* shift_left) {
2169 const bool is_truncating = shift_left->is_truncating(); 2172 const bool is_truncating = shift_left->is_truncating();
2170 const LocationSummary& locs = *shift_left->locs(); 2173 const LocationSummary& locs = *shift_left->locs();
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after
4764 PcDescriptors::kOther, 4767 PcDescriptors::kOther,
4765 locs()); 4768 locs());
4766 __ Drop(2); // Discard type arguments and receiver. 4769 __ Drop(2); // Discard type arguments and receiver.
4767 } 4770 }
4768 4771
4769 } // namespace dart 4772 } // namespace dart
4770 4773
4771 #undef __ 4774 #undef __
4772 4775
4773 #endif // defined TARGET_ARCH_IA32 4776 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698