diff options
| author | 2017-12-14 15:54:28 +0000 | |
|---|---|---|
| committer | 2017-12-14 15:54:28 +0000 | |
| commit | df259b09fe78bc6864e757a2a15990c8b628455c (patch) | |
| tree | 897e74d9da4e92faae5c24350fa2f999cbfb2b1e /compiler/optimizing/optimizing_compiler.cc | |
| parent | 7eb4333d0b60a13f9d3126eadef9eb16c399662a (diff) | |
| parent | f4886df5e72fa21eddfc4cc7860f4154929b3380 (diff) | |
Merge "Add mini-debug-info generation mode for JIT."
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
| -rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 18 | 
1 files changed, 12 insertions, 6 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 73c72fc57a..24b1a123ee 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1224,7 +1224,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,      }      const CompilerOptions& compiler_options = GetCompilerDriver()->GetCompilerOptions(); -    if (compiler_options.GetGenerateDebugInfo()) { +    if (compiler_options.GenerateAnyDebugInfo()) {        const auto* method_header = reinterpret_cast<const OatQuickMethodHeader*>(code);        const uintptr_t code_address = reinterpret_cast<uintptr_t>(method_header->GetCode());        debug::MethodDebugInfo info = {}; @@ -1244,10 +1244,13 @@ bool OptimizingCompiler::JitCompile(Thread* self,        info.frame_size_in_bytes = method_header->GetFrameSizeInBytes();        info.code_info = nullptr;        info.cfi = jni_compiled_method.GetCfi(); -      std::vector<uint8_t> elf_file = debug::WriteDebugElfFileForMethods( +      // If both flags are passed, generate full debug info. +      const bool mini_debug_info = !compiler_options.GetGenerateDebugInfo(); +      std::vector<uint8_t> elf_file = debug::MakeElfFileForJIT(            GetCompilerDriver()->GetInstructionSet(),            GetCompilerDriver()->GetInstructionSetFeatures(), -          ArrayRef<const debug::MethodDebugInfo>(&info, 1)); +          mini_debug_info, +          info);        CreateJITCodeEntryForAddress(code_address, std::move(elf_file));      } @@ -1352,7 +1355,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,    }    const CompilerOptions& compiler_options = GetCompilerDriver()->GetCompilerOptions(); -  if (compiler_options.GetGenerateDebugInfo()) { +  if (compiler_options.GenerateAnyDebugInfo()) {      const auto* method_header = reinterpret_cast<const OatQuickMethodHeader*>(code);      const uintptr_t code_address = reinterpret_cast<uintptr_t>(method_header->GetCode());      debug::MethodDebugInfo info = {}; @@ -1372,10 +1375,13 @@ bool OptimizingCompiler::JitCompile(Thread* self,      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()); -    std::vector<uint8_t> elf_file = debug::WriteDebugElfFileForMethods( +    // If both flags are passed, generate full debug info. +    const bool mini_debug_info = !compiler_options.GetGenerateDebugInfo(); +    std::vector<uint8_t> elf_file = debug::MakeElfFileForJIT(          GetCompilerDriver()->GetInstructionSet(),          GetCompilerDriver()->GetInstructionSetFeatures(), -        ArrayRef<const debug::MethodDebugInfo>(&info, 1)); +        mini_debug_info, +        info);      CreateJITCodeEntryForAddress(code_address, std::move(elf_file));    }  |