Support system server ART-profiling
We don't have to map the code cache as executable if we only want to save
profiles. This enables system server profiling without disabling SElinux
to bypass the jit code cache exec-mapping.
Test: m test-art-host
boot a device with system server profiling enabled.
Bug: 73313191
Change-Id: I7f25a905e0b23456183e39e58ad8f4b829ddf0c5
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index d4fe977..0684b46 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -185,10 +185,12 @@
if (jit_compiler_handle_ == nullptr && !LoadCompiler(error_msg)) {
return nullptr;
}
+ bool code_cache_only_for_profile_data = !options->UseJitCompilation();
jit->code_cache_.reset(JitCodeCache::Create(
options->GetCodeCacheInitialCapacity(),
options->GetCodeCacheMaxCapacity(),
jit->generate_debug_info_,
+ code_cache_only_for_profile_data,
error_msg));
if (jit->GetCodeCache() == nullptr) {
return nullptr;