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

Unified Diff: src/heap/mark-compact.cc

Issue 1160253010: Add CHECKs to verify that we never finalize stale copies of external strings (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 521be78e2eff9976cd0db5d49e27ca5888c958db..5da3a1fc5b4234806fe97cecf7a38f56de7d857b 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1679,13 +1679,20 @@ class StringTableCleaner : public ObjectVisitor {
if (o->IsHeapObject() &&
Marking::IsWhite(Marking::MarkBitFrom(HeapObject::cast(o)))) {
if (finalize_external_strings) {
- DCHECK(o->IsExternalString());
+ // We must never finalize a string that was copied (has a forwarding
+ // map).
+ CHECK(o->IsExternalString());
heap_->FinalizeExternalString(String::cast(*p));
} else {
pointers_removed_++;
}
// Set the entry to the_hole_value (as deleted).
*p = heap_->the_hole_value();
+ } else {
+ // Anything in the external string table has to be either a string or
+ // the hole.
+ CHECK(!finalize_external_strings || o->IsExternalString() ||
+ o->IsTheHole());
}
}
}
« 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