| Index: src/snapshot/serialize.cc
|
| diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc
|
| index c819a11ea762e7cc6cc77819670023b374cc8fa6..7588fbcf90f982b959d3de4a7504febcec64892b 100644
|
| --- a/src/snapshot/serialize.cc
|
| +++ b/src/snapshot/serialize.cc
|
| @@ -1911,7 +1911,23 @@ void Serializer::ObjectSerializer::Serialize() {
|
| if (object_->IsPrototypeInfo()) {
|
| Object* prototype_users = PrototypeInfo::cast(object_)->prototype_users();
|
| if (prototype_users->IsWeakFixedArray()) {
|
| - WeakFixedArray::cast(prototype_users)->Compact();
|
| + WeakFixedArray* array = WeakFixedArray::cast(prototype_users);
|
| + array->Compact<JSObject::PrototypeRegistryCompactionCallback>();
|
| + }
|
| + }
|
| + // Compaction of a prototype users list can require the registered users
|
| + // to update their remembered slots. That doesn't work if those users
|
| + // have already been serialized themselves. So if this object is a
|
| + // registered user, compact its prototype's user list now.
|
| + if (object_->IsMap()) {
|
| + Map* map = Map::cast(object_);
|
| + if (map->is_prototype_map() && map->prototype_info()->IsPrototypeInfo() &&
|
| + PrototypeInfo::cast(map->prototype_info())->registry_slot() !=
|
| + PrototypeInfo::UNREGISTERED) {
|
| + JSObject* proto = JSObject::cast(map->prototype());
|
| + PrototypeInfo* info = PrototypeInfo::cast(proto->map()->prototype_info());
|
| + WeakFixedArray* array = WeakFixedArray::cast(info->prototype_users());
|
| + array->Compact<JSObject::PrototypeRegistryCompactionCallback>();
|
| }
|
| }
|
|
|
| @@ -1921,7 +1937,8 @@ void Serializer::ObjectSerializer::Serialize() {
|
| Script::cast(object_)->set_line_ends(undefined);
|
| Object* shared_list = Script::cast(object_)->shared_function_infos();
|
| if (shared_list->IsWeakFixedArray()) {
|
| - WeakFixedArray::cast(shared_list)->Compact();
|
| + WeakFixedArray::cast(shared_list)
|
| + ->Compact<WeakFixedArray::NullCallback>();
|
| }
|
| }
|
|
|
|
|