#ifndef V8_UNITTESTS_HEAP_HEAP_UTILS_H_
#define V8_UNITTESTS_HEAP_HEAP_UTILS_H_
#include "src/base/macros.h"
#include "src/common/globals.h"
#include "src/heap/heap.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
namespace internal {
class HeapInternalsBase { … };
inline void InvokeMajorGC(i::Isolate* isolate) { … }
inline void InvokeMajorGC(i::Isolate* isolate, GCFlag gc_flag) { … }
inline void InvokeMinorGC(i::Isolate* isolate) { … }
inline void InvokeAtomicMajorGC(i::Isolate* isolate) { … }
inline void InvokeAtomicMinorGC(i::Isolate* isolate) { … }
inline void InvokeMemoryReducingMajorGCs(i::Isolate* isolate) { … }
template <typename TMixin>
class WithHeapInternals : public TMixin, HeapInternalsBase { … };
using TestWithHeapInternals =
WithHeapInternals<
WithInternalIsolateMixin<
WithIsolateScopeMixin<
WithIsolateMixin<
WithDefaultPlatformMixin<
::testing::Test>>>>>;
using TestWithHeapInternalsAndContext =
WithContextMixin<
TestWithHeapInternals>;
template <typename GlobalOrPersistent>
bool InYoungGeneration(v8::Isolate* isolate, const GlobalOrPersistent& global) { … }
bool IsNewObjectInCorrectGeneration(Tagged<HeapObject> object);
template <typename GlobalOrPersistent>
bool IsNewObjectInCorrectGeneration(v8::Isolate* isolate,
const GlobalOrPersistent& global) { … }
class V8_NODISCARD ManualGCScope final { … };
class V8_NODISCARD DisableHandleChecksForMockingScope final
: public StackAllocatedCheck::Scope { … };
}
}
#endif