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", |
+ child, child_entry); |
+ } |
+ } |
+} |
List<HeapObject*>* NativeObjectsExplorer::GetListMaybeDisposeInfo( |
v8::RetainedObjectInfo* info) { |
@@ -2798,22 +2819,24 @@ |
bool NativeObjectsExplorer::IterateAndExtractReferences( |
SnapshotFillerInterface* filler) { |
- if (EstimateObjectsCount() <= 0) return true; |
filler_ = filler; |
FillRetainedObjects(); |
- for (HashMap::Entry* p = objects_by_info_.Start(); |
- p != NULL; |
- p = objects_by_info_.Next(p)) { |
- v8::RetainedObjectInfo* info = |
- reinterpret_cast<v8::RetainedObjectInfo*>(p->key); |
- SetNativeRootReference(info); |
- List<HeapObject*>* objects = |
- reinterpret_cast<List<HeapObject*>* >(p->value); |
- for (int i = 0; i < objects->length(); ++i) { |
- SetWrapperNativeReferences(objects->at(i), info); |
+ FillImplicitReferences(); |
+ if (EstimateObjectsCount() > 0) { |
+ for (HashMap::Entry* p = objects_by_info_.Start(); |
+ p != NULL; |
+ p = objects_by_info_.Next(p)) { |
+ v8::RetainedObjectInfo* info = |
+ reinterpret_cast<v8::RetainedObjectInfo*>(p->key); |
+ SetNativeRootReference(info); |
+ List<HeapObject*>* objects = |
+ reinterpret_cast<List<HeapObject*>* >(p->value); |
+ for (int i = 0; i < objects->length(); ++i) { |
+ SetWrapperNativeReferences(objects->at(i), info); |
+ } |
} |
+ SetRootNativeRootsReference(); |
} |
- SetRootNativeRootsReference(); |
filler_ = NULL; |
return true; |
} |