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

Unified Diff: src/hydrogen-store-elimination.cc

Issue 297933002: Skip dead blocks/instructions in store elimination. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-store-elimination.cc
diff --git a/src/hydrogen-store-elimination.cc b/src/hydrogen-store-elimination.cc
index bbb115a9b40dfb67935a2ec34bf7641cb3d430c9..e8e8da0267093dced57ae63add550062fe866ea1 100644
--- a/src/hydrogen-store-elimination.cc
+++ b/src/hydrogen-store-elimination.cc
@@ -30,8 +30,10 @@ void HStoreEliminationPhase::Run() {
for (int i = 0; i < graph()->blocks()->length(); i++) {
unobserved_.Rewind(0);
HBasicBlock* block = graph()->blocks()->at(i);
+ if (!block->IsReachable()) continue;
for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
HInstruction* instr = it.Current();
+ if (instr->CheckFlag(HValue::kIsDead)) continue;
// TODO(titzer): eliminate unobserved HStoreKeyed instructions too.
switch (instr->opcode()) {
@@ -97,17 +99,20 @@ void HStoreEliminationPhase::ProcessInstr(HInstruction* instr,
GVNFlagSet flags) {
if (unobserved_.length() == 0) return; // Nothing to do.
if (instr->CanDeoptimize()) {
- TRACE(("-- Observed stores at I%d (might deoptimize)\n", instr->id()));
+ TRACE(("-- Observed stores at I%d (%s might deoptimize)\n",
+ instr->id(), instr->Mnemonic()));
unobserved_.Rewind(0);
return;
}
if (instr->CheckChangesFlag(kNewSpacePromotion)) {
- TRACE(("-- Observed stores at I%d (might GC)\n", instr->id()));
+ TRACE(("-- Observed stores at I%d (%s might GC)\n",
+ instr->id(), instr->Mnemonic()));
unobserved_.Rewind(0);
return;
}
if (instr->DependsOnFlags().ContainsAnyOf(flags)) {
- TRACE(("-- Observed stores at I%d (GVN flags)\n", instr->id()));
+ TRACE(("-- Observed stores at I%d (GVN flags of %s)\n",
+ instr->id(), instr->Mnemonic()));
unobserved_.Rewind(0);
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698