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_TESTER_H_ | 5 #ifndef HEAP_TESTER_H_ |
6 #define HEAP_TESTER_H_ | 6 #define HEAP_TESTER_H_ |
7 | 7 |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 | 10 |
11 // Tests that should have access to private methods of {v8::internal::Heap}. | 11 // Tests that should have access to private methods of {v8::internal::Heap}. |
12 // Those tests need to be defined using HEAP_TEST(Name) { ... }. | 12 // Those tests need to be defined using HEAP_TEST(Name) { ... }. |
13 #define HEAP_TEST_METHODS(V) \ | 13 #define HEAP_TEST_METHODS(V) \ |
14 V(GCFlags) \ | 14 V(CompactionSpaceDivideMultiplePages) \ |
15 V(MarkCompactCollector) \ | 15 V(CompactionSpaceDivideSinglePage) \ |
16 V(NoPromotion) \ | 16 V(GCFlags) \ |
17 V(NumberStringCacheSize) \ | 17 V(MarkCompactCollector) \ |
18 V(ObjectGroups) \ | 18 V(NoPromotion) \ |
19 V(Promotion) \ | 19 V(NumberStringCacheSize) \ |
20 V(Regression39128) \ | 20 V(ObjectGroups) \ |
21 V(ResetWeakHandle) \ | 21 V(Promotion) \ |
22 V(StressHandles) \ | 22 V(Regression39128) \ |
23 V(TestSizeOfObjects) \ | 23 V(ResetWeakHandle) \ |
| 24 V(StressHandles) \ |
| 25 V(TestSizeOfObjects) \ |
24 V(WriteBarriersInCopyJSObject) | 26 V(WriteBarriersInCopyJSObject) |
25 | 27 |
26 | 28 |
27 #define HEAP_TEST(Name) \ | 29 #define HEAP_TEST(Name) \ |
28 CcTest register_test_##Name(v8::internal::HeapTester::Test##Name, __FILE__, \ | 30 CcTest register_test_##Name(v8::internal::HeapTester::Test##Name, __FILE__, \ |
29 #Name, NULL, true, true); \ | 31 #Name, NULL, true, true); \ |
30 void v8::internal::HeapTester::Test##Name() | 32 void v8::internal::HeapTester::Test##Name() |
31 | 33 |
32 | 34 |
33 #define THREADED_HEAP_TEST(Name) \ | 35 #define THREADED_HEAP_TEST(Name) \ |
(...skipping 11 matching lines...) Expand all Loading... |
45 | 47 |
46 HEAP_TEST_METHODS(DECLARE_STATIC) | 48 HEAP_TEST_METHODS(DECLARE_STATIC) |
47 #undef HEAP_TEST_METHODS | 49 #undef HEAP_TEST_METHODS |
48 | 50 |
49 /* test-alloc.cc */ | 51 /* test-alloc.cc */ |
50 static AllocationResult AllocateAfterFailures(); | 52 static AllocationResult AllocateAfterFailures(); |
51 static Handle<Object> TestAllocateAfterFailures(); | 53 static Handle<Object> TestAllocateAfterFailures(); |
52 | 54 |
53 /* test-api.cc */ | 55 /* test-api.cc */ |
54 static void ResetWeakHandle(bool global_gc); | 56 static void ResetWeakHandle(bool global_gc); |
| 57 |
| 58 /* test-spaces.cc */ |
| 59 static CompactionSpaceCollection** InitializeCompactionSpaces(Heap* heap, |
| 60 int num_spaces); |
| 61 static void DestroyCompactionSpaces(CompactionSpaceCollection** spaces, |
| 62 int num_spaces); |
| 63 static void MergeCompactionSpaces(PagedSpace* space, |
| 64 CompactionSpaceCollection** spaces, |
| 65 int num_spaces); |
| 66 static void AllocateInCompactionSpaces(CompactionSpaceCollection** spaces, |
| 67 AllocationSpace id, int num_spaces, |
| 68 int num_objects, int object_size); |
| 69 static void CompactionStats(CompactionSpaceCollection** spaces, |
| 70 AllocationSpace id, int num_spaces, |
| 71 intptr_t* capacity, intptr_t* size); |
| 72 static void TestCompactionSpaceDivide(int num_additional_objects, |
| 73 int object_size, |
| 74 int num_compaction_spaces, |
| 75 int additional_capacity_in_bytes); |
55 }; | 76 }; |
56 | 77 |
57 } // namespace internal | 78 } // namespace internal |
58 } // namespace v8 | 79 } // namespace v8 |
59 | 80 |
60 #endif // HEAP_TESTER_H_ | 81 #endif // HEAP_TESTER_H_ |
OLD | NEW |