From 197160d47f34238cb5e7444fa4c2de300db8e2c6 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Mon, 7 Mar 2016 17:33:57 +0000 Subject: 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 --- compiler/optimizing/optimizing_compiler.cc | 43 ++++++++++++------------------ 1 file changed, 17 insertions(+), 26 deletions(-) (limited to 'compiler/optimizing') 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(code); const uintptr_t code_address = reinterpret_cast(method_header->GetCode()); - CompiledMethod compiled_method( - GetCompilerDriver(), - codegen->GetInstructionSet(), - ArrayRef(code_allocator.GetMemory()), - codegen->HasEmptyFrame() ? 0 : codegen->GetFrameSize(), - codegen->GetCoreSpillMask(), - codegen->GetFpuSpillMask(), - ArrayRef(), - ArrayRef(), // mapping_table. - ArrayRef(stack_map_data, stack_map_size), - ArrayRef(), // native_gc_map. - ArrayRef(*codegen->GetAssembler()->cfi().data()), - ArrayRef()); - 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(*codegen->GetAssembler()->cfi().data()); ArrayRef elf_file = debug::WriteDebugElfFileForMethod( GetCompilerDriver()->GetInstructionSet(), GetCompilerDriver()->GetInstructionSetFeatures(), - method_debug_info); + info); CreateJITCodeEntryForAddress(code_address, std::unique_ptr(elf_file.data()), elf_file.size()); -- cgit v1.2.3-59-g8ed1b