| Index: src/spaces.h
|
| diff --git a/src/spaces.h b/src/spaces.h
|
| index 93e247846836423a495bac3848ff1fd4311242f3..10d0172a127a018746266c92588d4b148c80b9f2 100644
|
| --- a/src/spaces.h
|
| +++ b/src/spaces.h
|
| @@ -306,6 +306,11 @@ class MemoryChunk {
|
| Release_Store(&prev_chunk_, reinterpret_cast<AtomicWord>(prev));
|
| }
|
|
|
| + uintptr_t shadow_data_offset() { return shadow_data_offset_; }
|
| +
|
| + MemoryChunk* shadow_chunk() { return shadow_chunk_; }
|
| + void set_shadow_chunk(MemoryChunk* shadow) { shadow_chunk_ = shadow; }
|
| +
|
| Space* owner() const {
|
| if ((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) ==
|
| kFailureTag) {
|
| @@ -547,6 +552,7 @@ class MemoryChunk {
|
| static const intptr_t kLiveBytesOffset =
|
| kSizeOffset + kPointerSize + kPointerSize + kPointerSize +
|
| kPointerSize + kPointerSize +
|
| + kPointerSize + kPointerSize + kPointerSize +
|
| kPointerSize + kPointerSize + kPointerSize + kIntSize;
|
|
|
| static const size_t kSlotsBufferOffset = kLiveBytesOffset + kIntSize;
|
| @@ -685,6 +691,12 @@ class MemoryChunk {
|
| Address area_start_;
|
| Address area_end_;
|
|
|
| + MemoryChunk* shadow_chunk_;
|
| + // Offset to object's shadow data.
|
| + intptr_t shadow_data_offset_;
|
| + // Shadow data storage for large objects.
|
| + intptr_t large_object_shadow_data_;
|
| +
|
| // If the chunk needs to remember its memory reservation, it is stored here.
|
| VirtualMemory reservation_;
|
| // The identity of the owning space. This is tagged as a failure pointer, but
|
| @@ -1110,6 +1122,14 @@ class MemoryAllocator {
|
| Executability executable,
|
| Space* space);
|
|
|
| + // Allocates shadow page of respective size and sets it as a shadow
|
| + // of given chunk.
|
| + bool AllocateShadowChunkFor(MemoryChunk* chunk);
|
| +
|
| + // Frees and clears shadow page of given chunk.
|
| + void FreeShadowChunkFor(MemoryChunk* chunk);
|
| +
|
| +
|
| Address ReserveAlignedMemory(size_t requested,
|
| size_t alignment,
|
| VirtualMemory* controller);
|
| @@ -2285,6 +2305,15 @@ class SemiSpace : public Space {
|
| // Updates Capacity and MaximumCommitted based on new capacity.
|
| void SetCapacity(int new_capacity);
|
|
|
| + // Allocates new shadow chunk for pages with indexes in the range
|
| + // [start_index, end_index).
|
| + // Returns false on allocation failure.
|
| + bool AllocateShadowChunksForPages(int start_index, int end_index);
|
| +
|
| + // Frees shadow chunk for pages with indexes in the range
|
| + // [start_index, end_index).
|
| + void FreeShadowChunksForPages(int start_index, int end_index);
|
| +
|
| NewSpacePage* anchor() { return &anchor_; }
|
|
|
| // The current and maximum capacity of the space.
|
|
|