diff options
| author | 2017-07-18 01:38:12 +0000 | |
|---|---|---|
| committer | 2017-07-18 01:38:12 +0000 | |
| commit | 1847704d0422dcc75ac30ae0d3caaf210c05a755 (patch) | |
| tree | dda6e4020b74e36ca17fee01e89994dd7235fde1 /compiler/driver/compiler_driver.cc | |
| parent | 269a39982997365ac4e8d2ee3d919e84f3e568d7 (diff) | |
| parent | 0733dc87518d2c8fc1ba2196c9f5cc9729de7c20 (diff) | |
Merge "Avoid creating verification_results_ unnecessarily"
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 ff92ac43b8..ba77499c0c 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. |