Index: src/heap/mark-compact.cc |
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
index c931f520b7aea13f03a45941eca58e76d05b65cb..851f8faeff67e3d1cdb21707884edf4ac89e9aaa 100644 |
--- a/src/heap/mark-compact.cc |
+++ b/src/heap/mark-compact.cc |
@@ -1439,8 +1439,12 @@ class StringTableCleaner : public ObjectVisitor { |
if (o->IsHeapObject()) { |
if (Marking::IsWhite(ObjectMarking::MarkBitFrom(HeapObject::cast(o)))) { |
if (finalize_external_strings) { |
- DCHECK(o->IsExternalString()); |
- heap_->FinalizeExternalString(String::cast(*p)); |
+ if (o->IsExternalString()) { |
+ heap_->FinalizeExternalString(String::cast(*p)); |
+ } else { |
+ // The original external string may have been internalized. |
+ DCHECK(o->IsThinString()); |
+ } |
} else { |
pointers_removed_++; |
} |