#ifndef HEAP_HEAP_UTILS_H_
#define HEAP_HEAP_UTILS_H_
#include "src/api/api-inl.h"
#include "src/flags/flags.h"
#include "src/heap/heap.h"
#include "test/cctest/cctest.h"
namespace v8::internal {
namespace heap {
void SealCurrentObjects(Heap* heap);
int FixedArrayLenFromSize(int size);
std::vector<Handle<FixedArray>> FillOldSpacePageWithFixedArrays(Heap* heap,
int remainder);
std::vector<Handle<FixedArray>> CreatePadding(
Heap* heap, int padding_size, AllocationType allocation,
int object_size = kMaxRegularHeapObjectSize);
void FillCurrentPage(v8::internal::NewSpace* space,
std::vector<Handle<FixedArray>>* out_handles = nullptr);
void FillCurrentPageButNBytes(
v8::internal::SemiSpaceNewSpace* space, int extra_bytes,
std::vector<Handle<FixedArray>>* out_handles = nullptr);
void SimulateIncrementalMarking(i::Heap* heap, bool force_completion = true);
void SimulateFullSpace(v8::internal::PagedSpace* space);
void AbandonCurrentlyFreeMemory(PagedSpace* space);
void InvokeMajorGC(Heap* heap);
void InvokeMajorGC(Heap* heap, GCFlag gc_flag);
void InvokeMinorGC(Heap* heap);
void InvokeAtomicMajorGC(Heap* heap);
void InvokeAtomicMinorGC(Heap* heap);
void InvokeMemoryReducingMajorGCs(Heap* heap);
void CollectSharedGarbage(Heap* heap);
void EmptyNewSpaceUsingGC(Heap* heap);
void ForceEvacuationCandidate(PageMetadata* page);
void GrowNewSpace(Heap* heap);
void GrowNewSpaceToMaximumCapacity(Heap* heap);
template <typename GlobalOrPersistent>
bool InYoungGeneration(v8::Isolate* isolate, const GlobalOrPersistent& global) { … }
bool InCorrectGeneration(Tagged<HeapObject> object);
template <typename GlobalOrPersistent>
bool InCorrectGeneration(v8::Isolate* isolate,
const GlobalOrPersistent& global) { … }
class ManualEvacuationCandidatesSelectionScope { … };
}
class V8_NODISCARD ManualGCScope final { … };
}
#endif