Commit 4fa40ebc authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Include the loop header block when eliminating stack checks

In simple unconditional loops - like the following - the hydrogen stack check elimination did not detect the call as the loop header block itself was not considered.

function f(o) {
  while(true) {
    o.a();
  }
}

R=fschneider@chromium.org

BUG=none
TEST=none

Review URL: http://codereview.chromium.org//7210010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8329 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5fb7199b
......@@ -1250,16 +1250,20 @@ void HStackCheckEliminator::Process() {
if (block->IsLoopHeader()) {
HBasicBlock* back_edge = block->loop_information()->GetLastBackEdge();
HBasicBlock* dominator = back_edge;
bool back_edge_dominated_by_call = false;
while (dominator != block && !back_edge_dominated_by_call) {
while (true) {
HInstruction* instr = dominator->first();
while (instr != NULL && !back_edge_dominated_by_call) {
while (instr != NULL) {
if (instr->IsCall()) {
RemoveStackCheck(back_edge);
back_edge_dominated_by_call = true;
break;
}
instr = instr->next();
}
// Done when the loop header is processed.
if (dominator == block) break;
// Move up the dominator tree.
dominator = dominator->dominator();
}
}
......
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