From aa9b7c48069699e2aabedc6c0f62cb131fee0c73 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Tue, 17 Feb 2015 15:40:09 +0000 Subject: Have the opt. compiler set the size of "empty" frames to zero. This is to mimic Quick's behavior and honor stack frame alignment constraints after changes introduced by Change-Id I0fdb31e8c631e99091b818874a558c9aa04b1628. This issue use to make oatdump crash on oat files produced by the optimized compiler (e.g. out/host/linux-x86/framework/x86_64/core-optimizing.oat). Change-Id: I8ba52601edb0a0993eaf8923eba55aafdce5043e --- compiler/optimizing/optimizing_compiler.cc | 31 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index c518f33f53..0ece77d2d6 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -376,7 +376,10 @@ CompiledMethod* OptimizingCompiler::CompileOptimized(HGraph* graph, compiler_driver, codegen->GetInstructionSet(), ArrayRef(allocator.GetMemory()), - codegen->GetFrameSize(), + // Follow Quick's behavior and set the frame size to zero if it is + // considered "empty" (see the definition of + // art::CodeGenerator::HasEmptyFrame). + codegen->HasEmptyFrame() ? 0 : codegen->GetFrameSize(), codegen->GetCoreSpillMask(), codegen->GetFpuSpillMask(), ArrayRef(stack_map)); @@ -400,17 +403,21 @@ CompiledMethod* OptimizingCompiler::CompileBaseline( codegen->BuildNativeGCMap(&gc_map, dex_compilation_unit); compilation_stats_.RecordStat(MethodCompilationStat::kCompiledBaseline); - return CompiledMethod::SwapAllocCompiledMethod(compiler_driver, - codegen->GetInstructionSet(), - ArrayRef(allocator.GetMemory()), - codegen->GetFrameSize(), - codegen->GetCoreSpillMask(), - codegen->GetFpuSpillMask(), - &src_mapping_table, - AlignVectorSize(mapping_table), - AlignVectorSize(vmap_table), - AlignVectorSize(gc_map), - ArrayRef()); + return CompiledMethod::SwapAllocCompiledMethod( + compiler_driver, + codegen->GetInstructionSet(), + ArrayRef(allocator.GetMemory()), + // Follow Quick's behavior and set the frame size to zero if it is + // considered "empty" (see the definition of + // art::CodeGenerator::HasEmptyFrame). + codegen->HasEmptyFrame() ? 0 : codegen->GetFrameSize(), + codegen->GetCoreSpillMask(), + codegen->GetFpuSpillMask(), + &src_mapping_table, + AlignVectorSize(mapping_table), + AlignVectorSize(vmap_table), + AlignVectorSize(gc_map), + ArrayRef()); } CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, -- cgit v1.2.3-59-g8ed1b