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

Unified Diff: src/compiler.cc

Issue 1530003: Rework flow graph construction. (Closed)
Patch Set: Created 10 years, 9 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
« no previous file with comments | « src/compiler.h ('k') | src/data-flow.h » ('j') | src/data-flow.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index c9dd10796584a80a2576d07df4e0311d7ce2f694..9c4113d84c26e59f8c2c8c23094924589ffb379a 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -90,33 +90,13 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) {
}
if (FLAG_use_flow_graph) {
- int variable_count =
- function->num_parameters() + function->scope()->num_stack_slots();
- FlowGraphBuilder builder(variable_count);
- builder.Build(function);
-
- if (!builder.HasStackOverflow()) {
- if (variable_count > 0) {
- ReachingDefinitions rd(builder.postorder(),
- builder.body_definitions(),
- variable_count);
- rd.Compute();
-
- TypeAnalyzer ta(builder.postorder(),
- builder.body_definitions(),
- variable_count,
- function->num_parameters());
- ta.Compute();
-
- MarkLiveCode(builder.preorder(),
- builder.body_definitions(),
- variable_count);
- }
- }
+ FlowGraphBuilder builder;
+ FlowGraph* graph = builder.Build(function);
+ USE(graph);
#ifdef DEBUG
if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
- builder.graph()->PrintText(function, builder.postorder());
+ graph->PrintAsText(function->name());
}
#endif
}
@@ -499,33 +479,13 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal,
}
if (FLAG_use_flow_graph) {
- int variable_count =
- literal->num_parameters() + literal->scope()->num_stack_slots();
- FlowGraphBuilder builder(variable_count);
- builder.Build(literal);
-
- if (!builder.HasStackOverflow()) {
- if (variable_count > 0) {
- ReachingDefinitions rd(builder.postorder(),
- builder.body_definitions(),
- variable_count);
- rd.Compute();
-
- TypeAnalyzer ta(builder.postorder(),
- builder.body_definitions(),
- variable_count,
- literal->num_parameters());
- ta.Compute();
-
- MarkLiveCode(builder.preorder(),
- builder.body_definitions(),
- variable_count);
- }
- }
+ FlowGraphBuilder builder;
+ FlowGraph* graph = builder.Build(literal);
+ USE(graph);
#ifdef DEBUG
if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
- builder.graph()->PrintText(literal, builder.postorder());
+ graph->PrintAsText(literal->name());
}
#endif
}
« no previous file with comments | « src/compiler.h ('k') | src/data-flow.h » ('j') | src/data-flow.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698