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

Unified Diff: src/compiler.cc

Issue 660449: Initial implementation of an edge-labeled instruction flow graph. (Closed)
Patch Set: Remove unused depth-first search function. Created 10 years, 10 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/ast.h ('k') | src/data-flow.h » ('j') | src/data-flow.h » ('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 557a91e4db434d2af30ee2170eded3f707f5caf5..52752fa0683f4f209583ee283965e5b6d3ccf310 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -31,6 +31,7 @@
#include "codegen-inl.h"
#include "compilation-cache.h"
#include "compiler.h"
+#include "data-flow.h"
#include "debug.h"
#include "fast-codegen.h"
#include "full-codegen.h"
@@ -79,6 +80,17 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) {
return Handle<Code>::null();
}
+ if (FLAG_use_flow_graph) {
+ FlowGraphBuilder builder;
+ builder.Build(function);
+
+#ifdef DEBUG
+ if (FLAG_print_graph_text) {
+ builder.graph()->PrintText(builder.postorder());
+ }
+#endif
+ }
+
// Generate code and return it. Code generator selection is governed by
// which backends are enabled and whether the function is considered
// run-once code or not:
@@ -444,6 +456,17 @@ Handle<JSFunction> Compiler::BuildBoilerplate(FunctionLiteral* literal,
return Handle<JSFunction>::null();
}
+ if (FLAG_use_flow_graph) {
+ FlowGraphBuilder builder;
+ builder.Build(literal);
+
+#ifdef DEBUG
+ if (FLAG_print_graph_text) {
+ builder.graph()->PrintText(builder.postorder());
+ }
+#endif
+ }
+
// Generate code and return it. The way that the compilation mode
// is controlled by the command-line flags is described in
// the static helper function MakeCode.
« no previous file with comments | « src/ast.h ('k') | src/data-flow.h » ('j') | src/data-flow.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698