Commit 0a5113b6 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Skip unreachable blocks when looking for next emitted block.

Goto does not emit a jump if the target is the next emitted block.
However, if there is an unreachable block between Goto and the jump
target, we still emit a jump even though the unreachable block is
not actually emitted. That jump is unnecessary.

R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19739 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b83b8b9e
......@@ -142,6 +142,7 @@ void LCodeGenBase::Comment(const char* format, ...) {
int LCodeGenBase::GetNextEmittedBlock() const {
for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) {
if (!graph()->blocks()->at(i)->IsReachable()) continue;
if (!chunk_->GetLabel(i)->HasReplacement()) return i;
}
return -1;
......
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