Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1058)

Unified Diff: src/snapshot/serializer.cc

Issue 2090563002: [serializer] encode recent long-encoded root list items as hot objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/snapshot/serializer.h ('k') | src/snapshot/startup-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serializer.cc
diff --git a/src/snapshot/serializer.cc b/src/snapshot/serializer.cc
index 9ab186f9ba1e7a2d1b974d92f19a6a3f636d83a7..1ee957a2fbd74b9a739976ed5e661375df054fc3 100644
--- a/src/snapshot/serializer.cc
+++ b/src/snapshot/serializer.cc
@@ -140,8 +140,8 @@ bool Serializer::BackReferenceIsAlreadyAllocated(
}
#endif // DEBUG
-bool Serializer::SerializeKnownObject(HeapObject* obj, HowToCode how_to_code,
- WhereToPoint where_to_point, int skip) {
+bool Serializer::SerializeHotObject(HeapObject* obj, HowToCode how_to_code,
+ WhereToPoint where_to_point, int skip) {
if (how_to_code == kPlain && where_to_point == kStartOfObject) {
vogelheim 2016/06/23 13:39:14 [Feel free to ignore, since this is not even about
Yang 2016/06/24 06:00:58 Done.
// Encode a reference to a hot object by its index in the working set.
int index = hot_objects_.Find(obj);
@@ -161,6 +161,11 @@ bool Serializer::SerializeKnownObject(HeapObject* obj, HowToCode how_to_code,
return true;
}
}
+ return false;
+}
+
+bool Serializer::SerializeBackReference(HeapObject* obj, HowToCode how_to_code,
+ WhereToPoint where_to_point, int skip) {
SerializerReference reference = reference_map_.Lookup(obj);
if (reference.is_valid()) {
// Encode the location of an already deserialized object in order to write
@@ -221,6 +226,7 @@ void Serializer::PutRoot(int root_index, HeapObject* object,
FlushSkip(skip);
sink_.Put(kRootArray + how_to_code + where_to_point, "RootSerialization");
sink_.PutInt(root_index, "root_index");
+ hot_objects_.Add(object);
}
}
« no previous file with comments | « src/snapshot/serializer.h ('k') | src/snapshot/startup-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698