diff options
| -rw-r--r-- | compiler/jit/jit_compiler.cc | 2 | ||||
| -rw-r--r-- | compiler/jit/jit_logger.cc | 11 | ||||
| -rw-r--r-- | compiler/jit/jit_logger.h | 10 |
3 files changed, 13 insertions, 10 deletions
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index eaac0b40f5..cbd831a60f 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -211,7 +211,7 @@ bool JitCompiler::CompileMethod(Thread* self, ArtMethod* method, bool osr) { 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); + jit_logger_->WriteLog(code_cache, method, osr); } } diff --git a/compiler/jit/jit_logger.cc b/compiler/jit/jit_logger.cc index 9ce3b0cfe8..aa4f66773a 100644 --- a/compiler/jit/jit_logger.cc +++ b/compiler/jit/jit_logger.cc @@ -23,6 +23,7 @@ #include "driver/compiler_driver.h" #include "jit/jit.h" #include "jit/jit_code_cache.h" +#include "oat_file-inl.h" namespace art { namespace jit { @@ -49,9 +50,10 @@ void JitLogger::OpenPerfMapLog() { } } -void JitLogger::WritePerfMapLog(JitCodeCache* code_cache, ArtMethod* method) { +void JitLogger::WritePerfMapLog(JitCodeCache* code_cache, ArtMethod* method, bool osr) { if (perf_file_ != nullptr) { - const void* ptr = method->GetEntryPointFromQuickCompiledCode(); + const void* ptr = osr ? code_cache->LookupOsrMethodHeader(method)->GetCode() + : method->GetEntryPointFromQuickCompiledCode(); size_t code_size = code_cache->GetMemorySizeOfCodePointer(ptr); std::string method_name = method->PrettyMethod(); @@ -268,9 +270,10 @@ void JitLogger::OpenJitDumpLog() { WriteJitDumpHeader(); } -void JitLogger::WriteJitDumpLog(JitCodeCache* code_cache, ArtMethod* method) { +void JitLogger::WriteJitDumpLog(JitCodeCache* code_cache, ArtMethod* method, bool osr) { if (jit_dump_file_ != nullptr) { - const void* code = method->GetEntryPointFromQuickCompiledCode(); + const void* code = osr ? code_cache->LookupOsrMethodHeader(method)->GetCode() + : method->GetEntryPointFromQuickCompiledCode(); size_t code_size = code_cache->GetMemorySizeOfCodePointer(code); std::string method_name = method->PrettyMethod(); diff --git a/compiler/jit/jit_logger.h b/compiler/jit/jit_logger.h index 0f8cfe4e2f..460864e8a9 100644 --- a/compiler/jit/jit_logger.h +++ b/compiler/jit/jit_logger.h @@ -94,10 +94,10 @@ class JitLogger { OpenJitDumpLog(); } - void WriteLog(JitCodeCache* code_cache, ArtMethod* method) + void WriteLog(JitCodeCache* code_cache, ArtMethod* method, bool osr) REQUIRES_SHARED(Locks::mutator_lock_) { - WritePerfMapLog(code_cache, method); - WriteJitDumpLog(code_cache, method); + WritePerfMapLog(code_cache, method, osr); + WriteJitDumpLog(code_cache, method, osr); } void CloseLog() { @@ -108,13 +108,13 @@ class JitLogger { private: // For perf-map profiling void OpenPerfMapLog(); - void WritePerfMapLog(JitCodeCache* code_cache, ArtMethod* method) + void WritePerfMapLog(JitCodeCache* code_cache, ArtMethod* method, bool osr) REQUIRES_SHARED(Locks::mutator_lock_); void ClosePerfMapLog(); // For perf-inject profiling void OpenJitDumpLog(); - void WriteJitDumpLog(JitCodeCache* code_cache, ArtMethod* method) + void WriteJitDumpLog(JitCodeCache* code_cache, ArtMethod* method, bool osr) REQUIRES_SHARED(Locks::mutator_lock_); void CloseJitDumpLog(); |