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

Unified Diff: runtime/vm/compiler.cc

Issue 18111006: Collect edge count profiling data and reorder basic blocks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index ee9a5a08fb47a0d655796c53545688108e517585..3761087398b89f2a29da14a60e20b7c2b4fa7871 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -7,6 +7,7 @@
#include "vm/assembler.h"
#include "vm/ast_printer.h"
+#include "vm/block_scheduler.h"
#include "vm/code_generator.h"
#include "vm/code_patcher.h"
#include "vm/dart_entry.h"
@@ -294,6 +295,11 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
}
}
+ BlockScheduler block_scheduler(flow_graph);
Florian Schneider 2013/08/12 11:30:09 Maybe add a flag FLAG_reorder_basic_blocks to cont
Kevin Millikin (Google) 2013/08/13 11:14:57 Done.
+ if (optimized) {
+ block_scheduler.AssignEdgeWeights();
+ }
+
if (optimized) {
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::ssa_timer,
@@ -306,7 +312,6 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
}
}
-
// Collect all instance fields that are loaded in the graph and
// have non-generic type feedback attached to them that can
// potentially affect optimizations.
@@ -481,15 +486,15 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
FlowGraphAllocator allocator(*flow_graph);
allocator.AllocateRegisters();
+ block_scheduler.ReorderBlocks();
+
if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) {
FlowGraphPrinter::PrintGraph("After Optimizations", flow_graph);
}
}
Assembler assembler;
- FlowGraphCompiler graph_compiler(&assembler,
- *flow_graph,
- optimized);
+ FlowGraphCompiler graph_compiler(&assembler, flow_graph, optimized);
{
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::graphcompiler_timer,

Powered by Google App Engine
This is Rietveld 408576698