ART: More header cleanup - method_verifier.h
Move enumerations to own header. Move the compiler interface (of what
the compiler can tolerate) into its own header. Replace or remove
method_verifier.h where possible.
Test: mmma art
Change-Id: I075fcb10b02b6c1c760daad31cb18eaa42067b6d
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 805c5da..f77b3dd 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -78,8 +78,8 @@
#include "vdex_file.h"
#include "verifier/method_verifier.h"
#include "verifier/method_verifier-inl.h"
-#include "verifier/verifier_log_mode.h"
#include "verifier/verifier_deps.h"
+#include "verifier/verifier_enums.h"
namespace art {
@@ -2132,7 +2132,7 @@
hs.NewHandle(soa.Decode<mirror::ClassLoader>(jclass_loader)));
Handle<mirror::Class> klass(
hs.NewHandle(class_linker->FindClass(soa.Self(), descriptor, class_loader)));
- verifier::MethodVerifier::FailureKind failure_kind;
+ verifier::FailureKind failure_kind;
if (klass == nullptr) {
CHECK(soa.Self()->IsExceptionPending());
soa.Self()->ClearException();
@@ -2155,7 +2155,7 @@
true /* allow soft failures */,
log_level_,
&error_msg);
- if (failure_kind == verifier::MethodVerifier::kHardFailure) {
+ if (failure_kind == verifier::FailureKind::kHardFailure) {
LOG(ERROR) << "Verification failed on class " << PrettyDescriptor(descriptor)
<< " because: " << error_msg;
manager_->GetCompiler()->SetHadHardVerifierFailure();
@@ -2163,10 +2163,10 @@
// Force a soft failure for the VerifierDeps. This is a sanity measure, as
// the vdex file already records that the class hasn't been resolved. It avoids
// trying to do future verification optimizations when processing the vdex file.
- DCHECK(failure_kind == verifier::MethodVerifier::kSoftFailure ||
- failure_kind == verifier::MethodVerifier::kNoFailure)
+ DCHECK(failure_kind == verifier::FailureKind::kSoftFailure ||
+ failure_kind == verifier::FailureKind::kNoFailure)
<< failure_kind;
- failure_kind = verifier::MethodVerifier::kSoftFailure;
+ failure_kind = verifier::FailureKind::kSoftFailure;
}
} else if (!SkipClass(jclass_loader, dex_file, klass.Get())) {
CHECK(klass->IsResolved()) << klass->PrettyClass();
@@ -2198,16 +2198,16 @@
<< " failed to fully verify: state= " << klass->GetStatus();
}
if (klass->IsVerified()) {
- DCHECK_EQ(failure_kind, verifier::MethodVerifier::kNoFailure);
+ DCHECK_EQ(failure_kind, verifier::FailureKind::kNoFailure);
} else if (klass->ShouldVerifyAtRuntime()) {
- DCHECK_EQ(failure_kind, verifier::MethodVerifier::kSoftFailure);
+ DCHECK_EQ(failure_kind, verifier::FailureKind::kSoftFailure);
} else {
- DCHECK_EQ(failure_kind, verifier::MethodVerifier::kHardFailure);
+ DCHECK_EQ(failure_kind, verifier::FailureKind::kHardFailure);
}
}
} else {
// Make the skip a soft failure, essentially being considered as verify at runtime.
- failure_kind = verifier::MethodVerifier::kSoftFailure;
+ failure_kind = verifier::FailureKind::kSoftFailure;
}
verifier::VerifierDeps::MaybeRecordVerificationStatus(
dex_file, class_def.class_idx_, failure_kind);
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc
index 1781643..af60def 100644
--- a/compiler/oat_writer.cc
+++ b/compiler/oat_writer.cc
@@ -55,7 +55,6 @@
#include "type_lookup_table.h"
#include "utils/dex_cache_arrays_layout-inl.h"
#include "vdex_file.h"
-#include "verifier/method_verifier.h"
#include "verifier/verifier_deps.h"
#include "zip_archive.h"
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 8aad539..065c11e 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -98,7 +98,7 @@
#include "ssa_liveness_analysis.h"
#include "ssa_phi_elimination.h"
#include "utils/assembler.h"
-#include "verifier/method_verifier.h"
+#include "verifier/verifier_compiler_binding.h"
namespace art {
@@ -1041,7 +1041,7 @@
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)
- || verifier::MethodVerifier::CanCompilerHandleVerificationFailure(
+ || verifier::CanCompilerHandleVerificationFailure(
verified_method->GetEncounteredVerificationFailures())) {
ArenaAllocator arena(Runtime::Current()->GetArenaPool());
CodeVectorAllocator code_allocator(&arena);
diff --git a/compiler/verifier_deps_test.cc b/compiler/verifier_deps_test.cc
index 0b1ab75..4d55eb0 100644
--- a/compiler/verifier_deps_test.cc
+++ b/compiler/verifier_deps_test.cc
@@ -28,12 +28,13 @@
#include "driver/compiler_options.h"
#include "driver/compiler_driver.h"
#include "handle_scope-inl.h"
-#include "verifier/method_verifier-inl.h"
+#include "indenter.h"
#include "mirror/class_loader.h"
#include "runtime.h"
-#include "thread.h"
#include "scoped_thread_state_change-inl.h"
+#include "thread.h"
#include "utils/atomic_method_ref_map-inl.h"
+#include "verifier/method_verifier-inl.h"
namespace art {
namespace verifier {