diff options
| author | 2017-07-17 14:05:28 -0700 | |
|---|---|---|
| committer | 2017-07-17 16:54:33 -0700 | |
| commit | 0733dc87518d2c8fc1ba2196c9f5cc9729de7c20 (patch) | |
| tree | 5dfbd7beba81527b31634fa6920b8f0c1f996007 /compiler/driver/compiler_driver.cc | |
| parent | 71a8e5b25f0be5ab5bf0e1c73a9e5aabc3a23488 (diff) | |
Avoid creating verification_results_ unnecessarily
For compiler filters that don't quicken or compile, avoid creating
the verification results. This avoids creating some arrays that
were using a few MB of RAM in some cases.
For a large app verify compile:
Maximum resident set size (kbytes): 258948 -> 254300
Bug: 63467744
Test: test-art-host
Change-Id: I1d0536b2a6a5c301396641371915394cf4c0e5f3
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index c04e45d334..00a852fddf 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -514,8 +514,9 @@ static void CompileMethod(Thread* self, // TODO: Refactor the compilation to avoid having to distinguish the two passes // here. That should be done on a higher level. http://b/29089975 if (driver->GetCurrentDexToDexMethods()->IsBitSet(method_idx)) { - const VerifiedMethod* verified_method = - driver->GetVerificationResults()->GetVerifiedMethod(method_ref); + VerificationResults* results = driver->GetVerificationResults(); + DCHECK(results != nullptr); + const VerifiedMethod* verified_method = results->GetVerifiedMethod(method_ref); // Do not optimize if a VerifiedMethod is missing. SafeCast elision, // for example, relies on it. compiled_method = optimizer::ArtCompileDEX( @@ -576,12 +577,12 @@ static void CompileMethod(Thread* self, } else if ((access_flags & kAccAbstract) != 0) { // Abstract methods don't have code. } else { - const VerifiedMethod* verified_method = - driver->GetVerificationResults()->GetVerifiedMethod(method_ref); + VerificationResults* results = driver->GetVerificationResults(); + DCHECK(results != nullptr); + const VerifiedMethod* verified_method = results->GetVerifiedMethod(method_ref); bool compile = compilation_enabled && // Basic checks, e.g., not <clinit>. - driver->GetVerificationResults() - ->IsCandidateForCompilation(method_ref, access_flags) && + results->IsCandidateForCompilation(method_ref, access_flags) && // Did not fail to create VerifiedMethod metadata. verified_method != nullptr && // Do not have failures that should punt to the interpreter. |