Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index b1d646949ad65331eb7f4397e32778b34d91c8c2..fc7fcb9ced74fb9863870617170cda4870d60679 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -25,6 +25,7 @@ |
#include "src/profiler/profiler-listener.h" |
#include "src/profiler/tick-sample.h" |
#include "src/runtime-profiler.h" |
+#include "src/source-position-table.h" |
#include "src/string-stream.h" |
#include "src/vm-state-inl.h" |
@@ -415,10 +416,6 @@ void LowLevelLogger::CodeMovingGCEvent() { |
LogWriteBytes(&tag, sizeof(tag)); |
} |
- |
-#define JIT_LOG(Call) if (jit_logger_) jit_logger_->Call; |
- |
- |
class JitLogger : public CodeEventLogger { |
public: |
explicit JitLogger(JitCodeEventHandler code_event_handler); |
@@ -1201,35 +1198,25 @@ void Logger::CodeMoveEvent(AbstractCode* from, Address to) { |
MoveEventInternal(CodeEventListener::CODE_MOVE_EVENT, from->address(), to); |
} |
-void Logger::CodeLinePosInfoAddPositionEvent(void* jit_handler_data, |
- int pc_offset, int position) { |
- JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data, |
- pc_offset, |
- position, |
- JitCodeEvent::POSITION)); |
-} |
- |
- |
-void Logger::CodeLinePosInfoAddStatementPositionEvent(void* jit_handler_data, |
- int pc_offset, |
- int position) { |
- JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data, |
- pc_offset, |
- position, |
- JitCodeEvent::STATEMENT_POSITION)); |
-} |
- |
-void Logger::CodeStartLinePosInfoRecordEvent(void** jit_handler_data_out) { |
- *jit_handler_data_out = |
- (jit_logger_ == NULL) ? NULL : jit_logger_->StartCodePosInfoEvent(); |
-} |
- |
-void Logger::CodeEndLinePosInfoRecordEvent(AbstractCode* code, |
- void* jit_handler_data) { |
- JIT_LOG(EndCodePosInfoEvent(code, jit_handler_data)); |
+void Logger::CodeLinePosInfoRecordEvent(AbstractCode* code, |
+ ByteArray* source_position_table) { |
+ if (jit_logger_) { |
+ void* jit_handler_data = jit_logger_->StartCodePosInfoEvent(); |
+ for (SourcePositionTableIterator iter(source_position_table); !iter.done(); |
+ iter.Advance()) { |
+ if (iter.is_statement()) { |
+ jit_logger_->AddCodeLinePosInfoEvent( |
+ jit_handler_data, iter.code_offset(), iter.source_position(), |
+ JitCodeEvent::STATEMENT_POSITION); |
+ } |
+ jit_logger_->AddCodeLinePosInfoEvent(jit_handler_data, iter.code_offset(), |
+ iter.source_position(), |
+ JitCodeEvent::POSITION); |
+ } |
+ jit_logger_->EndCodePosInfoEvent(code, jit_handler_data); |
+ } |
} |
- |
void Logger::CodeNameEvent(Address addr, int pos, const char* code_name) { |
if (code_name == NULL) return; // Not a code object. |
Log::MessageBuilder msg(log_); |