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

Side by Side Diff: runtime/vm/code_generator.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 | « no previous file | runtime/vm/flow_graph_builder.h » ('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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 1311
1312 if (FLAG_use_osr && (interrupt_bits == 0)) { 1312 if (FLAG_use_osr && (interrupt_bits == 0)) {
1313 DartFrameIterator iterator; 1313 DartFrameIterator iterator;
1314 StackFrame* frame = iterator.NextFrame(); 1314 StackFrame* frame = iterator.NextFrame();
1315 const Function& function = Function::Handle(frame->LookupDartFunction()); 1315 const Function& function = Function::Handle(frame->LookupDartFunction());
1316 ASSERT(!function.IsNull()); 1316 ASSERT(!function.IsNull());
1317 if (!CanOptimizeFunction(function, isolate)) return; 1317 if (!CanOptimizeFunction(function, isolate)) return;
1318 intptr_t osr_id = 1318 intptr_t osr_id =
1319 Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc()); 1319 Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc());
1320 if (FLAG_trace_osr) { 1320 if (FLAG_trace_osr) {
1321 OS::Print("Attempting OSR for %s at id=%"Pd"\n", 1321 OS::Print("Attempting OSR for %s at id=%"Pd", count=%"Pd"\n",
1322 function.ToFullyQualifiedCString(), 1322 function.ToFullyQualifiedCString(),
1323 osr_id); 1323 osr_id,
1324 function.usage_counter());
1324 } 1325 }
1325 1326
1326 const Code& original_code = Code::Handle(function.CurrentCode()); 1327 const Code& original_code = Code::Handle(function.CurrentCode());
1327 const Error& error = 1328 const Error& error =
1328 Error::Handle(Compiler::CompileOptimizedFunction(function, osr_id)); 1329 Error::Handle(Compiler::CompileOptimizedFunction(function, osr_id));
1329 if (!error.IsNull()) Exceptions::PropagateError(error); 1330 if (!error.IsNull()) Exceptions::PropagateError(error);
1330 1331
1331 const Code& optimized_code = Code::Handle(function.CurrentCode()); 1332 const Code& optimized_code = Code::Handle(function.CurrentCode());
1332 // The current code will not be changed in the case that the compiler 1333 // The current code will not be changed in the case that the compiler
1333 // bailed out during OSR compilation. 1334 // bailed out during OSR compilation.
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 // Arg1: Value that is being stored. 1806 // Arg1: Value that is being stored.
1806 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { 1807 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) {
1807 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count()); 1808 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count());
1808 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); 1809 const Field& field = Field::CheckedHandle(arguments.ArgAt(0));
1809 const Object& value = Object::Handle(arguments.ArgAt(1)); 1810 const Object& value = Object::Handle(arguments.ArgAt(1));
1810 1811
1811 field.UpdateCid(value.GetClassId()); 1812 field.UpdateCid(value.GetClassId());
1812 } 1813 }
1813 1814
1814 } // namespace dart 1815 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698