diff options
author | 2016-03-07 17:33:57 +0000 | |
---|---|---|
committer | 2016-03-10 10:11:31 +0000 | |
commit | 197160d47f34238cb5e7444fa4c2de300db8e2c6 (patch) | |
tree | 4c07b9e97e8ffaffb274d03b63701780baf0b72f /compiler/optimizing/optimizing_compiler.cc | |
parent | ef0119a0f329906ba1e8cbd8e53ce5a759fd4f99 (diff) |
Refactor MethodDebugInfo (input of DWARF writer).
Do not pass CompiledMethod pointer through since it is only available
during AOT compile but not during JIT compile or at runtime. Creating
mock CompiledMethod just pass data is proving increasingly tricky, so
copy the fields that we need to MethodDebugInfo instead.
Change-Id: I820297b41e769fcac488c0ff2d2ea0492bb13ed8
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 42f22afd80..47581b1f0d 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -917,35 +917,26 @@ bool OptimizingCompiler::JitCompile(Thread* self, if (compiler_options.GetGenerateDebugInfo()) { const auto* method_header = reinterpret_cast<const OatQuickMethodHeader*>(code); const uintptr_t code_address = reinterpret_cast<uintptr_t>(method_header->GetCode()); - CompiledMethod compiled_method( - GetCompilerDriver(), - codegen->GetInstructionSet(), - ArrayRef<const uint8_t>(code_allocator.GetMemory()), - codegen->HasEmptyFrame() ? 0 : codegen->GetFrameSize(), - codegen->GetCoreSpillMask(), - codegen->GetFpuSpillMask(), - ArrayRef<const SrcMapElem>(), - ArrayRef<const uint8_t>(), // mapping_table. - ArrayRef<const uint8_t>(stack_map_data, stack_map_size), - ArrayRef<const uint8_t>(), // native_gc_map. - ArrayRef<const uint8_t>(*codegen->GetAssembler()->cfi().data()), - ArrayRef<const LinkerPatch>()); - debug::MethodDebugInfo method_debug_info { - dex_file, - class_def_idx, - method_idx, - access_flags, - code_item, - false, // deduped. - compiler_options.GetNativeDebuggable(), - code_address, - code_address + code_allocator.GetSize(), - &compiled_method - }; + debug::MethodDebugInfo info; + info.dex_file = dex_file; + info.class_def_index = class_def_idx; + info.dex_method_index = method_idx; + info.access_flags = access_flags; + info.code_item = code_item; + info.isa = codegen->GetInstructionSet(); + info.deduped = false; + info.is_native_debuggable = compiler_options.GetNativeDebuggable(); + info.is_optimized = true; + info.is_code_address_text_relative = false; + info.code_address = code_address; + info.code_size = code_allocator.GetSize(); + info.frame_size_in_bytes = method_header->GetFrameSizeInBytes(); + info.code_info = stack_map_size == 0 ? nullptr : stack_map_data; + info.cfi = ArrayRef<const uint8_t>(*codegen->GetAssembler()->cfi().data()); ArrayRef<const uint8_t> elf_file = debug::WriteDebugElfFileForMethod( GetCompilerDriver()->GetInstructionSet(), GetCompilerDriver()->GetInstructionSetFeatures(), - method_debug_info); + info); CreateJITCodeEntryForAddress(code_address, std::unique_ptr<const uint8_t[]>(elf_file.data()), elf_file.size()); |