2015-08-21 12:40:22 +00:00
|
|
|
// Copyright 2015 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2015-12-09 11:25:26 +00:00
|
|
|
#ifndef HEAP_HEAP_TESTER_H_
|
|
|
|
#define HEAP_HEAP_TESTER_H_
|
2015-08-21 12:40:22 +00:00
|
|
|
|
|
|
|
#include "src/heap/spaces.h"
|
|
|
|
|
|
|
|
// Tests that should have access to private methods of {v8::internal::Heap}.
|
|
|
|
// Those tests need to be defined using HEAP_TEST(Name) { ... }.
|
2015-12-16 14:06:33 +00:00
|
|
|
#define HEAP_TEST_METHODS(V) \
|
|
|
|
V(CompactionFullAbortedPage) \
|
|
|
|
V(CompactionPartiallyAbortedPage) \
|
|
|
|
V(CompactionPartiallyAbortedPageIntraAbortedPointers) \
|
|
|
|
V(CompactionPartiallyAbortedPageWithStoreBufferEntries) \
|
|
|
|
V(CompactionSpaceDivideMultiplePages) \
|
|
|
|
V(CompactionSpaceDivideSinglePage) \
|
2017-08-02 17:27:11 +00:00
|
|
|
V(InvalidatedSlotsAfterTrimming) \
|
|
|
|
V(InvalidatedSlotsAllInvalidatedRanges) \
|
|
|
|
V(InvalidatedSlotsEvacuationCandidate) \
|
|
|
|
V(InvalidatedSlotsNoInvalidatedRanges) \
|
2017-08-03 17:58:03 +00:00
|
|
|
V(InvalidatedSlotsResetObjectRegression) \
|
2017-08-02 17:27:11 +00:00
|
|
|
V(InvalidatedSlotsSomeInvalidatedRanges) \
|
2016-08-04 08:12:40 +00:00
|
|
|
V(TestNewSpaceRefsInCopiedCode) \
|
2015-12-16 14:06:33 +00:00
|
|
|
V(GCFlags) \
|
|
|
|
V(MarkCompactCollector) \
|
|
|
|
V(NoPromotion) \
|
|
|
|
V(NumberStringCacheSize) \
|
|
|
|
V(ObjectGroups) \
|
|
|
|
V(Promotion) \
|
|
|
|
V(Regression39128) \
|
|
|
|
V(ResetWeakHandle) \
|
|
|
|
V(StressHandles) \
|
|
|
|
V(TestMemoryReducerSampleJsCalls) \
|
|
|
|
V(TestSizeOfObjects) \
|
2016-02-17 11:52:31 +00:00
|
|
|
V(Regress587004) \
|
2016-09-28 17:51:48 +00:00
|
|
|
V(Regress538257) \
|
2016-02-25 17:28:50 +00:00
|
|
|
V(Regress589413) \
|
2016-10-25 15:33:56 +00:00
|
|
|
V(Regress658718) \
|
2016-12-06 14:06:10 +00:00
|
|
|
V(Regress670675) \
|
2017-01-17 14:19:58 +00:00
|
|
|
V(Regress5831) \
|
2017-05-29 15:03:50 +00:00
|
|
|
V(RegressMissingWriteBarrierInAllocate) \
|
2015-08-21 12:40:22 +00:00
|
|
|
V(WriteBarriersInCopyJSObject)
|
|
|
|
|
|
|
|
#define HEAP_TEST(Name) \
|
|
|
|
CcTest register_test_##Name(v8::internal::HeapTester::Test##Name, __FILE__, \
|
2016-03-02 13:12:59 +00:00
|
|
|
#Name, true, true); \
|
2015-08-21 12:40:22 +00:00
|
|
|
void v8::internal::HeapTester::Test##Name()
|
|
|
|
|
2016-10-25 15:33:56 +00:00
|
|
|
#define UNINITIALIZED_HEAP_TEST(Name) \
|
|
|
|
CcTest register_test_##Name(v8::internal::HeapTester::Test##Name, __FILE__, \
|
|
|
|
#Name, true, false); \
|
|
|
|
void v8::internal::HeapTester::Test##Name()
|
|
|
|
|
2015-08-21 12:40:22 +00:00
|
|
|
#define THREADED_HEAP_TEST(Name) \
|
|
|
|
RegisterThreadedTest register_##Name(v8::internal::HeapTester::Test##Name, \
|
|
|
|
#Name); \
|
|
|
|
/* */ HEAP_TEST(Name)
|
|
|
|
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2017-01-27 13:53:13 +00:00
|
|
|
template <typename T>
|
|
|
|
class Handle;
|
|
|
|
|
2015-08-21 12:40:22 +00:00
|
|
|
class HeapTester {
|
|
|
|
public:
|
|
|
|
#define DECLARE_STATIC(Name) static void Test##Name();
|
|
|
|
|
|
|
|
HEAP_TEST_METHODS(DECLARE_STATIC)
|
|
|
|
#undef HEAP_TEST_METHODS
|
|
|
|
|
2017-08-02 17:27:11 +00:00
|
|
|
// test-alloc.cc
|
2015-08-21 12:40:22 +00:00
|
|
|
static AllocationResult AllocateAfterFailures();
|
|
|
|
static Handle<Object> TestAllocateAfterFailures();
|
|
|
|
|
2017-08-02 17:27:11 +00:00
|
|
|
// test-invalidated-slots.cc
|
|
|
|
static Page* AllocateByteArraysOnPage(Heap* heap,
|
|
|
|
std::vector<ByteArray*>* byte_arrays);
|
|
|
|
|
|
|
|
// test-api.cc
|
2015-08-21 12:40:22 +00:00
|
|
|
static void ResetWeakHandle(bool global_gc);
|
|
|
|
};
|
2015-09-30 13:46:56 +00:00
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|
2015-08-21 12:40:22 +00:00
|
|
|
|
2015-12-09 11:25:26 +00:00
|
|
|
#endif // HEAP_HEAP_TESTER_H_
|