Reviewers: Jakob,

Description:
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.

[email protected]

Please review this at https://codereview.chromium.org/174883002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+1, -0 lines):
  M src/lithium-codegen.cc


Index: src/lithium-codegen.cc
diff --git a/src/lithium-codegen.cc b/src/lithium-codegen.cc
index 6d76b35c22131e47bace7ab73ccbd668072de831..a7dc6842c45c573e6ec285eea83bf34d9afeb668 100644
--- a/src/lithium-codegen.cc
+++ b/src/lithium-codegen.cc
@@ -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;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to