From 14165e156cc23a5bbe7d70d606b3b260721e48dd Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Thu, 28 Sep 2023 16:24:15 +0100 Subject: Initialize gPageSize at runtime via sysconf This changes gPageSize to a global constant const in page size agnostic configuration, dynamically initialized with the runtime-determined page size value. This finishes adding basic support of page size agnostic ART configuration, however without yet enabling it. With page size agnosticism disabled, gPageSize etc. derived values in the global scope are still constexpr. As part of that, introduce helpers for gPageSize and the derived constants in the global scope, in a way that guarantees correct static initialization order: - GlobalConst is a helper class that acts as a global constant; - ART_PAGE_SIZE_AGNOSTIC_DECLARE etc. - helper macros for declaring the constants either as the global constants or constexpr depends on the configuration. The helpers are used for the gPageSize and derived values stored in the global scope. Test: Same as for I5430741a8494b340ed7fd2d8692c41a59ad9c530. The whole patches chain was tested as a whole. Change-Id: Id1c18004346ba5c6c94e02cdf8b0b0bb3b99af70 --- compiler/common_compiler_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/common_compiler_test.cc') diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index 206020fa82..eb8c21c0d1 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -57,7 +57,7 @@ class CommonCompilerTestImpl::CodeAndMetadata { : sizeof(OatQuickMethodHeader) + vmap_table.size(); OatQuickMethodHeader method_header(vmap_table_offset); const size_t code_alignment = GetInstructionSetCodeAlignment(instruction_set); - DCHECK_ALIGNED_PARAM(gPageSize, code_alignment); + DCHECK_ALIGNED_PARAM(static_cast(gPageSize), 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); -- cgit v1.2.3-59-g8ed1b