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

Unified Diff: src/profile-generator.cc

Issue 9316092: Heap profiler should report implicit references (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 side-by-side diff with in-line comments
Download patch
Index: src/profile-generator.cc
===================================================================
--- src/profile-generator.cc (revision 10596)
+++ src/profile-generator.cc (working copy)
@@ -2782,6 +2782,27 @@
embedder_queried_ = true;
}
+void NativeObjectsExplorer::FillImplicitReferences() {
+ Isolate* isolate = Isolate::Current();
+ List<ImplicitRefGroup*>* groups =
+ isolate->global_handles()->implicit_ref_groups();
+ for (int i = 0; i < groups->length(); ++i) {
+ ImplicitRefGroup* group = groups->at(i);
+ HeapObject* parent = *group->parent_;
+ HeapEntry* parent_entry = filler_->FindOrAddEntry(parent, this);
+ ASSERT(parent_entry != NULL);
+ Object*** children = group->children_;
+ for (size_t j = 0; j < group->length_; ++j) {
+ Object* child = *children[j];
+ HeapEntry* child_entry = filler_->FindOrAddEntry(child, this);
+ filler_->SetNamedReference(
+ HeapGraphEdge::kInternal,
+ parent, parent_entry,
+ "native",
mnaganov (inactive) 2012/02/03 13:57:19 Does this look descriptive enough? If implicit ref
yurys 2012/02/03 14:09:26 For now it seems good enough. We cannot assume tha
+ child, child_entry);
+ }
+ }
+}
List<HeapObject*>* NativeObjectsExplorer::GetListMaybeDisposeInfo(
v8::RetainedObjectInfo* info) {
@@ -2798,9 +2819,13 @@
bool NativeObjectsExplorer::IterateAndExtractReferences(
SnapshotFillerInterface* filler) {
- if (EstimateObjectsCount() <= 0) return true;
filler_ = filler;
FillRetainedObjects();
+ FillImplicitReferences();
+ if (EstimateObjectsCount() <= 0) {
mnaganov (inactive) 2012/02/03 13:57:19 Let's rewrite this as follows to avoid cleanup cod
yurys 2012/02/03 14:09:26 Done.
+ filler_ = NULL;
+ return true;
+ }
for (HashMap::Entry* p = objects_by_info_.Start();
p != NULL;
p = objects_by_info_.Next(p)) {

Powered by Google App Engine
This is Rietveld 408576698