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

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

Issue 5139002: New heap profiler: include all heap objects and refs into snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years, 1 month 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void CodeMap::DeleteCode(Address addr) { 103 void CodeMap::DeleteCode(Address addr) {
104 tree_.Remove(addr); 104 tree_.Remove(addr);
105 } 105 }
106 106
107 107
108 template<class Visitor> 108 template<class Visitor>
109 void HeapEntriesMap::UpdateEntries(Visitor* visitor) { 109 void HeapEntriesMap::UpdateEntries(Visitor* visitor) {
110 for (HashMap::Entry* p = entries_.Start(); 110 for (HashMap::Entry* p = entries_.Start();
111 p != NULL; 111 p != NULL;
112 p = entries_.Next(p)) { 112 p = entries_.Next(p)) {
113 if (!IsAlias(p->value)) { 113 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value);
114 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value); 114 entry_info->entry = visitor->GetEntry(
115 entry_info->entry = visitor->GetEntry( 115 reinterpret_cast<HeapObject*>(p->key),
116 reinterpret_cast<HeapObject*>(p->key), 116 entry_info->children_count,
117 entry_info->children_count, 117 entry_info->retainers_count);
118 entry_info->retainers_count); 118 entry_info->children_count = 0;
119 entry_info->children_count = 0; 119 entry_info->retainers_count = 0;
120 entry_info->retainers_count = 0;
121 }
122 } 120 }
123 } 121 }
124 122
125 123
126 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { 124 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
127 switch (tag) { 125 switch (tag) {
128 case GC: 126 case GC:
129 return gc_entry_; 127 return gc_entry_;
130 case JS: 128 case JS:
131 case COMPILER: 129 case COMPILER:
132 // DOM events handlers are reported as OTHER / EXTERNAL entries. 130 // DOM events handlers are reported as OTHER / EXTERNAL entries.
133 // To avoid confusing people, let's put all these entries into 131 // To avoid confusing people, let's put all these entries into
134 // one bucket. 132 // one bucket.
135 case OTHER: 133 case OTHER:
136 case EXTERNAL: 134 case EXTERNAL:
137 return program_entry_; 135 return program_entry_;
138 default: return NULL; 136 default: return NULL;
139 } 137 }
140 } 138 }
141 139
142 } } // namespace v8::internal 140 } } // namespace v8::internal
143 141
144 #endif // ENABLE_LOGGING_AND_PROFILING 142 #endif // ENABLE_LOGGING_AND_PROFILING
145 143
146 #endif // V8_PROFILE_GENERATOR_INL_H_ 144 #endif // V8_PROFILE_GENERATOR_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698