diff options
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index f52f50eda5..01465f08e9 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -350,6 +350,7 @@ CompilerDriver::CompilerDriver(const CompilerOptions* compiler_options, verification_results_(verification_results), method_inliner_map_(method_inliner_map), compiler_(Compiler::Create(this, compiler_kind)), + compiler_kind_(compiler_kind), instruction_set_(instruction_set), instruction_set_features_(instruction_set_features), freezing_constructor_lock_("freezing constructor lock"), @@ -2272,8 +2273,11 @@ void CompilerDriver::CompileMethod(Thread* self, const DexFile::CodeItem* code_i DCHECK(GetCompiledMethod(method_ref) != nullptr) << PrettyMethod(method_idx, dex_file); } - // Done compiling, delete the verified method to reduce native memory usage. - verification_results_->RemoveVerifiedMethod(method_ref); + // Done compiling, delete the verified method to reduce native memory usage. Do not delete in + // optimizing compiler, which may need the verified method again for inlining. + if (compiler_kind_ != Compiler::kOptimizing) { + verification_results_->RemoveVerifiedMethod(method_ref); + } if (self->IsExceptionPending()) { ScopedObjectAccess soa(self); |