diff options
Diffstat (limited to 'src/3rdparty/v8/src/spaces-inl.h')
-rw-r--r-- | src/3rdparty/v8/src/spaces-inl.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/3rdparty/v8/src/spaces-inl.h b/src/3rdparty/v8/src/spaces-inl.h index ed78fc7..8a576a8 100644 --- a/src/3rdparty/v8/src/spaces-inl.h +++ b/src/3rdparty/v8/src/spaces-inl.h @@ -214,6 +214,19 @@ MemoryChunk* MemoryChunk::FromAnyPointerAddress(Address addr) { } +void MemoryChunk::UpdateHighWaterMark(Address mark) { + if (mark == NULL) return; + // Need to subtract one from the mark because when a chunk is full the + // top points to the next address after the chunk, which effectively belongs + // to another chunk. See the comment to Page::FromAllocationTop. + MemoryChunk* chunk = MemoryChunk::FromAddress(mark - 1); + int new_mark = static_cast<int>(mark - chunk->address()); + if (new_mark > chunk->high_water_mark_) { + chunk->high_water_mark_ = new_mark; + } +} + + PointerChunkIterator::PointerChunkIterator(Heap* heap) : state_(kOldPointerState), old_pointer_iterator_(heap->old_pointer_space()), @@ -269,6 +282,10 @@ MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) { return object; } + ASSERT(!heap()->linear_allocation() || + (anchor_.next_chunk() == &anchor_ && + anchor_.prev_chunk() == &anchor_)); + object = free_list_.Allocate(size_in_bytes); if (object != NULL) { if (identity() == CODE_SPACE) { |