Reviewers: ulan,
Description:
Add CHECKs to verify that we never finalize stale copies of external strings
BUG=none
R=u...@chromium.org
LOG=n
Please review this at https://codereview.chromium.org/1160253010/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+8, -1 lines):
M src/heap/mark-compact.cc
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());
}
}
}
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.