From d8dbc8da0e5cc6b5c2176ce2d3877e6194d72c0c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 20 Sep 2017 13:37:47 +0100 Subject: Refactor compiled_method.h . Move LinkerPatch to compiler/linker/linker_patch.h . Move SrcMapElem to compiler/debug/src_map_elem.h . Introduce compiled_method-inl.h to reduce the number of `#include`s in compiled_method.h . Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: Id211cdf94a63ad265bf4709f1a5e06dffbe30f64 --- compiler/optimizing/optimizing_compiler.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 8dd2762a75..7451196677 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -77,6 +77,7 @@ #include "jit/jit_logger.h" #include "jni/quick/jni_compiler.h" #include "licm.h" +#include "linker/linker_patch.h" #include "load_store_analysis.h" #include "load_store_elimination.h" #include "loop_optimization.h" @@ -833,13 +834,13 @@ void OptimizingCompiler::RunOptimizations(HGraph* graph, RunArchOptimizations(driver->GetInstructionSet(), graph, codegen, pass_observer); } -static ArenaVector EmitAndSortLinkerPatches(CodeGenerator* codegen) { - ArenaVector linker_patches(codegen->GetGraph()->GetArena()->Adapter()); +static ArenaVector EmitAndSortLinkerPatches(CodeGenerator* codegen) { + ArenaVector linker_patches(codegen->GetGraph()->GetArena()->Adapter()); codegen->EmitLinkerPatches(&linker_patches); // Sort patches by literal offset. Required for .oat_patches encoding. std::sort(linker_patches.begin(), linker_patches.end(), - [](const LinkerPatch& lhs, const LinkerPatch& rhs) { + [](const linker::LinkerPatch& lhs, const linker::LinkerPatch& rhs) { return lhs.LiteralOffset() < rhs.LiteralOffset(); }); @@ -851,7 +852,7 @@ CompiledMethod* OptimizingCompiler::Emit(ArenaAllocator* arena, CodeGenerator* codegen, CompilerDriver* compiler_driver, const DexFile::CodeItem* code_item) const { - ArenaVector linker_patches = EmitAndSortLinkerPatches(codegen); + ArenaVector linker_patches = EmitAndSortLinkerPatches(codegen); ArenaVector stack_map(arena->Adapter(kArenaAllocStackMaps)); ArenaVector method_info(arena->Adapter(kArenaAllocStackMaps)); size_t stack_map_size = 0; @@ -876,7 +877,7 @@ CompiledMethod* OptimizingCompiler::Emit(ArenaAllocator* arena, ArrayRef(method_info), ArrayRef(stack_map), ArrayRef(*codegen->GetAssembler()->cfi().data()), - ArrayRef(linker_patches)); + ArrayRef(linker_patches)); return compiled_method; } -- cgit v1.2.3-59-g8ed1b