Reviewers: mvstanton,

Description:
Reset code age when serializing code objects.

[email protected]

Please review this at https://codereview.chromium.org/642283002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+8, -0 lines):
  M src/objects.h
  M src/objects.cc
  M src/serialize.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 9f25145bf2c197048ee858906c251158c8e8570e..3eedfe92faf08b10e71b512049509a7e197ceb26 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -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: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index bcbea12cb44875c5df27ada4dceb6136416a1c3a..1faae8613b4d2e61e57a47bcef8c9f0f7df1b8f0 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -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: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 0cc629df780dcb7916f1ba6776fc4acce3906bf7..c28721900f7f7a96ff90ed5ea72e5cf939b62388 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -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;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to