Only invoke reaching definitions if there are >0 variables and >0 definitions.
Review URL: http://codereview.chromium.org/885004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4120 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
10e5690d32
commit
ff03f6b36f
@ -95,10 +95,12 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) {
|
|||||||
if (!builder.HasStackOverflow()) {
|
if (!builder.HasStackOverflow()) {
|
||||||
int variable_count =
|
int variable_count =
|
||||||
function->num_parameters() + function->scope()->num_stack_slots();
|
function->num_parameters() + function->scope()->num_stack_slots();
|
||||||
ReachingDefinitions rd(builder.postorder(),
|
if (variable_count > 0 && builder.definitions()->length() > 0) {
|
||||||
builder.definitions(),
|
ReachingDefinitions rd(builder.postorder(),
|
||||||
variable_count);
|
builder.definitions(),
|
||||||
rd.Compute();
|
variable_count);
|
||||||
|
rd.Compute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -497,10 +499,12 @@ Handle<JSFunction> Compiler::BuildBoilerplate(FunctionLiteral* literal,
|
|||||||
if (!builder.HasStackOverflow()) {
|
if (!builder.HasStackOverflow()) {
|
||||||
int variable_count =
|
int variable_count =
|
||||||
literal->num_parameters() + literal->scope()->num_stack_slots();
|
literal->num_parameters() + literal->scope()->num_stack_slots();
|
||||||
ReachingDefinitions rd(builder.postorder(),
|
if (variable_count > 0 && builder.definitions()->length() > 0) {
|
||||||
builder.definitions(),
|
ReachingDefinitions rd(builder.postorder(),
|
||||||
variable_count);
|
builder.definitions(),
|
||||||
rd.Compute();
|
variable_count);
|
||||||
|
rd.Compute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -2061,7 +2061,7 @@ void JoinNode::UpdateRDIn(WorkList<Node>* worklist, bool mark) {
|
|||||||
|
|
||||||
|
|
||||||
void ReachingDefinitions::Compute() {
|
void ReachingDefinitions::Compute() {
|
||||||
if (definitions_->is_empty()) return;
|
ASSERT(!definitions_->is_empty());
|
||||||
|
|
||||||
int variable_count = variables_.length();
|
int variable_count = variables_.length();
|
||||||
int definition_count = definitions_->length();
|
int definition_count = definitions_->length();
|
||||||
|
Loading…
Reference in New Issue
Block a user