diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/common_compiler_test.cc | 5 | ||||
| -rw-r--r-- | compiler/jit/jit_logger.cc | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index eb8c21c0d1..f94d3048c2 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -51,15 +51,16 @@ class CommonCompilerTestImpl::CodeAndMetadata { CodeAndMetadata(ArrayRef<const uint8_t> code, ArrayRef<const uint8_t> vmap_table, InstructionSet instruction_set) { + const size_t page_size = MemMap::GetPageSize(); const uint32_t code_size = code.size(); CHECK_NE(code_size, 0u); const uint32_t vmap_table_offset = vmap_table.empty() ? 0u : sizeof(OatQuickMethodHeader) + vmap_table.size(); OatQuickMethodHeader method_header(vmap_table_offset); const size_t code_alignment = GetInstructionSetCodeAlignment(instruction_set); - DCHECK_ALIGNED_PARAM(static_cast<size_t>(gPageSize), code_alignment); + DCHECK_ALIGNED_PARAM(page_size, code_alignment); const uint32_t code_offset = RoundUp(vmap_table.size() + sizeof(method_header), code_alignment); - const uint32_t capacity = RoundUp(code_offset + code_size, gPageSize); + const uint32_t capacity = RoundUp(code_offset + code_size, page_size); // Create a memfd handle with sufficient capacity. android::base::unique_fd mem_fd(art::memfd_create_compat("test code", /*flags=*/ 0)); diff --git a/compiler/jit/jit_logger.cc b/compiler/jit/jit_logger.cc index c50103df9c..0ca5c38fb1 100644 --- a/compiler/jit/jit_logger.cc +++ b/compiler/jit/jit_logger.cc @@ -211,7 +211,7 @@ void JitLogger::OpenMarkerFile() { int fd = jit_dump_file_->Fd(); // The 'perf inject' tool requires that the jit-PID.dump file // must have a mmap(PROT_READ|PROT_EXEC) record in perf.data. - marker_address_ = mmap(nullptr, gPageSize, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0); + marker_address_ = mmap(nullptr, MemMap::GetPageSize(), PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0); if (marker_address_ == MAP_FAILED) { LOG(WARNING) << "Failed to create record in perf.data. JITed code profiling will not work."; return; @@ -220,7 +220,7 @@ void JitLogger::OpenMarkerFile() { void JitLogger::CloseMarkerFile() { if (marker_address_ != nullptr) { - munmap(marker_address_, gPageSize); + munmap(marker_address_, MemMap::GetPageSize()); } } |