#include "src/heap/heap-allocator.h"
#include "src/base/logging.h"
#include "src/common/globals.h"
#include "src/execution/isolate.h"
#include "src/heap/heap-allocator-inl.h"
#include "src/heap/heap-inl.h"
#include "src/logging/counters.h"
namespace v8 {
namespace internal {
class Heap;
HeapAllocator::HeapAllocator(LocalHeap* local_heap)
: … { … }
void HeapAllocator::Setup(LinearAllocationArea* new_allocation_info,
LinearAllocationArea* old_allocation_info) { … }
void HeapAllocator::SetReadOnlySpace(ReadOnlySpace* read_only_space) { … }
AllocationResult HeapAllocator::AllocateRawLargeInternal(
int size_in_bytes, AllocationType allocation, AllocationOrigin origin,
AllocationAlignment alignment) { … }
namespace {
constexpr AllocationSpace AllocationTypeToGCSpace(AllocationType type) { … }
}
AllocationResult HeapAllocator::AllocateRawWithLightRetrySlowPath(
int size, AllocationType allocation, AllocationOrigin origin,
AllocationAlignment alignment) { … }
void HeapAllocator::CollectGarbage(AllocationType allocation) { … }
AllocationResult HeapAllocator::AllocateRawWithRetryOrFailSlowPath(
int size, AllocationType allocation, AllocationOrigin origin,
AllocationAlignment alignment) { … }
void HeapAllocator::CollectAllAvailableGarbage(AllocationType allocation) { … }
AllocationResult HeapAllocator::RetryAllocateRaw(
int size_in_bytes, AllocationType allocation, AllocationOrigin origin,
AllocationAlignment alignment) { … }
void HeapAllocator::MakeLinearAllocationAreasIterable() { … }
#if DEBUG
void HeapAllocator::VerifyLinearAllocationAreas() const { … }
#endif
void HeapAllocator::MarkLinearAllocationAreasBlack() { … }
void HeapAllocator::UnmarkLinearAllocationsArea() { … }
void HeapAllocator::MarkSharedLinearAllocationAreasBlack() { … }
void HeapAllocator::UnmarkSharedLinearAllocationAreas() { … }
void HeapAllocator::FreeLinearAllocationAreas() { … }
void HeapAllocator::PublishPendingAllocations() { … }
void HeapAllocator::AddAllocationObserver(
AllocationObserver* observer, AllocationObserver* new_space_observer) { … }
void HeapAllocator::RemoveAllocationObserver(
AllocationObserver* observer, AllocationObserver* new_space_observer) { … }
void HeapAllocator::PauseAllocationObservers() { … }
void HeapAllocator::ResumeAllocationObservers() { … }
#ifdef DEBUG
void HeapAllocator::IncrementObjectCounters() { … }
#endif
#ifdef V8_ENABLE_ALLOCATION_TIMEOUT
void HeapAllocator::InitializeOncePerProcess() { … }
void HeapAllocator::SetAllocationGcInterval(int allocation_gc_interval) { … }
std::atomic<int> HeapAllocator::allocation_gc_interval_{ … };
void HeapAllocator::SetAllocationTimeout(int allocation_timeout) { … }
void HeapAllocator::UpdateAllocationTimeout() { … }
bool HeapAllocator::ReachedAllocationTimeout() { … }
#endif
}
}