OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 // | 27 // |
28 // Tests for heap profiler | 28 // Tests for heap profiler |
29 | 29 |
30 #include <ctype.h> | 30 #include <ctype.h> |
31 | 31 |
32 #include "v8.h" | 32 #include "src/v8.h" |
33 | 33 |
34 #include "allocation-tracker.h" | 34 #include "src/allocation-tracker.h" |
35 #include "cctest.h" | 35 #include "test/cctest/cctest.h" |
36 #include "hashmap.h" | 36 #include "src/hashmap.h" |
37 #include "heap-profiler.h" | 37 #include "src/heap-profiler.h" |
38 #include "snapshot.h" | 38 #include "src/snapshot.h" |
39 #include "debug.h" | 39 #include "src/debug.h" |
40 #include "utils-inl.h" | 40 #include "src/utils-inl.h" |
41 #include "../include/v8-profiler.h" | 41 #include "include/v8-profiler.h" |
42 | 42 |
43 using i::AllocationTraceNode; | 43 using i::AllocationTraceNode; |
44 using i::AllocationTraceTree; | 44 using i::AllocationTraceTree; |
45 using i::AllocationTracker; | 45 using i::AllocationTracker; |
46 using i::HashMap; | 46 using i::HashMap; |
47 using i::Vector; | 47 using i::Vector; |
48 | 48 |
49 namespace { | 49 namespace { |
50 | 50 |
51 class NamedEntriesDetector { | 51 class NamedEntriesDetector { |
(...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2677 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2677 map.AddRange(ToAddress(0x180), 0x80, 6U); |
2678 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2678 map.AddRange(ToAddress(0x180), 0x80, 7U); |
2679 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); | 2679 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); |
2680 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); | 2680 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); |
2681 CHECK_EQ(3, static_cast<int>(map.size())); | 2681 CHECK_EQ(3, static_cast<int>(map.size())); |
2682 | 2682 |
2683 map.Clear(); | 2683 map.Clear(); |
2684 CHECK_EQ(0, static_cast<int>(map.size())); | 2684 CHECK_EQ(0, static_cast<int>(map.size())); |
2685 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); | 2685 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); |
2686 } | 2686 } |
OLD | NEW |