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

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

Issue 14682020: Optimize functions containing try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 years, 7 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/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_optimizer.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/flow_graph_inliner.h" 5 #include "vm/flow_graph_inliner.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 static_cast<double>(initial_size_); 406 static_cast<double>(initial_size_);
407 } 407 }
408 408
409 bool TryInlining(const Function& function, 409 bool TryInlining(const Function& function,
410 const Array& argument_names, 410 const Array& argument_names,
411 InlinedCallData* call_data) { 411 InlinedCallData* call_data) {
412 TRACE_INLINING(OS::Print(" => %s (deopt count %d)\n", 412 TRACE_INLINING(OS::Print(" => %s (deopt count %d)\n",
413 function.ToCString(), 413 function.ToCString(),
414 function.deoptimization_counter())); 414 function.deoptimization_counter()));
415 415
416 // TODO(fschneider): Enable inlining inside try-blocks.
417 if (call_data->call->GetBlock()->try_index() !=
418 CatchClauseNode::kInvalidTryIndex) {
419 TRACE_INLINING(OS::Print(" Bailout: inside try-block\n"));
420 return false;
421 }
422
416 // Abort if the inlinable bit on the function is low. 423 // Abort if the inlinable bit on the function is low.
417 if (!function.IsInlineable()) { 424 if (!function.IsInlineable()) {
418 TRACE_INLINING(OS::Print(" Bailout: not inlinable\n")); 425 TRACE_INLINING(OS::Print(" Bailout: not inlinable\n"));
419 return false; 426 return false;
420 } 427 }
421 428
422 // Abort if this function has deoptimized too much. 429 // Abort if this function has deoptimized too much.
423 if (function.deoptimization_counter() >= 430 if (function.deoptimization_counter() >=
424 FLAG_deoptimization_counter_threshold) { 431 FLAG_deoptimization_counter_threshold) {
425 function.set_is_inlinable(false); 432 function.set_is_inlinable(false);
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 OS::Print("After Inlining of %s\n", flow_graph_-> 1334 OS::Print("After Inlining of %s\n", flow_graph_->
1328 parsed_function().function().ToFullyQualifiedCString()); 1335 parsed_function().function().ToFullyQualifiedCString());
1329 FlowGraphPrinter printer(*flow_graph_); 1336 FlowGraphPrinter printer(*flow_graph_);
1330 printer.PrintBlocks(); 1337 printer.PrintBlocks();
1331 } 1338 }
1332 } 1339 }
1333 } 1340 }
1334 } 1341 }
1335 1342
1336 } // namespace dart 1343 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698