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

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

Issue 9190001: Backport @10366 to 3.6 Base URL: http://v8.googlecode.com/svn/branches/3.6/
Patch Set: '' Created 8 years, 11 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
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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 void AddEntry(Address addr, uint64_t id); 728 void AddEntry(Address addr, uint64_t id);
729 uint64_t FindEntry(Address addr); 729 uint64_t FindEntry(Address addr);
730 void RemoveDeadEntries(); 730 void RemoveDeadEntries();
731 731
732 static bool AddressesMatch(void* key1, void* key2) { 732 static bool AddressesMatch(void* key1, void* key2) {
733 return key1 == key2; 733 return key1 == key2;
734 } 734 }
735 735
736 static uint32_t AddressHash(Address addr) { 736 static uint32_t AddressHash(Address addr) {
737 return ComputeIntegerHash( 737 return ComputeIntegerHash(
738 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(addr))); 738 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(addr)),
739 v8::internal::kZeroHashSeed);
739 } 740 }
740 741
741 bool initial_fill_mode_; 742 bool initial_fill_mode_;
742 uint64_t next_id_; 743 uint64_t next_id_;
743 HashMap entries_map_; 744 HashMap entries_map_;
744 List<EntryInfo>* entries_; 745 List<EntryInfo>* entries_;
745 746
746 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap); 747 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap);
747 }; 748 };
748 749
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 retainers_count(0) { 830 retainers_count(0) {
830 } 831 }
831 HeapEntry* entry; 832 HeapEntry* entry;
832 HeapEntriesAllocator* allocator; 833 HeapEntriesAllocator* allocator;
833 int children_count; 834 int children_count;
834 int retainers_count; 835 int retainers_count;
835 }; 836 };
836 837
837 static uint32_t Hash(HeapThing thing) { 838 static uint32_t Hash(HeapThing thing) {
838 return ComputeIntegerHash( 839 return ComputeIntegerHash(
839 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(thing))); 840 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(thing)),
841 v8::internal::kZeroHashSeed);
840 } 842 }
841 static bool HeapThingsMatch(HeapThing key1, HeapThing key2) { 843 static bool HeapThingsMatch(HeapThing key1, HeapThing key2) {
842 return key1 == key2; 844 return key1 == key2;
843 } 845 }
844 846
845 HashMap entries_; 847 HashMap entries_;
846 int entries_count_; 848 int entries_count_;
847 int total_children_count_; 849 int total_children_count_;
848 int total_retainers_count_; 850 int total_retainers_count_;
849 851
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 private: 1013 private:
1012 void FillRetainedObjects(); 1014 void FillRetainedObjects();
1013 List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info); 1015 List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info);
1014 void SetNativeRootReference(v8::RetainedObjectInfo* info); 1016 void SetNativeRootReference(v8::RetainedObjectInfo* info);
1015 void SetRootNativesRootReference(); 1017 void SetRootNativesRootReference();
1016 void SetWrapperNativeReferences(HeapObject* wrapper, 1018 void SetWrapperNativeReferences(HeapObject* wrapper,
1017 v8::RetainedObjectInfo* info); 1019 v8::RetainedObjectInfo* info);
1018 void VisitSubtreeWrapper(Object** p, uint16_t class_id); 1020 void VisitSubtreeWrapper(Object** p, uint16_t class_id);
1019 1021
1020 static uint32_t InfoHash(v8::RetainedObjectInfo* info) { 1022 static uint32_t InfoHash(v8::RetainedObjectInfo* info) {
1021 return ComputeIntegerHash(static_cast<uint32_t>(info->GetHash())); 1023 return ComputeIntegerHash(static_cast<uint32_t>(info->GetHash()),
1024 v8::internal::kZeroHashSeed);
1022 } 1025 }
1023 static bool RetainedInfosMatch(void* key1, void* key2) { 1026 static bool RetainedInfosMatch(void* key1, void* key2) {
1024 return key1 == key2 || 1027 return key1 == key2 ||
1025 (reinterpret_cast<v8::RetainedObjectInfo*>(key1))->IsEquivalent( 1028 (reinterpret_cast<v8::RetainedObjectInfo*>(key1))->IsEquivalent(
1026 reinterpret_cast<v8::RetainedObjectInfo*>(key2)); 1029 reinterpret_cast<v8::RetainedObjectInfo*>(key2));
1027 } 1030 }
1028 1031
1029 HeapSnapshot* snapshot_; 1032 HeapSnapshot* snapshot_;
1030 HeapSnapshotsCollection* collection_; 1033 HeapSnapshotsCollection* collection_;
1031 SnapshottingProgressReportingInterface* progress_; 1034 SnapshottingProgressReportingInterface* progress_;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 } 1092 }
1090 void Serialize(v8::OutputStream* stream); 1093 void Serialize(v8::OutputStream* stream);
1091 1094
1092 private: 1095 private:
1093 INLINE(static bool ObjectsMatch(void* key1, void* key2)) { 1096 INLINE(static bool ObjectsMatch(void* key1, void* key2)) {
1094 return key1 == key2; 1097 return key1 == key2;
1095 } 1098 }
1096 1099
1097 INLINE(static uint32_t ObjectHash(const void* key)) { 1100 INLINE(static uint32_t ObjectHash(const void* key)) {
1098 return ComputeIntegerHash( 1101 return ComputeIntegerHash(
1099 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key))); 1102 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)),
1103 v8::internal::kZeroHashSeed);
1100 } 1104 }
1101 1105
1102 void EnumerateNodes(); 1106 void EnumerateNodes();
1103 HeapSnapshot* CreateFakeSnapshot(); 1107 HeapSnapshot* CreateFakeSnapshot();
1104 int GetNodeId(HeapEntry* entry); 1108 int GetNodeId(HeapEntry* entry);
1105 int GetStringId(const char* s); 1109 int GetStringId(const char* s);
1106 void SerializeEdge(HeapGraphEdge* edge); 1110 void SerializeEdge(HeapGraphEdge* edge);
1107 void SerializeImpl(); 1111 void SerializeImpl();
1108 void SerializeNode(HeapEntry* entry); 1112 void SerializeNode(HeapEntry* entry);
1109 void SerializeNodes(); 1113 void SerializeNodes();
(...skipping 13 matching lines...) Expand all
1123 1127
1124 friend class HeapSnapshotJSONSerializerEnumerator; 1128 friend class HeapSnapshotJSONSerializerEnumerator;
1125 friend class HeapSnapshotJSONSerializerIterator; 1129 friend class HeapSnapshotJSONSerializerIterator;
1126 1130
1127 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); 1131 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer);
1128 }; 1132 };
1129 1133
1130 } } // namespace v8::internal 1134 } } // namespace v8::internal
1131 1135
1132 #endif // V8_PROFILE_GENERATOR_H_ 1136 #endif // V8_PROFILE_GENERATOR_H_
OLDNEW
« src/objects.h ('K') | « src/objects-inl.h ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698