#include "src/heap/memory-chunk-metadata.h"
#include <cstdlib>
#include "src/heap/heap-write-barrier-inl.h"
#include "src/heap/marking-inl.h"
#include "src/objects/heap-object.h"
#include "src/utils/allocation.h"
namespace v8 {
namespace internal {
MemoryChunkMetadata::MemoryChunkMetadata(Heap* heap, BaseSpace* space,
size_t chunk_size, Address area_start,
Address area_end,
VirtualMemory reservation)
: … { … }
MemoryChunkMetadata::~MemoryChunkMetadata() { … }
bool MemoryChunkMetadata::InSharedSpace() const { … }
bool MemoryChunkMetadata::InTrustedSpace() const { … }
#ifdef THREAD_SANITIZER
void MemoryChunkMetadata::SynchronizedHeapLoad() const {
CHECK(reinterpret_cast<Heap*>(
base::Acquire_Load(reinterpret_cast<base::AtomicWord*>(&(
const_cast<MemoryChunkMetadata*>(this)->heap_)))) != nullptr ||
Chunk()->IsFlagSet(MemoryChunk::READ_ONLY_HEAP));
}
void MemoryChunkMetadata::SynchronizedHeapStore() {
base::Release_Store(reinterpret_cast<base::AtomicWord*>(&heap_),
reinterpret_cast<base::AtomicWord>(heap_));
}
#endif
class MemoryChunkValidator { … };
}
}