Commit 2ed39d93 authored by yangguo's avatar yangguo Committed by Commit bot

Reset code age on the cloned code when serializing.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/757983002

Cr-Commit-Position: refs/heads/master@{#25498}
parent a4c9cc46
......@@ -10753,9 +10753,9 @@ static Code::Age EffectiveAge(Code::Age age) {
}
void Code::MakeYoung() {
void Code::MakeYoung(Isolate* isolate) {
byte* sequence = FindCodeAgeSequence();
if (sequence != NULL) MakeCodeAgeSequenceYoung(sequence, GetIsolate());
if (sequence != NULL) MakeCodeAgeSequenceYoung(sequence, isolate);
}
......
......@@ -5315,7 +5315,7 @@ class Code: public HeapObject {
// compilation stub.
static void MakeCodeAgeSequenceYoung(byte* sequence, Isolate* isolate);
static void MarkCodeAsExecuted(byte* sequence, Isolate* isolate);
void MakeYoung();
void MakeYoung(Isolate* isolate);
void MakeOlder(MarkingParity);
static bool IsYoungSequence(Isolate* isolate, byte* sequence);
bool IsOld();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment