diff options
author | Dave Allison <dallison@google.com> | 2014-06-23 14:46:53 -0700 |
---|---|---|
committer | Dave Allison <dallison@google.com> | 2014-06-23 15:24:55 -0700 |
commit | ca3aabac5748c256c42839dd16e8c80a09d99a48 (patch) | |
tree | d96cb1643a4e544289a1a3b31d35cd24a7126660 /dex2oat | |
parent | 9462a31caedefac3e04bd4aa5088e050ed188b30 (diff) | |
download | android_art-ca3aabac5748c256c42839dd16e8c80a09d99a48.tar.gz android_art-ca3aabac5748c256c42839dd16e8c80a09d99a48.tar.bz2 android_art-ca3aabac5748c256c42839dd16e8c80a09d99a48.zip |
Fix implicit check option handling for non-cross-compiles
This fixes an issue where the compiler was not being told to
generate implicit checks but the runtime was expecting them.
Bug: 15747876
Change-Id: I65e7475bac245c44d5094eb666d67bc1af327ab1
Diffstat (limited to 'dex2oat')
-rw-r--r-- | dex2oat/dex2oat.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 5f3cd92824..38051ea5b8 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -748,6 +748,7 @@ void CheckExplicitCheckOptions(InstructionSet isa, bool* explicit_null_checks, bool* explicit_so_checks, bool* explicit_suspend_checks) { switch (isa) { case kArm: + case kThumb2: break; // All checks implemented, leave as is. default: // No checks implemented, reset all to explicit checks. @@ -1039,8 +1040,8 @@ static int dex2oat(int argc, char** argv) { } else { Usage("--implicit-checks passed non-recognized value %s", val.c_str()); } - has_explicit_checks_options = true; } + has_explicit_checks_options = true; } else { Usage("Unknown argument %s", option.data()); } @@ -1170,6 +1171,7 @@ static int dex2oat(int argc, char** argv) { CheckExplicitCheckOptions(instruction_set, &explicit_null_checks, &explicit_so_checks, &explicit_suspend_checks); + LOG(INFO) << "init compiler options for explicit null: " << explicit_null_checks; CompilerOptions compiler_options(compiler_filter, huge_method_threshold, large_method_threshold, @@ -1256,7 +1258,17 @@ static int dex2oat(int argc, char** argv) { // TODO: Not sure whether it's a good idea to allow anything else but the runtime option in // this case at all, as we'll have to throw away produced code for a mismatch. if (!has_explicit_checks_options) { - if (instruction_set == kRuntimeISA) { + bool cross_compiling = true; + switch (kRuntimeISA) { + case kArm: + case kThumb2: + cross_compiling = instruction_set != kArm && instruction_set != kThumb2; + break; + default: + cross_compiling = instruction_set != kRuntimeISA; + break; + } + if (!cross_compiling) { Runtime* runtime = Runtime::Current(); compiler_options.SetExplicitNullChecks(runtime->ExplicitNullChecks()); compiler_options.SetExplicitStackOverflowChecks(runtime->ExplicitStackOverflowChecks()); |