diff options
| author | 2014-07-04 09:00:17 +0000 | |
|---|---|---|
| committer | 2014-07-02 20:49:53 +0000 | |
| commit | dda2f058db00deb1074ac44380c4637fc4417a0f (patch) | |
| tree | 7a7ac9085efa8d7b6aa6916de5edfa71adf9a5ab /compiler/optimizing/optimizing_compiler.cc | |
| parent | d83ee1e26f68409f904c3cf0d582c18738e1f39b (diff) | |
| parent | 8fb5ce3a7e1dec587642f900be86729c10224174 (diff) | |
Merge "Do not attempt to compile on architectures we do not support."
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
| -rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index ccacbef401..b4d7fff178 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -77,6 +77,17 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite uint32_t method_idx, jobject class_loader, const DexFile& dex_file) const { + InstructionSet instruction_set = GetCompilerDriver()->GetInstructionSet(); + // The optimizing compiler currently does not have a Thumb2 assembler. + if (instruction_set == kThumb2) { + instruction_set = kArm; + } + + // Do not attempt to compile on architectures we do not support. + if (instruction_set != kX86 && instruction_set != kX86_64 && instruction_set != kArm) { + return nullptr; + } + DexCompilationUnit dex_compilation_unit( nullptr, class_loader, art::Runtime::Current()->GetClassLinker(), dex_file, code_item, class_def_idx, method_idx, access_flags, @@ -100,11 +111,6 @@ CompiledMethod* OptimizingCompiler::TryCompile(const DexFile::CodeItem* code_ite return nullptr; } - InstructionSet instruction_set = GetCompilerDriver()->GetInstructionSet(); - // The optimizing compiler currently does not have a Thumb2 assembler. - if (instruction_set == kThumb2) { - instruction_set = kArm; - } CodeGenerator* codegen = CodeGenerator::Create(&arena, graph, instruction_set); if (codegen == nullptr) { if (shouldCompile) { |