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 "hashmap.h" | 10 #include "hashmap.h" |
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 const v8::HeapGraphNode* global_object = | 1651 const v8::HeapGraphNode* global_object = |
1652 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); | 1652 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); |
1653 CHECK_NE(NULL, global_object); | 1653 CHECK_NE(NULL, global_object); |
1654 const v8::HeapGraphNode* properties = | 1654 const v8::HeapGraphNode* properties = |
1655 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); | 1655 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); |
1656 CHECK_EQ(NULL, properties); | 1656 CHECK_EQ(NULL, properties); |
1657 const v8::HeapGraphNode* elements = | 1657 const v8::HeapGraphNode* elements = |
1658 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); | 1658 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); |
1659 CHECK_EQ(NULL, elements); | 1659 CHECK_EQ(NULL, elements); |
1660 } | 1660 } |
| 1661 |
| 1662 |
| 1663 TEST(MapHasDescriptorsAndTransitions) { |
| 1664 v8::HandleScope scope; |
| 1665 LocalContext env; |
| 1666 CompileRun("obj = { a: 10 };\n"); |
| 1667 const v8::HeapSnapshot* snapshot = |
| 1668 v8::HeapProfiler::TakeSnapshot(v8_str("snapshot")); |
| 1669 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
| 1670 const v8::HeapGraphNode* global_object = |
| 1671 GetProperty(global, v8::HeapGraphEdge::kProperty, "obj"); |
| 1672 CHECK_NE(NULL, global_object); |
| 1673 const v8::HeapGraphNode* map = |
| 1674 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "map"); |
| 1675 CHECK_NE(NULL, map); |
| 1676 const v8::HeapGraphNode* descriptors = |
| 1677 GetProperty(map, v8::HeapGraphEdge::kInternal, "descriptors"); |
| 1678 CHECK_NE(NULL, descriptors); |
| 1679 const v8::HeapGraphNode* transitions = |
| 1680 GetProperty(map, v8::HeapGraphEdge::kInternal, "transitions"); |
| 1681 CHECK_NE(NULL, transitions); |
| 1682 } |
OLD | NEW |