summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-04-20 16:27:53 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2016-04-25 09:29:21 +0100
commit250a378d5a2152662e0fa820f2b38f794ddd3596 (patch)
tree51896bf755c3f7afd1e0616a9a54071bda6dccc0 /compiler/optimizing/optimizing_compiler.cc
parenta584db5460a31198bf621cdacf5bc304a984efa4 (diff)
Add flag to ArtMethod to skip compilation.
To ensure even the JIT will not try to compile methods with soft failures a runtime_throw. bug:28293819 bug:28313047 Change-Id: Ie3fd71ded0b77de8dab1c3c825b867cb321b8873
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 3670ce2253..37197af460 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -769,15 +769,6 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* arena,
return codegen.release();
}
-static bool CanHandleVerificationFailure(const VerifiedMethod* verified_method) {
- // For access errors the compiler will use the unresolved helpers (e.g. HInvokeUnresolved).
- uint32_t unresolved_mask = verifier::VerifyError::VERIFY_ERROR_NO_CLASS
- | verifier::VerifyError::VERIFY_ERROR_ACCESS_CLASS
- | verifier::VerifyError::VERIFY_ERROR_ACCESS_FIELD
- | verifier::VerifyError::VERIFY_ERROR_ACCESS_METHOD;
- return (verified_method->GetEncounteredVerificationFailures() & (~unresolved_mask)) == 0;
-}
-
CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item,
uint32_t access_flags,
InvokeType invoke_type,
@@ -792,7 +783,8 @@ CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item,
const VerifiedMethod* verified_method = compiler_driver->GetVerifiedMethod(&dex_file, method_idx);
DCHECK(!verified_method->HasRuntimeThrow());
if (compiler_driver->IsMethodVerifiedWithoutFailures(method_idx, class_def_idx, dex_file)
- || CanHandleVerificationFailure(verified_method)) {
+ || verifier::MethodVerifier::CanCompilerHandleVerificationFailure(
+ verified_method->GetEncounteredVerificationFailures())) {
ArenaAllocator arena(Runtime::Current()->GetArenaPool());
CodeVectorAllocator code_allocator(&arena);
std::unique_ptr<CodeGenerator> codegen(
@@ -865,6 +857,7 @@ bool OptimizingCompiler::JitCompile(Thread* self,
Handle<mirror::ClassLoader> class_loader(hs.NewHandle(
method->GetDeclaringClass()->GetClassLoader()));
Handle<mirror::DexCache> dex_cache(hs.NewHandle(method->GetDexCache()));
+ DCHECK(method->IsCompilable());
jobject jclass_loader = class_loader.ToJObject();
const DexFile* dex_file = method->GetDexFile();