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

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

Issue 137783011: Revert "Eliminatable CheckMaps replaced with if(true) or if(false)." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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 | « src/hydrogen.cc ('k') | src/hydrogen-flow-engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-check-elimination.cc
diff --git a/src/hydrogen-check-elimination.cc b/src/hydrogen-check-elimination.cc
index 90e8450c821a17081c8bbd7dc9991ee28e792070..ae11042ba1e449b3c33b2d036ca36477165142d6 100644
--- a/src/hydrogen-check-elimination.cc
+++ b/src/hydrogen-check-elimination.cc
@@ -132,10 +132,8 @@ class HCheckTable : public ZoneObject {
// Branch-sensitive analysis for certain comparisons may add more facts
// to the state for the successor on the true branch.
- HBasicBlock* pred_block = succ->predecessors()->at(0);
- HControlInstruction* end = pred_block->end();
- if (succ->predecessors()->length() == 1 && end->SuccessorAt(0) == succ &&
- pred_block->IsReachable()) {
+ HControlInstruction* end = succ->predecessors()->at(0)->end();
+ if (succ->predecessors()->length() == 1 && end->SuccessorAt(0) == succ) {
if (end->IsCompareMap()) {
// Learn on the true branch of if(CompareMap(x)).
HCompareMap* cmp = HCompareMap::cast(end);
@@ -313,27 +311,14 @@ class HCheckTable : public ZoneObject {
void ReduceCompareMap(HCompareMap* instr) {
MapSet maps = FindMaps(instr->value()->ActualValue());
if (maps == NULL) return;
-
- TRACE(("CompareMap for #%d at B%d ",
- instr->value()->ActualValue()->id(), instr->block()->block_id()));
-
if (maps->Contains(instr->map())) {
if (maps->size() == 1) {
+ // TODO(titzer): replace with goto true branch
INC_STAT(compares_true_);
-
- TRACE(("replaced with goto B%d (true target)\n",
- instr->SuccessorAt(0)->block_id()));
-
- instr->block()->ReplaceControlWithGotoSuccessor(0);
- } else {
- TRACE(("can't be replaced with goto: ambiguous set of maps\n"));
}
} else {
+ // TODO(titzer): replace with goto false branch
INC_STAT(compares_false_);
- TRACE(("replaced with goto B%d (false target)\n",
- instr->SuccessorAt(1)->block_id()));
-
- instr->block()->ReplaceControlWithGotoSuccessor(1);
}
}
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-flow-engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698