Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index abb8c77b5b772cd0440251034944771b8277abd9..adc3e18c5e3fa2f3f8f30275d76457519b3b9d10 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -271,16 +271,27 @@ bool LCodeGen::GenerateBody() { |
} |
if (!emit_instructions) continue; |
- if (FLAG_code_comments && instr->HasInterestingComment(this)) { |
- Comment(";;; <@%d,#%d> %s", |
- current_instruction_, |
- instr->hydrogen_value()->id(), |
- instr->Mnemonic()); |
- } |
+ if (instr->hydrogen_value()->block()->IsReachable()) { |
+ if (FLAG_code_comments && instr->HasInterestingComment(this)) { |
+ Comment(";;; <@%d,#%d> %s", |
+ current_instruction_, |
+ instr->hydrogen_value()->id(), |
+ instr->Mnemonic()); |
+ } |
- RecordAndUpdatePosition(instr->position()); |
+ RecordAndUpdatePosition(instr->position()); |
- instr->CompileToNative(this); |
+ instr->CompileToNative(this); |
+ } else { |
+ if (FLAG_code_comments && instr->IsLabel()) { |
+ Comment( |
+ ";;; <@%d,#%d> -------------------- B%d (unreachable/elided) " |
+ "--------------------", |
+ current_instruction_, |
+ instr->hydrogen_value()->id(), |
+ instr->hydrogen_value()->block()->block_id()); |
+ } |
+ } |
} |
EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); |
return !is_aborted(); |
@@ -1872,6 +1883,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
int LCodeGen::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; |