summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-08-26 17:12:51 -0700
committer Andreas Gampe <agampe@google.com> 2015-08-26 19:08:03 -0700
commit0760a81257fa427646c309500d603194009265ef (patch)
tree9754389d2d488f41459c76d4568dd40dd41955ae /compiler/driver/compiler_driver.cc
parent7d6c95a7e5d431fd1b9ad49823535073325c699a (diff)
ART: Propagate verifier failure types to the compilers
Add a bit-set encoding of seen failure types to the verifier and make it available. Store this in VerifiedMethod, so that compilers can inspect it and make choices based on failures. Rewrite the current punting of runtime-throw errors to be at the compiler-driver level. Bug: 23502994 Change-Id: I1cfc7cbdf2aec1f14ba18f0169e432ba4ae16883
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index fa25a17481..d2fc4ea228 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -590,14 +590,18 @@ static void CompileMethod(Thread* self,
} else if ((access_flags & kAccAbstract) != 0) {
// Abstract methods don't have code.
} else {
- bool has_verified_method = driver->GetVerificationResults()
- ->GetVerifiedMethod(method_ref) != nullptr;
+ const VerifiedMethod* verified_method =
+ driver->GetVerificationResults()->GetVerifiedMethod(method_ref);
bool compile = compilation_enabled &&
// Basic checks, e.g., not <clinit>.
driver->GetVerificationResults()
->IsCandidateForCompilation(method_ref, access_flags) &&
// Did not fail to create VerifiedMethod metadata.
- has_verified_method &&
+ verified_method != nullptr &&
+ // Do not have failures that should punt to the interpreter.
+ !verified_method->HasRuntimeThrow() &&
+ (verified_method->GetEncounteredVerificationFailures() &
+ verifier::VERIFY_ERROR_FORCE_INTERPRETER) == 0 &&
// Is eligable for compilation by methods-to-compile filter.
driver->IsMethodToCompile(method_ref);
if (compile) {
@@ -620,7 +624,7 @@ static void CompileMethod(Thread* self,
method_idx,
class_loader,
dex_file,
- has_verified_method
+ (verified_method != nullptr)
? dex_to_dex_compilation_level
: optimizer::DexToDexCompilationLevel::kRequired);
}