From: alph@chromium.org Date: Thu, 4 Jul 2013 16:32:18 +0000 (+0000) Subject: Change the type of system root nodes in heap snapshot to kSynthetic X-Git-Tag: upstream/4.7.83~13528 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc97192cb16a89fd6d220f24bf932767130e48ed;p=platform%2Fupstream%2Fv8.git Change the type of system root nodes in heap snapshot to kSynthetic R=mstarzinger@chromium.org, yurys@chromium.org Review URL: https://codereview.chromium.org/18420019 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc index dd8896e..01b3932 100644 --- a/src/heap-snapshot-generator.cc +++ b/src/heap-snapshot-generator.cc @@ -238,7 +238,7 @@ void HeapSnapshot::RememberLastJSObjectId() { HeapEntry* HeapSnapshot::AddRootEntry() { ASSERT(root_index_ == HeapEntry::kNoEntry); ASSERT(entries_.is_empty()); // Root entry must be the first one. - HeapEntry* entry = AddEntry(HeapEntry::kObject, + HeapEntry* entry = AddEntry(HeapEntry::kSynthetic, "", HeapObjectsMap::kInternalRootObjectId, 0); @@ -250,7 +250,7 @@ HeapEntry* HeapSnapshot::AddRootEntry() { HeapEntry* HeapSnapshot::AddGcRootsEntry() { ASSERT(gc_roots_index_ == HeapEntry::kNoEntry); - HeapEntry* entry = AddEntry(HeapEntry::kObject, + HeapEntry* entry = AddEntry(HeapEntry::kSynthetic, "(GC roots)", HeapObjectsMap::kGcRootsObjectId, 0); @@ -263,7 +263,7 @@ HeapEntry* HeapSnapshot::AddGcSubrootEntry(int tag) { ASSERT(gc_subroot_indexes_[tag] == HeapEntry::kNoEntry); ASSERT(0 <= tag && tag < VisitorSynchronization::kNumberOfSyncTags); HeapEntry* entry = AddEntry( - HeapEntry::kObject, + HeapEntry::kSynthetic, VisitorSynchronization::kTagNames[tag], HeapObjectsMap::GetNthGcSubrootId(tag), 0); diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc index afb06fc..5973941 100644 --- a/test/cctest/test-heap-profiler.cc +++ b/test/cctest/test-heap-profiler.cc @@ -1621,10 +1621,10 @@ bool HasWeakGlobalHandle() { const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(v8_str("weaks")); const v8::HeapGraphNode* gc_roots = GetNode( - snapshot->GetRoot(), v8::HeapGraphNode::kObject, "(GC roots)"); + snapshot->GetRoot(), v8::HeapGraphNode::kSynthetic, "(GC roots)"); CHECK_NE(NULL, gc_roots); const v8::HeapGraphNode* global_handles = GetNode( - gc_roots, v8::HeapGraphNode::kObject, "(Global handles)"); + gc_roots, v8::HeapGraphNode::kSynthetic, "(Global handles)"); CHECK_NE(NULL, global_handles); return HasWeakEdge(global_handles); } @@ -1658,10 +1658,10 @@ TEST(WeakNativeContextRefs) { const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(v8_str("weaks")); const v8::HeapGraphNode* gc_roots = GetNode( - snapshot->GetRoot(), v8::HeapGraphNode::kObject, "(GC roots)"); + snapshot->GetRoot(), v8::HeapGraphNode::kSynthetic, "(GC roots)"); CHECK_NE(NULL, gc_roots); const v8::HeapGraphNode* global_handles = GetNode( - gc_roots, v8::HeapGraphNode::kObject, "(Global handles)"); + gc_roots, v8::HeapGraphNode::kSynthetic, "(Global handles)"); CHECK_NE(NULL, global_handles); const v8::HeapGraphNode* native_context = GetNode( global_handles, v8::HeapGraphNode::kHidden, "system / NativeContext"); @@ -1726,10 +1726,10 @@ TEST(AllStrongGcRootsHaveNames) { const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(v8_str("snapshot")); const v8::HeapGraphNode* gc_roots = GetNode( - snapshot->GetRoot(), v8::HeapGraphNode::kObject, "(GC roots)"); + snapshot->GetRoot(), v8::HeapGraphNode::kSynthetic, "(GC roots)"); CHECK_NE(NULL, gc_roots); const v8::HeapGraphNode* strong_roots = GetNode( - gc_roots, v8::HeapGraphNode::kObject, "(Strong roots)"); + gc_roots, v8::HeapGraphNode::kSynthetic, "(Strong roots)"); CHECK_NE(NULL, strong_roots); for (int i = 0; i < strong_roots->GetChildrenCount(); ++i) { const v8::HeapGraphEdge* edge = strong_roots->GetChild(i);