summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2021-02-02 14:29:04 +0000
committerVladimir Marko <vmarko@google.com>2021-02-03 08:35:17 +0000
commit37fd800e917269df7824052452bcbd65f5528a3e (patch)
tree46a1c77e994a5d238d385d579320eaf3224c6630 /compiler/common_compiler_test.h
parent98071159668576ae08c2b0de80b0565d58f409f2 (diff)
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
Diffstat (limited to 'compiler/common_compiler_test.h')
-rw-r--r--compiler/common_compiler_test.h11
1 files changed, 7 insertions, 4 deletions
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<const uint8_t> code,
+ ArrayRef<const uint8_t> 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<std::vector<uint8_t>> header_code_and_maps_chunks_;
+ class CodeAndMetadata;
+ std::vector<CodeAndMetadata> code_and_metadata_;
};
template <typename RuntimeBase>