From 87fb032ee1e7ae98df26c646c450ef44e23fc805 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Tue, 20 Aug 2019 10:34:02 +0100 Subject: Fix JIT data dual mapping for apps. We don't use it now, but it would be nice to make it functional. Mark the read-only memory as const, and fix the compile errors. Test: test.py -b --host --jit Bug: 119800099 Change-Id: Ic1c45072f3c97f560e843f95fb87b95f754c6e03 --- compiler/optimizing/optimizing_compiler.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'compiler') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 8ef1b5516c..c55fc8ad72 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1290,11 +1290,8 @@ bool OptimizingCompiler::JitCompile(Thread* self, ScopedArenaAllocator stack_map_allocator(&arena_stack); // Will hold the stack map. ScopedArenaVector stack_map = CreateJniStackMap(&stack_map_allocator, jni_compiled_method); - uint8_t* roots_data = code_cache->ReserveData(self, - region, - stack_map.size(), - /* number_of_roots= */ 0, - method); + const uint8_t* roots_data = code_cache->ReserveData( + self, region, stack_map.size(), /* number_of_roots= */ 0, method); if (roots_data == nullptr) { MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kJitOutOfMemoryForCommit); return false; @@ -1386,11 +1383,8 @@ bool OptimizingCompiler::JitCompile(Thread* self, ScopedArenaVector stack_map = codegen->BuildStackMaps(code_item); size_t number_of_roots = codegen->GetNumberOfJitRoots(); - uint8_t* roots_data = code_cache->ReserveData(self, - region, - stack_map.size(), - number_of_roots, - method); + const uint8_t* roots_data = code_cache->ReserveData( + self, region, stack_map.size(), number_of_roots, method); if (roots_data == nullptr) { MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kJitOutOfMemoryForCommit); return false; -- cgit v1.2.3-59-g8ed1b