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

Unified Diff: src/compiler.cc

Issue 1155006: Include initial definitions in reaching definitions analysis. (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 | « no previous file | 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 11098bae98e160e5a107b03270ab745ae68c3d7f..e95117e079674a2f4236b0fe12eab25f68b13c48 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -89,15 +89,15 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) {
}
if (FLAG_use_flow_graph) {
- FlowGraphBuilder builder;
+ int variable_count =
+ function->num_parameters() + function->scope()->num_stack_slots();
+ FlowGraphBuilder builder(variable_count);
builder.Build(function);
if (!builder.HasStackOverflow()) {
- int variable_count =
- function->num_parameters() + function->scope()->num_stack_slots();
- if (variable_count > 0 && builder.definitions()->length() > 0) {
+ if (variable_count > 0) {
ReachingDefinitions rd(builder.postorder(),
- builder.definitions(),
+ builder.body_definitions(),
variable_count);
rd.Compute();
}
@@ -497,15 +497,15 @@ Handle<JSFunction> Compiler::BuildBoilerplate(FunctionLiteral* literal,
}
if (FLAG_use_flow_graph) {
- FlowGraphBuilder builder;
+ int variable_count =
+ literal->num_parameters() + literal->scope()->num_stack_slots();
+ FlowGraphBuilder builder(variable_count);
builder.Build(literal);
if (!builder.HasStackOverflow()) {
- int variable_count =
- literal->num_parameters() + literal->scope()->num_stack_slots();
- if (variable_count > 0 && builder.definitions()->length() > 0) {
+ if (variable_count > 0) {
ReachingDefinitions rd(builder.postorder(),
- builder.definitions(),
+ builder.body_definitions(),
variable_count);
rd.Compute();
}
« no previous file with comments | « no previous file | src/data-flow.h » ('j') | src/data-flow.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698