OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Tests for heap profiler | 3 // Tests for heap profiler |
4 | 4 |
5 #ifdef ENABLE_LOGGING_AND_PROFILING | 5 #ifdef ENABLE_LOGGING_AND_PROFILING |
6 | 6 |
7 #include "v8.h" | 7 #include "v8.h" |
8 #include "heap-profiler.h" | 8 #include "heap-profiler.h" |
9 #include "string-stream.h" | 9 #include "string-stream.h" |
10 #include "cctest.h" | 10 #include "cctest.h" |
| 11 #include "zone-inl.h" |
11 | 12 |
12 namespace i = v8::internal; | 13 namespace i = v8::internal; |
13 using i::ClustersCoarser; | 14 using i::ClustersCoarser; |
14 using i::JSObjectsCluster; | 15 using i::JSObjectsCluster; |
15 using i::JSObjectsRetainerTree; | 16 using i::JSObjectsRetainerTree; |
16 using i::JSObjectsClusterTree; | 17 using i::JSObjectsClusterTree; |
17 using i::RetainerHeapProfile; | 18 using i::RetainerHeapProfile; |
18 | 19 |
19 | 20 |
20 static void CompileAndRunScript(const char *src) { | 21 static void CompileAndRunScript(const char *src) { |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 CHECK_EQ(i::StrLength("(global property);1,B;2,C;2"), | 384 CHECK_EQ(i::StrLength("(global property);1,B;2,C;2"), |
384 i::StrLength(retainers_of_a)); | 385 i::StrLength(retainers_of_a)); |
385 CHECK(strstr(retainers_of_a, "(global property);1") != NULL); | 386 CHECK(strstr(retainers_of_a, "(global property);1") != NULL); |
386 CHECK(strstr(retainers_of_a, "B;2") != NULL); | 387 CHECK(strstr(retainers_of_a, "B;2") != NULL); |
387 CHECK(strstr(retainers_of_a, "C;2") != NULL); | 388 CHECK(strstr(retainers_of_a, "C;2") != NULL); |
388 CHECK_EQ("(global property);2", printer.GetRetainers("B")); | 389 CHECK_EQ("(global property);2", printer.GetRetainers("B")); |
389 CHECK_EQ("(global property);1", printer.GetRetainers("C")); | 390 CHECK_EQ("(global property);1", printer.GetRetainers("C")); |
390 } | 391 } |
391 | 392 |
392 #endif // ENABLE_LOGGING_AND_PROFILING | 393 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |