28 #ifndef V8_ZONE_INL_H_
29 #define V8_ZONE_INL_H_
43 ASSERT(ZoneScope::nesting() > 0);
45 size =
RoundUp(size, kAlignment);
50 position_ += ((~size) & 4) & (
reinterpret_cast<intptr_t
>(position_) & 4);
58 if (size > limit_ - position_) {
59 result = NewExpand(size);
67 return reinterpret_cast<void*
>(result);
73 return static_cast<T*
>(
New(length *
sizeof(
T)));
78 return segment_bytes_allocated_ > zone_excess_limit_;
83 segment_bytes_allocated_ += delta;
84 isolate_->
counters()->zone_segment_bytes()->Set(segment_bytes_allocated_);
88 template <
typename Config>
97 void* ZoneObject::operator
new(
size_t size,
Zone* zone) {
98 return zone->New(static_cast<int>(size));
101 inline void* ZoneAllocationPolicy::New(
size_t size) {
103 return zone_->
New(size);
107 template <
typename T>
108 void* ZoneList<T>::operator
new(
size_t size, Zone* zone) {
109 return zone->New(static_cast<int>(size));
114 : isolate_(isolate), mode_(mode) {
115 isolate_->zone()->scope_nesting_++;
119 bool ZoneScope::ShouldDeleteOnExit() {
120 return isolate_->zone()->scope_nesting_ == 1 && mode_ ==
DELETE_ON_EXIT;
124 int ZoneScope::nesting() {
125 return Isolate::Current()->zone()->scope_nesting_;
131 #endif // V8_ZONE_INL_H_
bool IsAddressAligned(Address addr, intptr_t alignment, int offset=0)
#define ASSERT(condition)
static unsigned allocation_size_
T RoundUp(T x, intptr_t m)
void adjust_segment_bytes_allocated(int delta)
#define T(name, string, precedence)