diff --git a/src/profiler/heap-snapshot-generator.cc b/src/profiler/heap-snapshot-generator.cc index 436dbe7797..a26c5b6769 100644 --- a/src/profiler/heap-snapshot-generator.cc +++ b/src/profiler/heap-snapshot-generator.cc @@ -635,7 +635,7 @@ HeapEntry* V8HeapExplorer::AddEntry(HeapObject object) { } else if (object.IsContext()) { return AddEntry(object, HeapEntry::kObject, "system / Context"); } else if (object.IsFixedArray() || object.IsFixedDoubleArray() || - object.IsByteArray() || object.IsScopeInfo()) { + object.IsByteArray()) { return AddEntry(object, HeapEntry::kArray, ""); } else if (object.IsHeapNumber()) { return AddEntry(object, HeapEntry::kHeapNumber, "number"); diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc index ed02cd1e37..d84e817051 100644 --- a/test/cctest/test-heap-profiler.cc +++ b/test/cctest/test-heap-profiler.cc @@ -459,12 +459,13 @@ TEST(HeapSnapshotCodeObjects) { // Verify that non-compiled function doesn't contain references to "x" // literal, while compiled function does. The scope info is stored in - // FixedArray objects attached to the SharedFunctionInfo. + // ScopeInfo objects attached to the SharedFunctionInfo. bool compiled_references_x = false, lazy_references_x = false; for (int i = 0, count = compiled_sfi->GetChildrenCount(); i < count; ++i) { const v8::HeapGraphEdge* prop = compiled_sfi->GetChild(i); const v8::HeapGraphNode* node = prop->GetToNode(); - if (node->GetType() == v8::HeapGraphNode::kArray) { + if (node->GetType() == v8::HeapGraphNode::kHidden && + !strcmp("system / ScopeInfo", GetName(node))) { if (HasString(env->GetIsolate(), node, "x")) { compiled_references_x = true; break; @@ -474,7 +475,8 @@ TEST(HeapSnapshotCodeObjects) { for (int i = 0, count = lazy_sfi->GetChildrenCount(); i < count; ++i) { const v8::HeapGraphEdge* prop = lazy_sfi->GetChild(i); const v8::HeapGraphNode* node = prop->GetToNode(); - if (node->GetType() == v8::HeapGraphNode::kArray) { + if (node->GetType() == v8::HeapGraphNode::kHidden && + !strcmp("system / ScopeInfo", GetName(node))) { if (HasString(env->GetIsolate(), node, "x")) { lazy_references_x = true; break;