summaryrefslogtreecommitdiff
path: root/compiler/jit/jit_compiler.cc
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2019-07-31 18:40:09 +0100
committer David Srbecky <dsrbecky@google.com> 2019-08-16 09:10:55 +0000
commit8fc2f95291206806599d4f2a50da529da85155b6 (patch)
treec3c9de9a9a925d6ab790f6db466d1f9c17ed1010 /compiler/jit/jit_compiler.cc
parent9ce340f829f836560278ecd078fbefcf19c9d629 (diff)
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
Diffstat (limited to 'compiler/jit/jit_compiler.cc')
-rw-r--r--compiler/jit/jit_compiler.cc24
1 files changed, 14 insertions, 10 deletions
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<mirror::Class*> types_array(types, count);
- std::vector<uint8_t> 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<uint8_t> 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<uint8_t> JitCompiler::PackElfFileForJIT(ArrayRef<JITCodeEntry*> elf_files,
+ ArrayRef<const void*> 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();