diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-07-04 09:43:26 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-07-04 09:58:43 +0100 |
commit | 8fb5ce3a7e1dec587642f900be86729c10224174 (patch) | |
tree | 7a7ac9085efa8d7b6aa6916de5edfa71adf9a5ab /compiler/optimizing/optimizing_compiler.cc | |
parent | d83ee1e26f68409f904c3cf0d582c18738e1f39b (diff) | |
download | art-8fb5ce3a7e1dec587642f900be86729c10224174.tar.gz art-8fb5ce3a7e1dec587642f900be86729c10224174.tar.bz2 art-8fb5ce3a7e1dec587642f900be86729c10224174.zip |
Do not attempt to compile on architectures we do not support.
Change-Id: I431edff0a753a7fa37c79bdf7ab918d6747667a4
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) { |