summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Jeff Hao <jeffhao@google.com> 2015-04-06 23:08:41 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-04-06 23:08:42 +0000
commit425ee0e1103b52bb72132df64f503725d1a15300 (patch)
tree15b1628b1d68abf2f4a44dce941715df438eb15f /compiler/driver/compiler_driver.cc
parenta728627be3fad188a50f24e8d2032c78a8d58aca (diff)
parent48699fb0b0662d9a4fa593d0bd2a7d5ace83e34e (diff)
Merge "Prevent verified method from being deleted by compiler driver."
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index b32e1f2469..f6b217a635 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"),
@@ -2270,8 +2271,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);