From 8fc2f95291206806599d4f2a50da529da85155b6 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 31 Jul 2019 18:40:09 +0100 Subject: JIT mini-debug-info: Remove global maps. Keep the extra bookkeeping information in JITCodeEntry. Also do the compression eagerly during GC rather then lazily. Test: test.py -b --host --jit Bug: 119800099 Change-Id: Ie6cc682033a32c01d4c2cac242d8a4201116f940 --- compiler/jit/jit_compiler.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'compiler/jit/jit_compiler.cc') diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index d84a132900..f01554a197 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -127,17 +127,14 @@ void JitCompiler::TypesLoaded(mirror::Class** types, size_t count) REQUIRES_SHARED(Locks::mutator_lock_) { const CompilerOptions& compiler_options = GetCompilerOptions(); if (compiler_options.GetGenerateDebugInfo()) { + InstructionSet isa = compiler_options.GetInstructionSet(); + const InstructionSetFeatures* features = compiler_options.GetInstructionSetFeatures(); const ArrayRef types_array(types, count); - std::vector elf_file = debug::WriteDebugElfFileForClasses( - kRuntimeISA, compiler_options.GetInstructionSetFeatures(), types_array); - // We never free debug info for types, so we don't need to provide a handle - // (which would have been otherwise used as identifier to remove it later). - AddNativeDebugInfoForJit(Thread::Current(), - /*code_ptr=*/ nullptr, - elf_file, - /*pack*/ nullptr, - compiler_options.GetInstructionSet(), - compiler_options.GetInstructionSetFeatures()); + std::vector elf_file = + debug::WriteDebugElfFileForClasses(isa, features, types_array); + + // NB: Don't allow packing since it would remove non-backtrace data. + AddNativeDebugInfoForJit(/*code_ptr=*/ nullptr, elf_file, /*allow_packing=*/ false); } } @@ -145,6 +142,13 @@ bool JitCompiler::GenerateDebugInfo() { return GetCompilerOptions().GetGenerateDebugInfo(); } +std::vector JitCompiler::PackElfFileForJIT(ArrayRef elf_files, + ArrayRef removed_symbols, + bool compress, + /*out*/ size_t* num_symbols) { + return debug::PackElfFileForJIT(elf_files, removed_symbols, compress, num_symbols); +} + JitCompiler::JitCompiler() { compiler_options_.reset(new CompilerOptions()); ParseCompilerOptions(); -- cgit v1.2.3-59-g8ed1b