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

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

Issue 5687003: New heap profiler: add support for progress reporting and control. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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/profile-generator.cc ('k') | test/cctest/test-heap-profiler.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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // To avoid confusing people, let's put all these entries into 115 // To avoid confusing people, let's put all these entries into
116 // one bucket. 116 // one bucket.
117 case OTHER: 117 case OTHER:
118 case EXTERNAL: 118 case EXTERNAL:
119 return program_entry_; 119 return program_entry_;
120 default: return NULL; 120 default: return NULL;
121 } 121 }
122 } 122 }
123 123
124 124
125 inline uint64_t HeapEntry::id() { 125 uint64_t HeapEntry::id() {
126 union { 126 union {
127 Id stored_id; 127 Id stored_id;
128 uint64_t returned_id; 128 uint64_t returned_id;
129 } id_adaptor = {id_}; 129 } id_adaptor = {id_};
130 return id_adaptor.returned_id; 130 return id_adaptor.returned_id;
131 } 131 }
132 132
133 133
134 template<class Visitor> 134 template<class Visitor>
135 void HeapEntriesMap::UpdateEntries(Visitor* visitor) { 135 void HeapEntriesMap::UpdateEntries(Visitor* visitor) {
136 for (HashMap::Entry* p = entries_.Start(); 136 for (HashMap::Entry* p = entries_.Start();
137 p != NULL; 137 p != NULL;
138 p = entries_.Next(p)) { 138 p = entries_.Next(p)) {
139 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value); 139 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value);
140 entry_info->entry = visitor->GetEntry( 140 entry_info->entry = visitor->GetEntry(
141 reinterpret_cast<HeapObject*>(p->key), 141 reinterpret_cast<HeapObject*>(p->key),
142 entry_info->children_count, 142 entry_info->children_count,
143 entry_info->retainers_count); 143 entry_info->retainers_count);
144 entry_info->children_count = 0; 144 entry_info->children_count = 0;
145 entry_info->retainers_count = 0; 145 entry_info->retainers_count = 0;
146 } 146 }
147 } 147 }
148 148
149
150 bool HeapSnapshotGenerator::ReportProgress(bool force) {
151 const int kProgressReportGranularity = 10000;
152 if (control_ != NULL
153 && (force || progress_counter_ % kProgressReportGranularity == 0)) {
154 return
155 control_->ReportProgressValue(progress_counter_, progress_total_) ==
156 v8::ActivityControl::kContinue;
157 }
158 return true;
159 }
160
149 } } // namespace v8::internal 161 } } // namespace v8::internal
150 162
151 #endif // ENABLE_LOGGING_AND_PROFILING 163 #endif // ENABLE_LOGGING_AND_PROFILING
152 164
153 #endif // V8_PROFILE_GENERATOR_INL_H_ 165 #endif // V8_PROFILE_GENERATOR_INL_H_
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698