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
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc
index 28a3f1e..5fdf9ff 100644
--- a/compiler/jit/jit_compiler.cc
+++ b/compiler/jit/jit_compiler.cc
@@ -184,10 +184,8 @@
{
TimingLogger::ScopedTiming t2("Compiling", &logger);
JitCodeCache* const code_cache = runtime->GetJit()->GetCodeCache();
- success = compiler_driver_->GetCompiler()->JitCompile(self, code_cache, method, osr);
- if (success && (jit_logger_ != nullptr)) {
- jit_logger_->WriteLog(code_cache, method, osr);
- }
+ success = compiler_driver_->GetCompiler()->JitCompile(
+ self, code_cache, method, osr, jit_logger_.get());
}
// Trim maps to reduce memory usage.