summaryrefslogtreecommitdiff
path: root/compiler/jit/jit_logger.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2017-07-19 15:05:49 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2017-07-19 15:05:49 +0100
commit01db5f78f627cc64f80b0c0a4eedd0a3dc8b46ca (patch)
treed1ee9267408e2f4d777d28bfc3f65c480f7ecd3f /compiler/jit/jit_logger.cc
parentc5b1b067fb91c10c75dd0e6dbfd91bebe74347d5 (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/jit/jit_logger.cc')
-rw-r--r--compiler/jit/jit_logger.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/compiler/jit/jit_logger.cc b/compiler/jit/jit_logger.cc
index aa4f66773a..2199b64139 100644
--- a/compiler/jit/jit_logger.cc
+++ b/compiler/jit/jit_logger.cc
@@ -50,11 +50,8 @@ void JitLogger::OpenPerfMapLog() {
}
}
-void JitLogger::WritePerfMapLog(JitCodeCache* code_cache, ArtMethod* method, bool osr) {
+void JitLogger::WritePerfMapLog(const void* ptr, size_t code_size, ArtMethod* method) {
if (perf_file_ != nullptr) {
- 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();
std::ostringstream stream;
@@ -270,11 +267,8 @@ void JitLogger::OpenJitDumpLog() {
WriteJitDumpHeader();
}
-void JitLogger::WriteJitDumpLog(JitCodeCache* code_cache, ArtMethod* method, bool osr) {
+void JitLogger::WriteJitDumpLog(const void* ptr, size_t code_size, ArtMethod* method) {
if (jit_dump_file_ != nullptr) {
- 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();
PerfJitCodeLoad jit_code;
@@ -285,7 +279,7 @@ void JitLogger::WriteJitDumpLog(JitCodeCache* code_cache, ArtMethod* method, boo
jit_code.process_id_ = static_cast<uint32_t>(getpid());
jit_code.thread_id_ = static_cast<uint32_t>(art::GetTid());
jit_code.vma_ = 0x0;
- jit_code.code_address_ = reinterpret_cast<uint64_t>(code);
+ jit_code.code_address_ = reinterpret_cast<uint64_t>(ptr);
jit_code.code_size_ = code_size;
jit_code.code_id_ = code_index_++;
@@ -297,7 +291,7 @@ void JitLogger::WriteJitDumpLog(JitCodeCache* code_cache, ArtMethod* method, boo
// Use UNUSED() here to avoid compiler warnings.
UNUSED(jit_dump_file_->WriteFully(reinterpret_cast<const char*>(&jit_code), sizeof(jit_code)));
UNUSED(jit_dump_file_->WriteFully(method_name.c_str(), method_name.size() + 1));
- UNUSED(jit_dump_file_->WriteFully(code, code_size));
+ UNUSED(jit_dump_file_->WriteFully(ptr, code_size));
WriteJitDumpDebugInfo();
}