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

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

Issue 180483003: Check elimination did not mark some dead blocks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | test/mjsunit/regress/regress-347914.js » ('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 0ea0c3a1ef22ef50955c4ed6d458c47f8b27654a..a7c45ac31cdd03a0aacc61a19419fd34cb8c9636 100644
--- a/src/hydrogen-check-elimination.cc
+++ b/src/hydrogen-check-elimination.cc
@@ -137,6 +137,12 @@ class HCheckTable : public ZoneObject {
Zone* zone) {
if (state == NULL) {
block->MarkUnreachable();
+ } else if (block->IsUnreachable()) {
+ state = NULL;
+ }
+ if (FLAG_trace_check_elimination) {
+ PrintF("Processing B%d, checkmaps-table:\n", block->block_id());
+ Print(state);
}
return state;
}
@@ -147,6 +153,7 @@ class HCheckTable : public ZoneObject {
HCheckTable* copy = new(phase_->zone()) HCheckTable(phase_);
for (int i = 0; i < size_; i++) {
HCheckTableEntry* old_entry = &entries_[i];
+ ASSERT(old_entry->maps_->size() > 0);
HCheckTableEntry* new_entry = &copy->entries_[i];
new_entry->object_ = old_entry->object_;
new_entry->maps_ = old_entry->maps_->Copy(phase_->zone());
@@ -236,7 +243,7 @@ class HCheckTable : public ZoneObject {
succ->block_id(),
learned ? "learned" : "copied",
from_block->block_id());
- copy->Print();
+ Print(copy);
}
return copy;
@@ -283,7 +290,7 @@ class HCheckTable : public ZoneObject {
if (FLAG_trace_check_elimination) {
PrintF("B%d checkmaps-table merged with B%d table:\n",
succ->block_id(), pred_block->block_id());
- Print();
+ Print(this);
}
return this;
}
@@ -346,7 +353,7 @@ class HCheckTable : public ZoneObject {
}
if (FLAG_trace_check_elimination) {
- Print();
+ Print(this);
}
INC_STAT(narrowed_);
}
@@ -540,9 +547,14 @@ class HCheckTable : public ZoneObject {
cursor_ = size_; // Move cursor to end.
}
- void Print() {
- for (int i = 0; i < size_; i++) {
- HCheckTableEntry* entry = &entries_[i];
+ static void Print(HCheckTable* table) {
+ if (table == NULL) {
+ PrintF(" unreachable\n");
+ return;
+ }
+
+ for (int i = 0; i < table->size_; i++) {
+ HCheckTableEntry* entry = &table->entries_[i];
ASSERT(entry->object_ != NULL);
PrintF(" checkmaps-table @%d: %s #%d ", i,
entry->object_->IsPhi() ? "phi" : "object", entry->object_->id());
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-347914.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698