Commit b82e10d3 authored by ishell's avatar ishell Committed by Commit bot

[crankshaft] Generate lazy bailout point for HProlog instruction only when it is necessary.

This fix removes unnecessary nops from function prolog and seems to recover performance regression on some of SunSpider benchmarks.

TBR=bmeurer@chromium.org
BUG=chromium:531369
LOG=N

Review URL: https://codereview.chromium.org/1800233003

Cr-Commit-Position: refs/heads/master@{#34810}
parent 5c16cac9
......@@ -876,7 +876,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -891,7 +891,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
......@@ -714,7 +714,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -740,7 +740,11 @@ LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
......@@ -908,7 +908,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -923,7 +923,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
......@@ -886,7 +886,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -901,7 +901,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
......@@ -886,7 +886,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -901,7 +901,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
......@@ -890,7 +890,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -905,7 +905,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
......@@ -814,7 +814,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -828,7 +828,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
......
......@@ -900,7 +900,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -920,7 +920,11 @@ LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
......@@ -924,7 +924,7 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
}
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall() || instr->IsPrologue()) {
if (instr->IsCall()) {
HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
if (hydrogen_val->HasObservableSideEffects()) {
HSimulate* sim = HSimulate::cast(hydrogen_val->next());
......@@ -939,7 +939,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
LInstruction* LChunkBuilder::DoPrologue(HPrologue* instr) {
return new (zone()) LPrologue();
LInstruction* result = new (zone()) LPrologue();
if (info_->num_heap_slots() > 0) {
result = MarkAsCall(result, instr);
}
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment