Index: src/snapshot/startup-serializer.cc |
diff --git a/src/snapshot/startup-serializer.cc b/src/snapshot/startup-serializer.cc |
index 80598e80bd04aa30a6b0c949feb8df69a7a53a44..35e62403fb53f8cfa9b93726fbca736dc7c02d9c 100644 |
--- a/src/snapshot/startup-serializer.cc |
+++ b/src/snapshot/startup-serializer.cc |
@@ -21,6 +21,7 @@ StartupSerializer::StartupSerializer( |
} |
StartupSerializer::~StartupSerializer() { |
+ RestoreExternalReferenceRedirectors(&accessor_infos_); |
OutputStatistics("StartupSerializer"); |
} |
@@ -66,6 +67,14 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
FlushSkip(skip); |
+ if (isolate_->external_reference_redirector() && obj->IsAccessorInfo()) { |
+ // Wipe external reference redirects in the accessor info. |
+ AccessorInfo* info = AccessorInfo::cast(obj); |
+ Address original_address = Foreign::cast(info->getter())->foreign_address(); |
+ Foreign::cast(info->js_getter())->set_foreign_address(original_address); |
+ accessor_infos_.Add(info); |
+ } |
+ |
// Object has not yet been serialized. Serialize it here. |
ObjectSerializer object_serializer(this, obj, &sink_, how_to_code, |
where_to_point); |