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

Unified Diff: src/ia32/lithium-codegen-ia32.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
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 97c20e724f0fc28226926b330b0546457dc93d6f..568fe9ee7ce69ffc1d5ec8dbc83a6ef1ae5c40e1 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -346,22 +346,33 @@ 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());
+ }
- if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr);
+ if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr);
- RecordAndUpdatePosition(instr->position());
+ RecordAndUpdatePosition(instr->position());
- instr->CompileToNative(this);
+ instr->CompileToNative(this);
- if (!CpuFeatures::IsSupported(SSE2)) {
- if (FLAG_debug_code && FLAG_enable_slow_asserts) {
- __ VerifyX87StackDepth(x87_stack_depth_);
+ if (!CpuFeatures::IsSupported(SSE2)) {
+ if (FLAG_debug_code && FLAG_enable_slow_asserts) {
+ __ VerifyX87StackDepth(x87_stack_depth_);
+ }
+ }
+ } 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());
}
}
}
@@ -2207,6 +2218,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;

Powered by Google App Engine
This is Rietveld 408576698