aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/instruction-stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/instruction-stream.cc')
-rw-r--r--deps/v8/src/instruction-stream.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/deps/v8/src/instruction-stream.cc b/deps/v8/src/instruction-stream.cc
index 4b2a9012d6..20cb4ece16 100644
--- a/deps/v8/src/instruction-stream.cc
+++ b/deps/v8/src/instruction-stream.cc
@@ -51,16 +51,18 @@ void InstructionStream::CreateOffHeapInstructionStream(Isolate* isolate,
uint32_t* size) {
EmbeddedData d = EmbeddedData::FromIsolate(isolate);
- const uint32_t page_size = static_cast<uint32_t>(AllocatePageSize());
+ v8::PageAllocator* page_allocator = v8::internal::GetPlatformPageAllocator();
+ const uint32_t page_size =
+ static_cast<uint32_t>(page_allocator->AllocatePageSize());
const uint32_t allocated_size = RoundUp(d.size(), page_size);
uint8_t* allocated_bytes = static_cast<uint8_t*>(
- AllocatePages(GetRandomMmapAddr(), allocated_size, page_size,
- PageAllocator::kReadWrite));
+ AllocatePages(page_allocator, isolate->heap()->GetRandomMmapAddr(),
+ allocated_size, page_size, PageAllocator::kReadWrite));
CHECK_NOT_NULL(allocated_bytes);
std::memcpy(allocated_bytes, d.data(), d.size());
- CHECK(SetPermissions(allocated_bytes, allocated_size,
+ CHECK(SetPermissions(page_allocator, allocated_bytes, allocated_size,
PageAllocator::kReadExecute));
*data = allocated_bytes;
@@ -72,8 +74,10 @@ void InstructionStream::CreateOffHeapInstructionStream(Isolate* isolate,
// static
void InstructionStream::FreeOffHeapInstructionStream(uint8_t* data,
uint32_t size) {
- const uint32_t page_size = static_cast<uint32_t>(AllocatePageSize());
- CHECK(FreePages(data, RoundUp(size, page_size)));
+ v8::PageAllocator* page_allocator = v8::internal::GetPlatformPageAllocator();
+ const uint32_t page_size =
+ static_cast<uint32_t>(page_allocator->AllocatePageSize());
+ CHECK(FreePages(page_allocator, data, RoundUp(size, page_size)));
}
} // namespace internal