Index: src/snapshot/serialize.h |
diff --git a/src/snapshot/serialize.h b/src/snapshot/serialize.h |
index 82187663a8a20857008dd459b8a3476bb85e635c..39f403b0d8bd30d193d552381e568e51a526015c 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_; } |
+ void CountInstanceType(InstanceType instance_type) { |
+ instance_type_count_[instance_type]++; |
+ } |
+ |
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,9 @@ class Serializer : public SerializerDeserializer { |
List<byte> code_buffer_; |
+ static const int kInstanceTypes = 256; |
+ int* instance_type_count_; |
+ |
DISALLOW_COPY_AND_ASSIGN(Serializer); |
}; |
@@ -761,6 +770,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 +814,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 +872,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; |