OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef HEAP_HEAP_TESTER_H_ | 5 #ifndef HEAP_HEAP_TESTER_H_ |
6 #define HEAP_HEAP_TESTER_H_ | 6 #define HEAP_HEAP_TESTER_H_ |
7 | 7 |
8 #include "src/handles.h" | |
9 #include "src/heap/spaces.h" | 8 #include "src/heap/spaces.h" |
10 | 9 |
11 // Tests that should have access to private methods of {v8::internal::Heap}. | 10 // Tests that should have access to private methods of {v8::internal::Heap}. |
12 // Those tests need to be defined using HEAP_TEST(Name) { ... }. | 11 // Those tests need to be defined using HEAP_TEST(Name) { ... }. |
13 #define HEAP_TEST_METHODS(V) \ | 12 #define HEAP_TEST_METHODS(V) \ |
14 V(CompactionFullAbortedPage) \ | 13 V(CompactionFullAbortedPage) \ |
15 V(CompactionPartiallyAbortedPage) \ | 14 V(CompactionPartiallyAbortedPage) \ |
16 V(CompactionPartiallyAbortedPageIntraAbortedPointers) \ | 15 V(CompactionPartiallyAbortedPageIntraAbortedPointers) \ |
17 V(CompactionPartiallyAbortedPageWithStoreBufferEntries) \ | 16 V(CompactionPartiallyAbortedPageWithStoreBufferEntries) \ |
18 V(CompactionSpaceDivideMultiplePages) \ | 17 V(CompactionSpaceDivideMultiplePages) \ |
(...skipping 30 matching lines...) Expand all Loading... |
49 | 48 |
50 #define THREADED_HEAP_TEST(Name) \ | 49 #define THREADED_HEAP_TEST(Name) \ |
51 RegisterThreadedTest register_##Name(v8::internal::HeapTester::Test##Name, \ | 50 RegisterThreadedTest register_##Name(v8::internal::HeapTester::Test##Name, \ |
52 #Name); \ | 51 #Name); \ |
53 /* */ HEAP_TEST(Name) | 52 /* */ HEAP_TEST(Name) |
54 | 53 |
55 | 54 |
56 namespace v8 { | 55 namespace v8 { |
57 namespace internal { | 56 namespace internal { |
58 | 57 |
| 58 template <typename T> |
| 59 class Handle; |
| 60 |
59 class HeapTester { | 61 class HeapTester { |
60 public: | 62 public: |
61 #define DECLARE_STATIC(Name) static void Test##Name(); | 63 #define DECLARE_STATIC(Name) static void Test##Name(); |
62 | 64 |
63 HEAP_TEST_METHODS(DECLARE_STATIC) | 65 HEAP_TEST_METHODS(DECLARE_STATIC) |
64 #undef HEAP_TEST_METHODS | 66 #undef HEAP_TEST_METHODS |
65 | 67 |
66 /* test-alloc.cc */ | 68 /* test-alloc.cc */ |
67 static AllocationResult AllocateAfterFailures(); | 69 static AllocationResult AllocateAfterFailures(); |
68 static Handle<Object> TestAllocateAfterFailures(); | 70 static Handle<Object> TestAllocateAfterFailures(); |
69 | 71 |
70 /* test-api.cc */ | 72 /* test-api.cc */ |
71 static void ResetWeakHandle(bool global_gc); | 73 static void ResetWeakHandle(bool global_gc); |
72 }; | 74 }; |
73 | 75 |
74 } // namespace internal | 76 } // namespace internal |
75 } // namespace v8 | 77 } // namespace v8 |
76 | 78 |
77 #endif // HEAP_HEAP_TESTER_H_ | 79 #endif // HEAP_HEAP_TESTER_H_ |
OLD | NEW |