From 37fd800e917269df7824052452bcbd65f5528a3e Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 2 Feb 2021 14:29:04 +0000 Subject: Use mmap for compiled code for gtest. Avoid executing code in memory allocated with malloc() as pointers to that memory can be tagged which interferes with managed stack walk. Test: m test-art-host-gtest. Bug: 177816575 Change-Id: Id376091f82d5686adf3ab18d2980a42e78de57ce --- compiler/common_compiler_test.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'compiler/common_compiler_test.h') diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index 8317d7f48a..89cc1fa28f 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -50,11 +50,14 @@ class CommonCompilerTestImpl { CommonCompilerTestImpl(); virtual ~CommonCompilerTestImpl(); + // Create an executable copy of the code with given metadata. + const void* MakeExecutable(ArrayRef code, + ArrayRef vmap_table, + InstructionSet instruction_set); + void MakeExecutable(ArtMethod* method, const CompiledMethod* compiled_method) REQUIRES_SHARED(Locks::mutator_lock_); - static void MakeExecutable(const void* code_start, size_t code_length); - protected: void SetUp(); @@ -100,8 +103,8 @@ class CommonCompilerTestImpl { virtual Runtime* GetRuntime() = 0; private: - // Chunks must not move their storage after being created - use the node-based std::list. - std::list> header_code_and_maps_chunks_; + class CodeAndMetadata; + std::vector code_and_metadata_; }; template -- cgit v1.2.3-59-g8ed1b