20#ifdef V8_USE_ADDRESS_SANITIZER
22constexpr size_t kASanRedzoneBytes = 24;
26constexpr size_t kASanRedzoneBytes = 0;
33 bool support_compression)
36 supports_compression_(support_compression) {
52 const size_t size_with_redzone = size + kASanRedzoneBytes;
69 return reinterpret_cast<void*
>(
result);
99bool Zone::Contains(
const void* ptr)
const {
102 segment = segment->
next()) {
103 if (address >= segment->start() && address < segment->
end()) {
134#ifdef V8_ENABLE_PRECISE_ZONE_STATS
135 allocation_size_for_tracing_ = 0;
157 const size_t old_size = head ? head->
total_size() : 0;
159 const size_t new_size_no_overhead = size + (old_size << 1);
160 size_t new_size = kSegmentOverhead + new_size_no_overhead;
161 const size_t min_new_size = kSegmentOverhead +
size;
163 if (new_size_no_overhead < size || new_size < kSegmentOverhead) {
175 if (new_size > INT_MAX) {
180 if (segment ==
nullptr) {
204#ifdef V8_ENABLE_PRECISE_ZONE_STATS
205 allocation_size_for_tracing_(zone->allocation_size_for_tracing_),
206 freed_size_for_tracing_(zone->freed_size_for_tracing_),
208 allocation_size_(zone->allocation_size_),
209 segment_bytes_allocated_(zone->segment_bytes_allocated_),
212 segment_head_(zone->segment_head_) {
232 const size_t length = current->end() -
reinterpret_cast<Address>(
start);
242#ifdef V8_ENABLE_PRECISE_ZONE_STATS
243 zone->allocation_size_for_tracing_ = allocation_size_for_tracing_;
244 zone->freed_size_for_tracing_ = freed_size_for_tracing_;
#define ASAN_UNPOISON_MEMORY_REGION(start, size)
#define ASAN_POISON_MEMORY_REGION(start, size)
RegisterAllocator * allocator_
void TraceZoneDestruction(const Zone *zone)
void TraceAllocateSegment(Segment *segment)
void TraceZoneCreation(const Zone *zone)
void ReturnSegment(Segment *memory, bool supports_compression)
Segment * AllocateSegment(size_t bytes, bool supports_compression)
size_t total_size() const
void set_next(Segment *const next)
void set_zone(Zone *const zone)
static V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(Isolate *isolate, const char *location, const OOMDetails &details=kNoOOMDetails)
const size_t allocation_size_
const size_t segment_bytes_allocated_
Segment *const segment_head_
ZoneSnapshot(const Zone *zone)
void Restore(Zone *zone) const
V8_WARN_UNUSED_RESULT ZoneSnapshot Snapshot() const
static const size_t kMinimumSegmentSize
static const size_t kMaximumSegmentSize
void * AsanNew(size_t size)
Zone(AccountingAllocator *allocator, const char *name, bool support_compression=false)
bool supports_compression() const
size_t allocation_size() const
V8_NOINLINE V8_PRESERVE_MOST void Expand(size_t size)
std::atomic< size_t > segment_bytes_allocated_
void ReleaseSegment(Segment *segment)
std::atomic< size_t > allocation_size_
static const size_t kAlignmentInBytes
AccountingAllocator * allocator_
ZoneVector< RpoNumber > & result
#define DCHECK_LE(v1, v2)
#define CHECK_NOT_NULL(val)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
constexpr T RoundUp(T x, intptr_t m)
constexpr T RoundDown(T x, intptr_t m)
constexpr bool IsAligned(T value, U alignment)
#define V8_UNLIKELY(condition)