diff options
Diffstat (limited to 'deps/v8/src/profiler/heap-profiler.cc')
-rw-r--r-- | deps/v8/src/profiler/heap-profiler.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/deps/v8/src/profiler/heap-profiler.cc b/deps/v8/src/profiler/heap-profiler.cc index a912c2e1b2..472dbdbb10 100644 --- a/deps/v8/src/profiler/heap-profiler.cc +++ b/deps/v8/src/profiler/heap-profiler.cc @@ -173,7 +173,8 @@ void HeapProfiler::UpdateObjectSizeEvent(Address addr, int size) { Handle<HeapObject> HeapProfiler::FindHeapObjectById(SnapshotObjectId id) { HeapObject object; - CombinedHeapIterator iterator(heap(), HeapIterator::kFilterUnreachable); + CombinedHeapObjectIterator iterator(heap(), + HeapObjectIterator::kFilterUnreachable); // Make sure that object with the given id is still reachable. for (HeapObject obj = iterator.Next(); !obj.is_null(); obj = iterator.Next()) { @@ -202,10 +203,21 @@ Isolate* HeapProfiler::isolate() const { return heap()->isolate(); } void HeapProfiler::QueryObjects(Handle<Context> context, debug::QueryObjectPredicate* predicate, PersistentValueVector<v8::Object>* objects) { + { + CombinedHeapObjectIterator function_heap_iterator( + heap(), HeapObjectIterator::kFilterUnreachable); + for (HeapObject heap_obj = function_heap_iterator.Next(); + !heap_obj.is_null(); heap_obj = function_heap_iterator.Next()) { + if (heap_obj.IsFeedbackVector()) { + FeedbackVector::cast(heap_obj).ClearSlots(isolate()); + } + } + } // We should return accurate information about live objects, so we need to // collect all garbage first. heap()->CollectAllAvailableGarbage(GarbageCollectionReason::kHeapProfiler); - CombinedHeapIterator heap_iterator(heap()); + CombinedHeapObjectIterator heap_iterator( + heap(), HeapObjectIterator::kFilterUnreachable); for (HeapObject heap_obj = heap_iterator.Next(); !heap_obj.is_null(); heap_obj = heap_iterator.Next()) { if (!heap_obj.IsJSObject() || heap_obj.IsExternal(isolate())) continue; |