OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Tests for heap profiler | 3 // Tests for heap profiler |
4 | 4 |
5 #include <ctype.h> | 5 #include <ctype.h> |
6 | 6 |
7 #include "v8.h" | 7 #include "v8.h" |
8 | 8 |
9 #include "cctest.h" | 9 #include "cctest.h" |
10 #include "heap-profiler.h" | 10 #include "heap-profiler.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 if (strcmp(entry->name(), "C2") == 0) has_C2 = true; | 27 if (strcmp(entry->name(), "C2") == 0) has_C2 = true; |
28 } | 28 } |
29 | 29 |
30 void CheckAllReachables(i::HeapEntry* root) { | 30 void CheckAllReachables(i::HeapEntry* root) { |
31 i::List<i::HeapEntry*> list(10); | 31 i::List<i::HeapEntry*> list(10); |
32 list.Add(root); | 32 list.Add(root); |
33 root->paint(); | 33 root->paint(); |
34 CheckEntry(root); | 34 CheckEntry(root); |
35 while (!list.is_empty()) { | 35 while (!list.is_empty()) { |
36 i::HeapEntry* entry = list.RemoveLast(); | 36 i::HeapEntry* entry = list.RemoveLast(); |
37 i::Vector<i::HeapGraphEdge> children = entry->children(); | 37 i::Vector<i::HeapGraphEdge*> children = entry->children(); |
38 for (int i = 0; i < children.length(); ++i) { | 38 for (int i = 0; i < children.length(); ++i) { |
39 if (children[i].type() == i::HeapGraphEdge::kShortcut) continue; | 39 if (children[i]->type() == i::HeapGraphEdge::kShortcut) continue; |
40 i::HeapEntry* child = children[i].to(); | 40 i::HeapEntry* child = children[i]->to(); |
41 if (!child->painted()) { | 41 if (!child->painted()) { |
42 list.Add(child); | 42 list.Add(child); |
43 child->paint(); | 43 child->paint(); |
44 CheckEntry(child); | 44 CheckEntry(child); |
45 } | 45 } |
46 } | 46 } |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 bool has_A2; | 50 bool has_A2; |
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 const v8::HeapGraphNode* global_object = | 1657 const v8::HeapGraphNode* global_object = |
1658 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); | 1658 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); |
1659 CHECK_NE(NULL, global_object); | 1659 CHECK_NE(NULL, global_object); |
1660 const v8::HeapGraphNode* properties = | 1660 const v8::HeapGraphNode* properties = |
1661 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); | 1661 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); |
1662 CHECK_EQ(NULL, properties); | 1662 CHECK_EQ(NULL, properties); |
1663 const v8::HeapGraphNode* elements = | 1663 const v8::HeapGraphNode* elements = |
1664 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); | 1664 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); |
1665 CHECK_EQ(NULL, elements); | 1665 CHECK_EQ(NULL, elements); |
1666 } | 1666 } |
OLD | NEW |