| Index: src/snapshot/serialize.cc
|
| diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc
|
| index b7c7dc1dd1c012264705860fd832e087910fc67e..713f245f668fb507e8ae5788c5ecfabe31619084 100644
|
| --- a/src/snapshot/serialize.cc
|
| +++ b/src/snapshot/serialize.cc
|
| @@ -1092,6 +1092,12 @@ void Deserializer::ReadData(Object** current, Object** limit, int source_space,
|
| break;
|
| }
|
|
|
| + case kClearedWeakCell: {
|
| + Object* cleared_weak_cell = isolate_->heap()->cleared_weak_cell();
|
| + UnalignedCopy(current++, &cleared_weak_cell);
|
| + break;
|
| + }
|
| +
|
| case kSynchronize:
|
| // If we get here then that indicates that you have a mismatch between
|
| // the number of GC roots when serializing and deserializing.
|
| @@ -1462,6 +1468,11 @@ bool Serializer::BackReferenceIsAlreadyAllocated(BackReference reference) {
|
|
|
| bool Serializer::SerializeKnownObject(HeapObject* obj, HowToCode how_to_code,
|
| WhereToPoint where_to_point, int skip) {
|
| + if (obj->IsWeakCell() && WeakCell::cast(obj)->cleared()) {
|
| + FlushSkip(skip);
|
| + sink_->Put(kClearedWeakCell, "ClearedWeakCell");
|
| + return true;
|
| + }
|
| if (how_to_code == kPlain && where_to_point == kStartOfObject) {
|
| // Encode a reference to a hot object by its index in the working set.
|
| int index = hot_objects_.Find(obj);
|
|
|