diff options
author | Andreas Gampe <agampe@google.com> | 2015-03-05 13:08:45 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-03-05 18:42:21 -0800 |
commit | 6cf49e57ad7a61e1fffd5b1dfae9179c3ca5703d (patch) | |
tree | 126d4a09078ebfb6b5eed5d67d6300217132a1bb /compiler/driver/compiler_driver.cc | |
parent | 66b26662ad0c52c648c9b5ea4a99149091e842b4 (diff) | |
download | android_art-6cf49e57ad7a61e1fffd5b1dfae9179c3ca5703d.tar.gz android_art-6cf49e57ad7a61e1fffd5b1dfae9179c3ca5703d.tar.bz2 android_art-6cf49e57ad7a61e1fffd5b1dfae9179c3ca5703d.zip |
ART: Add option to abort dex2oat on hard failure
Add an option that aborts dex2oat when a hard verifier failure occurs.
Bug: 19606409
Change-Id: I53195284e22fe6207274101e85745af763c06271
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index a52a83a28a..df2b520b50 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -358,6 +358,7 @@ CompilerDriver::CompilerDriver(const CompilerOptions* compiler_options, image_(image), image_classes_(image_classes), classes_to_compile_(compiled_classes), + had_hard_verifier_failure_(false), thread_count_(thread_count), stats_(new AOTCompilationStats), dedupe_enabled_(true), @@ -616,6 +617,11 @@ void CompilerDriver::PreCompile(jobject class_loader, const std::vector<const De Verify(class_loader, dex_files, thread_pool, timings); VLOG(compiler) << "Verify: " << GetMemoryUsageString(false); + if (had_hard_verifier_failure_ && GetCompilerOptions().AbortOnHardVerifierFailure()) { + LOG(FATAL) << "Had a hard failure verifying all classes, and was asked to abort in such " + << "situations. Please check the log."; + } + InitializeClasses(class_loader, dex_files, thread_pool, timings); VLOG(compiler) << "InitializeClasses: " << GetMemoryUsageString(false); @@ -1839,6 +1845,7 @@ static void VerifyClass(const ParallelCompilationManager* manager, size_t class_ verifier::MethodVerifier::kHardFailure) { LOG(ERROR) << "Verification failed on class " << PrettyDescriptor(descriptor) << " because: " << error_msg; + manager->GetCompiler()->SetHadHardVerifierFailure(); } } else if (!SkipClass(jclass_loader, dex_file, klass.Get())) { CHECK(klass->IsResolved()) << PrettyClass(klass.Get()); @@ -1848,6 +1855,7 @@ static void VerifyClass(const ParallelCompilationManager* manager, size_t class_ // ClassLinker::VerifyClass throws, which isn't useful in the compiler. CHECK(soa.Self()->IsExceptionPending()); soa.Self()->ClearException(); + manager->GetCompiler()->SetHadHardVerifierFailure(); } CHECK(klass->IsCompileTimeVerified() || klass->IsErroneous()) |