16#define STATIC_ASSERT_ENUM(a, b) \
17 static_assert(static_cast<int>(a) == static_cast<int>(b), \
18 "mismatching enum: " #a)
31#undef STATIC_ASSERT_ENUM
34 : allocate_page_size_(
base::
OS::AllocatePageSize()),
35 commit_page_size_(
base::
OS::CommitPageSize()) {}
47#if !V8_HAS_PTHREAD_JIT_WRITE_PROTECT && !V8_HAS_BECORE_JIT_WRITE_PROTECT
79 std::unique_ptr<::v8::PageAllocator::SharedMemoryMapping>
RemapTo(
80 void* new_address)
const override {
82 return std::make_unique<SharedMemoryMapping>(
allocator_, new_address,
105std::unique_ptr<v8::PageAllocator::SharedMemory>
111 memcpy(ptr, original_address, size);
117 std::make_unique<v8::base::SharedMemory>(
this, ptr, size);
118 return shared_memory;
static V8_WARN_UNUSED_RESULT void * AllocateShared(size_t size, MemoryPermission access)
static void * GetRandomMmapAddr()
static V8_WARN_UNUSED_RESULT void * RemapShared(void *old_address, void *new_address, size_t size)
static V8_WARN_UNUSED_RESULT bool SealPages(void *address, size_t size)
static V8_WARN_UNUSED_RESULT bool DiscardSystemPages(void *address, size_t size)
static V8_WARN_UNUSED_RESULT bool SetPermissions(void *address, size_t size, MemoryPermission access)
static V8_WARN_UNUSED_RESULT bool DecommitPages(void *address, size_t size)
static void Release(void *address, size_t size)
static V8_WARN_UNUSED_RESULT bool RecommitPages(void *address, size_t size, MemoryPermission access)
static V8_WARN_UNUSED_RESULT void * Allocate(void *address, size_t size, size_t alignment, MemoryPermission access)
static void SetRandomMmapSeed(int64_t seed)
static void Free(void *address, size_t size)
void * RemapShared(void *old_address, void *new_address, size_t size)
bool DiscardSystemPages(void *address, size_t size) override
void * AllocatePages(void *hint, size_t size, size_t alignment, PageAllocator::Permission access) override
void SetRandomMmapSeed(int64_t seed) override
void * GetRandomMmapAddr() override
std::unique_ptr< v8::PageAllocator::SharedMemory > AllocateSharedPages(size_t size, const void *original_address) override
bool SealPages(void *address, size_t size) override
bool CanAllocateSharedPages() override
bool RecommitPages(void *address, size_t size, PageAllocator::Permission access) override
bool DecommitPages(void *address, size_t size) override
bool FreePages(void *address, size_t size) override
bool ReleasePages(void *address, size_t size, size_t new_size) override
bool SetPermissions(void *address, size_t size, PageAllocator::Permission access) override
PageAllocator * page_allocator_
SharedMemoryMapping(PageAllocator *page_allocator, void *ptr, size_t size)
~SharedMemoryMapping() override
void * GetMemory() const override
SharedMemory(PageAllocator *allocator, void *memory, size_t size)
size_t GetSize() const override
PageAllocator * allocator_
std::unique_ptr<::v8::PageAllocator::SharedMemoryMapping > RemapTo(void *new_address) const override
void * GetMemory() const override
#define STATIC_ASSERT_ENUM(a, b)
#define CHECK_NOT_NULL(val)
#define DCHECK_LT(v1, v2)