28 #ifndef V8_ZONE_INL_H_
29 #define V8_ZONE_INL_H_
33 #ifdef V8_USE_ADDRESS_SANITIZER
34 #include <sanitizer/asan_interface.h>
36 #define ASAN_UNPOISON_MEMORY_REGION(start, size) ((void) 0)
48 static const int kASanRedzoneBytes = 24;
53 size =
RoundUp(size, kAlignment);
58 position_ += ((~size) & 4) & (
reinterpret_cast<intptr_t
>(position_) & 4);
66 int size_with_redzone =
67 #ifdef V8_USE_ADDRESS_SANITIZER
68 size + kASanRedzoneBytes;
73 if (size_with_redzone > limit_ - position_) {
74 result = NewExpand(size_with_redzone);
76 position_ += size_with_redzone;
79 #ifdef V8_USE_ADDRESS_SANITIZER
81 ASSERT(redzone_position + kASanRedzoneBytes == position_);
82 ASAN_POISON_MEMORY_REGION(redzone_position, kASanRedzoneBytes);
87 allocation_size_ +=
size;
88 return reinterpret_cast<void*
>(result);
94 CHECK(std::numeric_limits<int>::max() / static_cast<int>(
sizeof(
T)) > length);
95 return static_cast<T*
>(
New(length *
sizeof(
T)));
100 return segment_bytes_allocated_ > kExcessLimit;
105 segment_bytes_allocated_ += delta;
106 isolate_->
counters()->zone_segment_bytes()->Set(segment_bytes_allocated_);
110 template <
typename Config>
119 void* ZoneObject::operator
new(
size_t size,
Zone* zone) {
120 return zone->New(static_cast<int>(
size));
123 inline void* ZoneAllocationPolicy::New(
size_t size) {
125 return zone_->
New(static_cast<int>(size));
129 template <
typename T>
130 void* ZoneList<T>::operator
new(
size_t size, Zone* zone) {
131 return zone->New(static_cast<int>(size));
135 template <
typename T>
136 void* ZoneSplayTree<T>::operator
new(
size_t size, Zone* zone) {
137 return zone->New(static_cast<int>(size));
143 #endif // V8_ZONE_INL_H_
bool IsAddressAligned(Address addr, intptr_t alignment, int offset=0)
#define ASSERT(condition)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
T RoundUp(T x, intptr_t m)
void adjust_segment_bytes_allocated(int delta)
#define T(name, string, precedence)