summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 9978a6fa18..346f60d4dc 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -406,7 +406,7 @@ class OptimizingCompiler final : public Compiler {
PassObserver* pass_observer,
VariableSizedHandleScope* handles) const;
- void GenerateJitDebugInfo(const debug::MethodDebugInfo& method_debug_info);
+ std::vector<uint8_t> GenerateJitDebugInfo(const debug::MethodDebugInfo& method_debug_info);
std::unique_ptr<OptimizingCompilerStats> compilation_stats_;
@@ -1262,6 +1262,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,
const uint8_t* code = reserved_code.data() + OatQuickMethodHeader::InstructionAlignedSize();
// Add debug info after we know the code location but before we update entry-point.
+ std::vector<uint8_t> debug_info;
if (compiler_options.GenerateAnyDebugInfo()) {
debug::MethodDebugInfo info = {};
info.custom_name = "art_jni_trampoline";
@@ -1280,7 +1281,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,
info.frame_size_in_bytes = jni_compiled_method.GetFrameSize();
info.code_info = nullptr;
info.cfi = jni_compiled_method.GetCfi();
- GenerateJitDebugInfo(info);
+ debug_info = GenerateJitDebugInfo(info);
}
if (!code_cache->Commit(self,
@@ -1291,6 +1292,8 @@ bool OptimizingCompiler::JitCompile(Thread* self,
reserved_data,
roots,
ArrayRef<const uint8_t>(stack_map),
+ debug_info,
+ /* is_full_debug_info= */ compiler_options.GetGenerateDebugInfo(),
osr,
/* has_should_deoptimize_flag= */ false,
cha_single_implementation_list)) {
@@ -1370,6 +1373,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,
// Add debug info after we know the code location but before we update entry-point.
const CompilerOptions& compiler_options = GetCompilerOptions();
+ std::vector<uint8_t> debug_info;
if (compiler_options.GenerateAnyDebugInfo()) {
debug::MethodDebugInfo info = {};
DCHECK(info.custom_name.empty());
@@ -1388,7 +1392,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,
info.frame_size_in_bytes = codegen->GetFrameSize();
info.code_info = stack_map.size() == 0 ? nullptr : stack_map.data();
info.cfi = ArrayRef<const uint8_t>(*codegen->GetAssembler()->cfi().data());
- GenerateJitDebugInfo(info);
+ debug_info = GenerateJitDebugInfo(info);
}
if (!code_cache->Commit(self,
@@ -1399,6 +1403,8 @@ bool OptimizingCompiler::JitCompile(Thread* self,
reserved_data,
roots,
ArrayRef<const uint8_t>(stack_map),
+ debug_info,
+ /* is_full_debug_info= */ compiler_options.GetGenerateDebugInfo(),
osr,
codegen->GetGraph()->HasShouldDeoptimizeFlag(),
codegen->GetGraph()->GetCHASingleImplementationList())) {
@@ -1427,7 +1433,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,
return true;
}
-void OptimizingCompiler::GenerateJitDebugInfo(const debug::MethodDebugInfo& info) {
+std::vector<uint8_t> OptimizingCompiler::GenerateJitDebugInfo(const debug::MethodDebugInfo& info) {
const CompilerOptions& compiler_options = GetCompilerOptions();
if (compiler_options.GenerateAnyDebugInfo()) {
// If both flags are passed, generate full debug info.
@@ -1436,13 +1442,9 @@ void OptimizingCompiler::GenerateJitDebugInfo(const debug::MethodDebugInfo& info
// Create entry for the single method that we just compiled.
InstructionSet isa = compiler_options.GetInstructionSet();
const InstructionSetFeatures* features = compiler_options.GetInstructionSetFeatures();
- std::vector<uint8_t> elf = debug::MakeElfFileForJIT(isa, features, mini_debug_info, info);
-
- // NB: Don't allow packing of full info since it would remove non-backtrace data.
- MutexLock mu(Thread::Current(), *Locks::jit_lock_);
- const void* code_ptr = reinterpret_cast<const void*>(info.code_address);
- AddNativeDebugInfoForJit(code_ptr, elf, /*allow_packing=*/ mini_debug_info);
+ return debug::MakeElfFileForJIT(isa, features, mini_debug_info, info);
}
+ return std::vector<uint8_t>();
}
} // namespace art