diff options
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index b709da3..b8d1493 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -573,6 +573,38 @@ bool ClassLinker::GenerateOatFile(const char* dex_filename, argv.push_back("-classpath"); argv.push_back("--runtime-arg"); argv.push_back(Runtime::Current()->GetClassPathString()); + + argv.push_back("--runtime-arg"); + std::string checkstr = "-implicit-checks"; + + int nchecks = 0; + char checksep = ':'; + + if (!Runtime::Current()->ExplicitNullChecks()) { + checkstr += checksep; + checksep = ','; + checkstr += "null"; + ++nchecks; + } + if (!Runtime::Current()->ExplicitSuspendChecks()) { + checkstr += checksep; + checksep = ','; + checkstr += "suspend"; + ++nchecks; + } + + if (!Runtime::Current()->ExplicitStackOverflowChecks()) { + checkstr += checksep; + checksep = ','; + checkstr += "stack"; + ++nchecks; + } + + if (nchecks == 0) { + checkstr += ":none"; + } + argv.push_back(checkstr); + if (!kIsTargetBuild) { argv.push_back("--host"); } |