diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-02 15:17:15 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-08 12:15:07 +0100 |
commit | 3946844c34ad965515f677084b07d663d70ad1b8 (patch) | |
tree | 0d85bfba2ff69c34a2897351d1e50a1464509305 /compiler/optimizing/optimizing_compiler.cc | |
parent | e2c23739c6395a83b30ece38f8a2e9e1bf7cf3ce (diff) | |
download | art-3946844c34ad965515f677084b07d663d70ad1b8.tar.gz art-3946844c34ad965515f677084b07d663d70ad1b8.tar.bz2 art-3946844c34ad965515f677084b07d663d70ad1b8.zip |
Runtime support for the new stack maps for the opt compiler.
Now most of the methods supported by the compiler can be optimized,
instead of using the baseline.
Change-Id: I80ab36a34913fa4e7dd576c7bf55af63594dc1fa
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 34612766d6..75f41557e2 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -240,8 +240,27 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite visualizer.DumpGraph(kRegisterAllocatorPassName); codegen->CompileOptimized(&allocator); + + std::vector<uint8_t> mapping_table; + SrcMap src_mapping_table; + codegen->BuildMappingTable(&mapping_table, + GetCompilerDriver()->GetCompilerOptions().GetIncludeDebugSymbols() ? + &src_mapping_table : nullptr); + + std::vector<uint8_t> stack_map; + codegen->BuildStackMaps(&stack_map); + + return new CompiledMethod(GetCompilerDriver(), + instruction_set, + allocator.GetMemory(), + codegen->GetFrameSize(), + codegen->GetCoreSpillMask(), + 0, /* FPR spill mask, unused */ + mapping_table, + stack_map); } else if (shouldOptimize && RegisterAllocator::Supports(instruction_set)) { LOG(FATAL) << "Could not allocate registers in optimizing compiler"; + return nullptr; } else { codegen->CompileBaseline(&allocator); @@ -253,29 +272,29 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite SsaLivenessAnalysis liveness(*graph, codegen); liveness.Analyze(); visualizer.DumpGraph(kLivenessPassName); - } - std::vector<uint8_t> mapping_table; - SrcMap src_mapping_table; - codegen->BuildMappingTable(&mapping_table, - GetCompilerDriver()->GetCompilerOptions().GetIncludeDebugSymbols() ? - &src_mapping_table : nullptr); - std::vector<uint8_t> vmap_table; - codegen->BuildVMapTable(&vmap_table); - std::vector<uint8_t> gc_map; - codegen->BuildNativeGCMap(&gc_map, dex_compilation_unit); - - return new CompiledMethod(GetCompilerDriver(), - instruction_set, - allocator.GetMemory(), - codegen->GetFrameSize(), - codegen->GetCoreSpillMask(), - 0, /* FPR spill mask, unused */ - &src_mapping_table, - mapping_table, - vmap_table, - gc_map, - nullptr); + std::vector<uint8_t> mapping_table; + SrcMap src_mapping_table; + codegen->BuildMappingTable(&mapping_table, + GetCompilerDriver()->GetCompilerOptions().GetIncludeDebugSymbols() ? + &src_mapping_table : nullptr); + std::vector<uint8_t> vmap_table; + codegen->BuildVMapTable(&vmap_table); + std::vector<uint8_t> gc_map; + codegen->BuildNativeGCMap(&gc_map, dex_compilation_unit); + + return new CompiledMethod(GetCompilerDriver(), + instruction_set, + allocator.GetMemory(), + codegen->GetFrameSize(), + codegen->GetCoreSpillMask(), + 0, /* FPR spill mask, unused */ + &src_mapping_table, + mapping_table, + vmap_table, + gc_map, + nullptr); + } } CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, |