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

Unified Diff: src/compiler.cc

Issue 876001: Initialize reaching definitions state for all flow graph nodes. (Closed)
Patch Set: Incorporated review comments. 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/ast.h ('k') | src/data-flow.h » ('j') | no next file with comments »
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 2a0d80d00274da0c68ab9ed84c0b2662ddb0ab59..ed4c5b99bdd2a9d564325bab9e44d9db791c1de8 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -92,6 +92,15 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) {
FlowGraphBuilder builder;
builder.Build(function);
+ if (!builder.HasStackOverflow()) {
+ int variable_count =
+ function->num_parameters() + function->scope()->num_stack_slots();
+ ReachingDefinitions rd(builder.postorder(),
+ builder.definitions(),
+ variable_count);
+ rd.Compute();
+ }
+
#ifdef DEBUG
if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
builder.graph()->PrintText(builder.postorder());
@@ -485,6 +494,15 @@ Handle<JSFunction> Compiler::BuildBoilerplate(FunctionLiteral* literal,
FlowGraphBuilder builder;
builder.Build(literal);
+ if (!builder.HasStackOverflow()) {
+ int variable_count =
+ literal->num_parameters() + literal->scope()->num_stack_slots();
+ ReachingDefinitions rd(builder.postorder(),
+ builder.definitions(),
+ variable_count);
+ rd.Compute();
+ }
+
#ifdef DEBUG
if (FLAG_print_graph_text && !builder.HasStackOverflow()) {
builder.graph()->PrintText(builder.postorder());
« no previous file with comments | « src/ast.h ('k') | src/data-flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698