From 24e04aa68c575d349eac0d9d09aab9bd3106ef94 Mon Sep 17 00:00:00 2001 From: Jean Christophe Beyler Date: Fri, 12 Sep 2014 12:03:25 -0700 Subject: ART: Allow the execution to stop if the compilation fails via an option The current implementation continues the execution of the application if dex2oat fails by relying on the interpreter. This patch adds a -Xno-dex-file-fallback option to stop the default behavior. This can be used two-fold. First, one can enforce that a runtime only starts with a boot image. A follow-up patch will ensure that dex2oat (for apps) and patchoat in general request that mode and close gracefully otherwise. Second, this can be used for testing and debugging purposes, as it ensures that compiler failures & aborts are not silently ignored. Add testing. Bug: 19100590 Change-Id: Iaf07b5ccf00942ca8a8ec8687599320a3ddbc089 Signed-off-by: Jean Christophe Beyler --- runtime/parsed_options.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/parsed_options.cc') diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index 99369ca..c0c7baa 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -241,6 +241,8 @@ std::unique_ptr ParsedOptions::MakeParser(bool ignore_unrecognize .Define("-Xzygote-max-failed-boots=_") .WithType() .IntoKey(M::ZygoteMaxFailedBoots) + .Define("-Xno-dex-file-fallback") + .IntoKey(M::NoDexFileFallback) .Ignore({ "-ea", "-da", "-enableassertions", "-disableassertions", "--runtime-arg", "-esa", "-dsa", "-enablesystemassertions", "-disablesystemassertions", "-Xrs", "-Xint:_", @@ -631,6 +633,8 @@ void ParsedOptions::Usage(const char* fmt, ...) { UsageMessage(stream, " -X[no]relocate\n"); UsageMessage(stream, " -X[no]dex2oat (Whether to invoke dex2oat on the application)\n"); UsageMessage(stream, " -X[no]image-dex2oat (Whether to create and use a boot image)\n"); + UsageMessage(stream, " -Xno-dex-file-fallback " + "(Don't fall back to dex files without oat files)\n"); UsageMessage(stream, "\n"); UsageMessage(stream, "The following previously supported Dalvik options are ignored:\n"); -- cgit v1.1