From 5667fdbb6e441dee7534ade18b628ed396daf593 Mon Sep 17 00:00:00 2001 From: Zheng Xu Date: Thu, 23 Oct 2014 18:29:55 +0800 Subject: ARM: Use hardfp calling convention between java to java call. This patch default to use hardfp calling convention. Softfp can be enabled by setting kArm32QuickCodeUseSoftFloat to true. We get about -1 ~ +5% performance improvement with different benchmark tests. Hopefully, we should be able to get more performance by address the left TODOs, as some part of the code takes the original assumption which is not optimal. DONE: 1. Interpreter to quick code 2. Quick code to interpreter 3. Transition assembly and callee-saves 4. Trampoline(generic jni, resolution, invoke with access check and etc.) 5. Pass fp arg reg following aapcs(gpr and stack do not follow aapcs) 6. Quick helper assembly routines to handle ABI differences 7. Quick code method entry 8. Quick code method invocation 9. JNI compiler TODO: 10. Rework ArgMap, FlushIn, GenDalvikArgs and affected common code. 11. Rework CallRuntimeHelperXXX(). Change-Id: I9965d8a007f4829f2560b63bcbbde271bdcf6ec2 --- compiler/optimizing/optimizing_compiler.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 80e9cdb16f..0555c00e33 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -233,23 +233,30 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite bool shouldOptimize = dex_compilation_unit.GetSymbol().find("00024reg_00024") != std::string::npos; + if (instruction_set == kThumb2 && !kArm32QuickCodeUseSoftFloat) { + uint32_t shorty_len; + const char* shorty = dex_compilation_unit.GetShorty(&shorty_len); + for (uint32_t i = 0; i < shorty_len; ++i) { + if (shorty[i] == 'D' || shorty[i] == 'F') { + CHECK(!shouldCompile) << "Hard float ARM32 parameters are not yet supported"; + return nullptr; + } + } + } + ArenaPool pool; ArenaAllocator arena(&pool); HGraphBuilder builder(&arena, &dex_compilation_unit, &dex_file, GetCompilerDriver()); HGraph* graph = builder.BuildGraph(*code_item); if (graph == nullptr) { - if (shouldCompile) { - LOG(FATAL) << "Could not build graph in optimizing compiler"; - } + CHECK(!shouldCompile) << "Could not build graph in optimizing compiler"; return nullptr; } CodeGenerator* codegen = CodeGenerator::Create(&arena, graph, instruction_set); if (codegen == nullptr) { - if (shouldCompile) { - LOG(FATAL) << "Could not find code generator for optimizing compiler"; - } + CHECK(!shouldCompile) << "Could not find code generator for optimizing compiler"; return nullptr; } @@ -305,7 +312,7 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite stack_map); } else if (shouldOptimize && RegisterAllocator::Supports(instruction_set)) { LOG(FATAL) << "Could not allocate registers in optimizing compiler"; - return nullptr; + UNREACHABLE(); } else { unoptimized_compiled_methods_++; codegen->CompileBaseline(&allocator); -- cgit v1.2.3-59-g8ed1b