diff options
author | Zheng Xu <zheng.xu@arm.com> | 2014-10-23 18:29:55 +0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-10-24 16:27:22 -0700 |
commit | 5667fdbb6e441dee7534ade18b628ed396daf593 (patch) | |
tree | a06fe0a79b3465571556d13f509daf1f664fc614 /compiler/optimizing/optimizing_compiler.cc | |
parent | b62ff579cd870b0bf213765b07d7b404d15ece7b (diff) | |
download | art-5667fdbb6e441dee7534ade18b628ed396daf593.tar.gz art-5667fdbb6e441dee7534ade18b628ed396daf593.tar.bz2 art-5667fdbb6e441dee7534ade18b628ed396daf593.zip |
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
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 21 |
1 files changed, 14 insertions, 7 deletions
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); |