summaryrefslogtreecommitdiff
path: root/compiler/dex/quick/codegen_util.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2014-12-03 17:38:22 -0800
committer Mathieu Chartier <mathieuc@google.com> 2014-12-03 18:27:43 -0800
commitab972ef472001fa113d54486d7592979e33480b3 (patch)
tree08a8bf01ddfc0fd3a012faac2b49fafa5853e56f /compiler/dex/quick/codegen_util.cc
parent8b9a97e8b6ed97ff1991596cbd0f7ce78f004766 (diff)
Remove method verification results right after compiling a method
This saves memory since it allows the code arrays from methods compiled in future methods to use the ram we just freed from the verification results. GmsCore.apk: Before: dex2oat took 77.383s (threads: 2) arena alloc=6MB java alloc=30MB native alloc=77MB free=13KB After: dex2oat took 72.180s (threads: 2) arena alloc=6MB java alloc=30MB native alloc=60MB free=13KB Bug: 18596910 Change-Id: I5d6df380e4fe58751a2b304202083f4d30b33b7c (cherry picked from commit 25fda92083d5b93b38cc1f6b12ac6a44d992d6a4)
Diffstat (limited to 'compiler/dex/quick/codegen_util.cc')
-rw-r--r--compiler/dex/quick/codegen_util.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc
index 58bcee2124..00217549b0 100644
--- a/compiler/dex/quick/codegen_util.cc
+++ b/compiler/dex/quick/codegen_util.cc
@@ -775,6 +775,10 @@ void Mir2Lir::CreateNativeGcMap() {
": " << PrettyMethod(cu_->method_idx, *cu_->dex_file);
native_gc_map_builder.AddEntry(native_offset, references);
}
+
+ // Maybe not necessary, but this could help prevent errors where we access the verified method
+ // after it has been deleted.
+ mir_graph_->GetCurrentDexCompilationUnit()->ClearVerifiedMethod();
}
/* Determine the offset of each literal field */