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

Side by Side Diff: src/heap-profiler.cc

Issue 299813002: Revert "Fix Heap::IsHeapIterable." (again) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/heap.cc ('k') | src/heap-snapshot-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 2009-2010 the V8 project authors. All rights reserved. 1 // Copyright 2009-2010 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "heap-profiler.h" 7 #include "heap-profiler.h"
8 8
9 #include "allocation-tracker.h" 9 #include "allocation-tracker.h"
10 #include "heap-snapshot-generator-inl.h" 10 #include "heap-snapshot-generator-inl.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 167
168 void HeapProfiler::SetRetainedObjectInfo(UniqueId id, 168 void HeapProfiler::SetRetainedObjectInfo(UniqueId id,
169 RetainedObjectInfo* info) { 169 RetainedObjectInfo* info) {
170 // TODO(yurus, marja): Don't route this information through GlobalHandles. 170 // TODO(yurus, marja): Don't route this information through GlobalHandles.
171 heap()->isolate()->global_handles()->SetRetainedObjectInfo(id, info); 171 heap()->isolate()->global_handles()->SetRetainedObjectInfo(id, info);
172 } 172 }
173 173
174 174
175 Handle<HeapObject> HeapProfiler::FindHeapObjectById(SnapshotObjectId id) { 175 Handle<HeapObject> HeapProfiler::FindHeapObjectById(SnapshotObjectId id) {
176 heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask,
177 "HeapProfiler::FindHeapObjectById");
178 DisallowHeapAllocation no_allocation;
176 HeapObject* object = NULL; 179 HeapObject* object = NULL;
177 HeapIterator iterator(heap(), HeapIterator::kFilterUnreachable); 180 HeapIterator iterator(heap(), HeapIterator::kFilterUnreachable);
178 // Make sure that object with the given id is still reachable. 181 // Make sure that object with the given id is still reachable.
179 for (HeapObject* obj = iterator.next(); 182 for (HeapObject* obj = iterator.next();
180 obj != NULL; 183 obj != NULL;
181 obj = iterator.next()) { 184 obj = iterator.next()) {
182 if (ids_->FindEntry(obj->address()) == id) { 185 if (ids_->FindEntry(obj->address()) == id) {
183 ASSERT(object == NULL); 186 ASSERT(object == NULL);
184 object = obj; 187 object = obj;
185 // Can't break -- kFilterUnreachable requires full heap traversal. 188 // Can't break -- kFilterUnreachable requires full heap traversal.
186 } 189 }
187 } 190 }
188 return object != NULL ? Handle<HeapObject>(object) : Handle<HeapObject>(); 191 return object != NULL ? Handle<HeapObject>(object) : Handle<HeapObject>();
189 } 192 }
190 193
191 194
192 void HeapProfiler::ClearHeapObjectMap() { 195 void HeapProfiler::ClearHeapObjectMap() {
193 ids_.Reset(new HeapObjectsMap(heap())); 196 ids_.Reset(new HeapObjectsMap(heap()));
194 if (!is_tracking_allocations()) is_tracking_object_moves_ = false; 197 if (!is_tracking_allocations()) is_tracking_object_moves_ = false;
195 } 198 }
196 199
197 200
198 } } // namespace v8::internal 201 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698