Reset code age when serializing code objects.
authoryangguo@chromium.org <yangguo@chromium.org>
Fri, 10 Oct 2014 10:51:34 +0000 (10:51 +0000)
committeryangguo@chromium.org <yangguo@chromium.org>
Fri, 10 Oct 2014 10:51:34 +0000 (10:51 +0000)
R=mvstanton@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24523 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects.cc
src/objects.h
src/serialize.cc

index 9f25145..3eedfe9 100644 (file)
@@ -10463,6 +10463,12 @@ static Code::Age EffectiveAge(Code::Age age) {
 }
 
 
+void Code::MakeYoung() {
+  byte* sequence = FindCodeAgeSequence();
+  if (sequence != NULL) MakeCodeAgeSequenceYoung(sequence, GetIsolate());
+}
+
+
 void Code::MakeOlder(MarkingParity current_parity) {
   byte* sequence = FindCodeAgeSequence();
   if (sequence != NULL) {
index bcbea12..1faae86 100644 (file)
@@ -5310,6 +5310,7 @@ class Code: public HeapObject {
   // compilation stub.
   static void MakeCodeAgeSequenceYoung(byte* sequence, Isolate* isolate);
   static void MarkCodeAsExecuted(byte* sequence, Isolate* isolate);
+  void MakeYoung();
   void MakeOlder(MarkingParity);
   static bool IsYoungSequence(Isolate* isolate, byte* sequence);
   bool IsOld();
index 0cc629d..c287219 100644 (file)
@@ -1991,6 +1991,7 @@ void CodeSerializer::SerializeObject(Object* o, HowToCode how_to_code,
           Code* lazy = *isolate()->builtins()->CompileLazy();
           SerializeBuiltin(lazy, how_to_code, where_to_point);
         } else {
+          code_object->MakeYoung();
           SerializeHeapObject(code_object, how_to_code, where_to_point);
         }
         return;