diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-03-09 22:15:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-03-09 22:15:19 +0000 |
commit | 54a8cc689dc23f346c9aac0d5fc6f47e61df8cad (patch) | |
tree | 821954efb4addc26406dd6dc54a969e8e75c1f07 /compiler/jit/jit_compiler.cc | |
parent | b3226684f0ee69094f896cb99a9d1f12585eac42 (diff) | |
parent | 9b34b244ecddd8a35c922ed87bc3df0ca4db0282 (diff) | |
download | art-54a8cc689dc23f346c9aac0d5fc6f47e61df8cad.tar.gz art-54a8cc689dc23f346c9aac0d5fc6f47e61df8cad.tar.bz2 art-54a8cc689dc23f346c9aac0d5fc6f47e61df8cad.zip |
Merge "Trim arenas for JIT"
Diffstat (limited to 'compiler/jit/jit_compiler.cc')
-rw-r--r-- | compiler/jit/jit_compiler.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index 04efa21f4e..a63e14a980 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -103,7 +103,7 @@ JitCompiler::~JitCompiler() { } bool JitCompiler::CompileMethod(Thread* self, mirror::ArtMethod* method) { - uint64_t start_time = NanoTime(); + const uint64_t start_time = NanoTime(); StackHandleScope<2> hs(self); self->AssertNoPendingException(); Runtime* runtime = Runtime::Current(); @@ -130,6 +130,8 @@ bool JitCompiler::CompileMethod(Thread* self, mirror::ArtMethod* method) { } } CompiledMethod* compiled_method(compiler_driver_->CompileMethod(self, h_method.Get())); + // Trim maps to reduce memory usage, TODO: measure how much this increases compile time. + runtime->GetArenaPool()->TrimMaps(); if (compiled_method == nullptr) { return false; } @@ -137,7 +139,7 @@ bool JitCompiler::CompileMethod(Thread* self, mirror::ArtMethod* method) { // Don't add the method if we are supposed to be deoptimized. bool result = false; if (!runtime->GetInstrumentation()->AreAllMethodsDeoptimized()) { - const void* code = Runtime::Current()->GetClassLinker()->GetOatMethodQuickCodeFor( + const void* code = runtime->GetClassLinker()->GetOatMethodQuickCodeFor( h_method.Get()); if (code != nullptr) { // Already have some compiled code, just use this instead of linking. |