| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 CHECK_NE(NULL, array_node); | 387 CHECK_NE(NULL, array_node); |
| 388 int wrong_count = 0; | 388 int wrong_count = 0; |
| 389 for (int i = 0, count = array_node->GetChildrenCount(); i < count; ++i) { | 389 for (int i = 0, count = array_node->GetChildrenCount(); i < count; ++i) { |
| 390 const v8::HeapGraphEdge* prop = array_node->GetChild(i); | 390 const v8::HeapGraphEdge* prop = array_node->GetChild(i); |
| 391 if (prop->GetType() != v8::HeapGraphEdge::kElement) | 391 if (prop->GetType() != v8::HeapGraphEdge::kElement) |
| 392 continue; | 392 continue; |
| 393 v8::SnapshotObjectId id = prop->GetToNode()->GetId(); | 393 v8::SnapshotObjectId id = prop->GetToNode()->GetId(); |
| 394 if (id < maxId1) | 394 if (id < maxId1) |
| 395 ++wrong_count; | 395 ++wrong_count; |
| 396 } | 396 } |
| 397 // FIXME: Object ids should be unique but it is not so at the moment. | 397 CHECK_EQ(0, wrong_count); |
| 398 CHECK_NE(0, wrong_count); | |
| 399 } | 398 } |
| 400 | 399 |
| 401 | 400 |
| 402 TEST(HeapEntryIdsAndArrayShift) { | 401 TEST(HeapEntryIdsAndArrayShift) { |
| 403 v8::HandleScope scope; | 402 v8::HandleScope scope; |
| 404 LocalContext env; | 403 LocalContext env; |
| 405 | 404 |
| 406 CompileRun( | 405 CompileRun( |
| 407 "function AnObject() {\n" | 406 "function AnObject() {\n" |
| 408 " this.first = 'first';\n" | 407 " this.first = 'first';\n" |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 const v8::HeapGraphNode* map = | 1693 const v8::HeapGraphNode* map = |
| 1695 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "map"); | 1694 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "map"); |
| 1696 CHECK_NE(NULL, map); | 1695 CHECK_NE(NULL, map); |
| 1697 const v8::HeapGraphNode* own_descriptors = GetProperty( | 1696 const v8::HeapGraphNode* own_descriptors = GetProperty( |
| 1698 map, v8::HeapGraphEdge::kInternal, "descriptors"); | 1697 map, v8::HeapGraphEdge::kInternal, "descriptors"); |
| 1699 CHECK_NE(NULL, own_descriptors); | 1698 CHECK_NE(NULL, own_descriptors); |
| 1700 const v8::HeapGraphNode* own_transitions = GetProperty( | 1699 const v8::HeapGraphNode* own_transitions = GetProperty( |
| 1701 map, v8::HeapGraphEdge::kInternal, "transitions"); | 1700 map, v8::HeapGraphEdge::kInternal, "transitions"); |
| 1702 CHECK_EQ(NULL, own_transitions); | 1701 CHECK_EQ(NULL, own_transitions); |
| 1703 } | 1702 } |
| OLD | NEW |