Avoid creating verified methods for non quickening filters
Filters that don't do either quickening or compiling don't need
verified methods. Avoiding allocating these saves a non-trivial
amount of RAM during compilation.
Before (PSS compiling a very large app):
Peak PSS: 215014K, native RAM 59378392B
After:
Peak PSS: 207815K, native RAM 52917928B
Bug: 63467744
Test: Compile an app with compiler-filter=verify
Test: test-art-host
Change-Id: I493a1c4a8a152b835d5e950192974c4da5b96ae3
diff --git a/compiler/dex/verification_results.cc b/compiler/dex/verification_results.cc
index 04ceca0..183c955 100644
--- a/compiler/dex/verification_results.cc
+++ b/compiler/dex/verification_results.cc
@@ -46,6 +46,10 @@
void VerificationResults::ProcessVerifiedMethod(verifier::MethodVerifier* method_verifier) {
DCHECK(method_verifier != nullptr);
+ if (!compiler_options_->IsAnyCompilationEnabled()) {
+ // Verified methods are only required for quickening and compilation.
+ return;
+ }
MethodReference ref = method_verifier->GetMethodReference();
std::unique_ptr<const VerifiedMethod> verified_method(VerifiedMethod::Create(method_verifier));
if (verified_method == nullptr) {
@@ -98,6 +102,7 @@
const VerifiedMethod* VerificationResults::GetVerifiedMethod(MethodReference ref) {
const VerifiedMethod* ret = nullptr;
+ DCHECK(compiler_options_->IsAnyCompilationEnabled());
if (atomic_verified_methods_.Get(ref, &ret)) {
return ret;
}