diff options
author | 2017-07-19 15:05:49 +0100 | |
---|---|---|
committer | 2017-07-19 15:05:49 +0100 | |
commit | 01db5f78f627cc64f80b0c0a4eedd0a3dc8b46ca (patch) | |
tree | d1ee9267408e2f4d777d28bfc3f65c480f7ecd3f /compiler/optimizing/optimizing_compiler.cc | |
parent | c5b1b067fb91c10c75dd0e6dbfd91bebe74347d5 (diff) |
Pass the logger to the JIT compiler.
To avoid effects of concurrent method entrypoints update,
just pass the logger to the JIT compiler, which will invoke
it directly with the pointer to the newly allocated code.
Test: test.py --trace
Change-Id: I5fbcd7cbc948b7d46c98c1545d6e530fb1190602
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 890ba674b5..b76a0df861 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -76,6 +76,7 @@ #include "jit/debugger_interface.h" #include "jit/jit.h" #include "jit/jit_code_cache.h" +#include "jit/jit_logger.h" #include "jni/quick/jni_compiler.h" #include "licm.h" #include "load_store_analysis.h" @@ -334,7 +335,11 @@ class OptimizingCompiler FINAL : public Compiler { } } - bool JitCompile(Thread* self, jit::JitCodeCache* code_cache, ArtMethod* method, bool osr) + bool JitCompile(Thread* self, + jit::JitCodeCache* code_cache, + ArtMethod* method, + bool osr, + jit::JitLogger* jit_logger) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_); @@ -1136,7 +1141,8 @@ bool CanEncodeInlinedMethodInStackMap(const DexFile& caller_dex_file, ArtMethod* bool OptimizingCompiler::JitCompile(Thread* self, jit::JitCodeCache* code_cache, ArtMethod* method, - bool osr) { + bool osr, + jit::JitLogger* jit_logger) { StackHandleScope<3> hs(self); Handle<mirror::ClassLoader> class_loader(hs.NewHandle( method->GetDeclaringClass()->GetClassLoader())); @@ -1272,6 +1278,9 @@ bool OptimizingCompiler::JitCompile(Thread* self, } Runtime::Current()->GetJit()->AddMemoryUsage(method, arena.BytesUsed()); + if (jit_logger != nullptr) { + jit_logger->WriteLog(code, code_allocator.GetSize(), method); + } return true; } |