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

Unified Diff: src/snapshot/serialize.h

Issue 1086363002: Serializer: collect and output memory statistics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 5 years, 8 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/flag-definitions.h ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serialize.h
diff --git a/src/snapshot/serialize.h b/src/snapshot/serialize.h
index 82187663a8a20857008dd459b8a3476bb85e635c..5afafc141d531767520e6d38c13b67327aa1d486 100644
--- a/src/snapshot/serialize.h
+++ b/src/snapshot/serialize.h
@@ -617,6 +617,10 @@ class Serializer : public SerializerDeserializer {
BackReferenceMap* back_reference_map() { return &back_reference_map_; }
RootIndexMap* root_index_map() { return &root_index_map_; }
+#ifdef OBJECT_PRINT
+ void CountInstanceType(HeapObject* obj);
+#endif // OBJECT_PRINT
+
protected:
class ObjectSerializer : public ObjectVisitor {
public:
@@ -718,6 +722,8 @@ class Serializer : public SerializerDeserializer {
SnapshotByteSink* sink() const { return sink_; }
+ void OutputStatistics(const char* name);
+
Isolate* isolate_;
SnapshotByteSink* sink_;
@@ -746,6 +752,12 @@ class Serializer : public SerializerDeserializer {
List<byte> code_buffer_;
+#ifdef OBJECT_PRINT
+ static const int kInstanceTypes = 256;
+ int* instance_type_count_;
+ size_t* instance_type_size_;
+#endif // OBJECT_PRINT
+
DISALLOW_COPY_AND_ASSIGN(Serializer);
};
@@ -761,6 +773,8 @@ class PartialSerializer : public Serializer {
InitializeCodeAddressMap();
}
+ ~PartialSerializer() { OutputStatistics("PartialSerializer"); }
+
// Serialize the objects reachable from a single object pointer.
void Serialize(Object** o);
virtual void SerializeObject(HeapObject* o, HowToCode how_to_code,
@@ -803,6 +817,8 @@ class StartupSerializer : public Serializer {
InitializeCodeAddressMap();
}
+ ~StartupSerializer() { OutputStatistics("StartupSerializer"); }
+
// The StartupSerializer has to serialize the root array, which is slightly
// different.
void VisitPointers(Object** start, Object** end) OVERRIDE;
@@ -859,6 +875,8 @@ class CodeSerializer : public Serializer {
back_reference_map_.AddSourceString(source);
}
+ ~CodeSerializer() { OutputStatistics("CodeSerializer"); }
+
virtual void SerializeObject(HeapObject* o, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) OVERRIDE;
« no previous file with comments | « src/flag-definitions.h ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698