Index: src/serialize.cc |
diff --git a/src/serialize.cc b/src/serialize.cc |
index e502c9559fce70b186d4a911936bf042239e8c71..c2dd338b7ec5c3151a4f9e7606a324f72d9aa8d2 100644 |
--- a/src/serialize.cc |
+++ b/src/serialize.cc |
@@ -1874,6 +1874,8 @@ int Serializer::ObjectSerializer::OutputRawData( |
// To make snapshots reproducible, we need to wipe out all pointers in code. |
if (code_object_) { |
Code* code = CloneCodeObject(object_); |
+ // Code age headers are not serializable. |
+ code->MakeYoung(serializer_->isolate()); |
WipeOutRelocations(code); |
// We need to wipe out the header fields *after* wiping out the |
// relocations, because some of these fields are needed for the latter. |
@@ -2049,7 +2051,6 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
if (code_object != main_code_ && !FLAG_serialize_inner) { |
SerializeBuiltin(Builtins::kCompileLazy, how_to_code, where_to_point); |
} else { |
- code_object->MakeYoung(); |
SerializeGeneric(code_object, how_to_code, where_to_point); |
} |
return; |