Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 22876009: Improve and simplify removal of unreachable code (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix ia32 Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/lithium.cc ('K') | « src/lithium.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« src/lithium.cc ('K') | « src/lithium.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698