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

Side by Side Diff: src/profile-generator.h

Issue 3421009: Revision 2.4.4.... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 HeapSnapshotsCollection* collection_; 969 HeapSnapshotsCollection* collection_;
970 // Mapping from HeapObject* pointers to HeapEntry* pointers. 970 // Mapping from HeapObject* pointers to HeapEntry* pointers.
971 HeapEntriesMap entries_; 971 HeapEntriesMap entries_;
972 SnapshotFillerInterface* filler_; 972 SnapshotFillerInterface* filler_;
973 973
974 friend class IndexedReferencesExtractor; 974 friend class IndexedReferencesExtractor;
975 975
976 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotGenerator); 976 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotGenerator);
977 }; 977 };
978 978
979 class OutputStreamWriter;
980
981 class HeapSnapshotJSONSerializer {
982 public:
983 explicit HeapSnapshotJSONSerializer(HeapSnapshot* snapshot)
984 : snapshot_(snapshot),
985 nodes_(ObjectsMatch),
986 strings_(ObjectsMatch),
987 next_node_id_(1),
988 next_string_id_(1),
989 writer_(NULL) {
990 }
991 void Serialize(v8::OutputStream* stream);
992
993 private:
994 INLINE(static bool ObjectsMatch(void* key1, void* key2)) {
995 return key1 == key2;
996 }
997
998 INLINE(static uint32_t ObjectHash(const void* key)) {
999 return static_cast<int32_t>(reinterpret_cast<intptr_t>(key));
1000 }
1001
1002 void EnumerateNodes();
1003 int GetNodeId(HeapEntry* entry);
1004 int GetStringId(const char* s);
1005 void SerializeEdge(HeapGraphEdge* edge);
1006 void SerializeImpl();
1007 void SerializeNode(HeapEntry* entry);
1008 void SerializeNodes();
1009 void SerializeSnapshot();
1010 void SerializeString(const unsigned char* s);
1011 void SerializeStrings();
1012 void SortHashMap(HashMap* map, List<HashMap::Entry*>* sorted_entries);
1013
1014 HeapSnapshot* snapshot_;
1015 HashMap nodes_;
1016 HashMap strings_;
1017 int next_node_id_;
1018 int next_string_id_;
1019 OutputStreamWriter* writer_;
1020
1021 friend class HeapSnapshotJSONSerializerEnumerator;
1022 friend class HeapSnapshotJSONSerializerIterator;
1023
1024 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer);
1025 };
1026
979 } } // namespace v8::internal 1027 } } // namespace v8::internal
980 1028
981 #endif // ENABLE_LOGGING_AND_PROFILING 1029 #endif // ENABLE_LOGGING_AND_PROFILING
982 1030
983 #endif // V8_PROFILE_GENERATOR_H_ 1031 #endif // V8_PROFILE_GENERATOR_H_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698