OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/log.h" | 5 #include "src/log.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <memory> | 8 #include <memory> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 } | 1142 } |
1143 | 1143 |
1144 void Logger::CodeLinePosInfoRecordEvent(AbstractCode* code, | 1144 void Logger::CodeLinePosInfoRecordEvent(AbstractCode* code, |
1145 ByteArray* source_position_table) { | 1145 ByteArray* source_position_table) { |
1146 if (jit_logger_) { | 1146 if (jit_logger_) { |
1147 void* jit_handler_data = jit_logger_->StartCodePosInfoEvent(); | 1147 void* jit_handler_data = jit_logger_->StartCodePosInfoEvent(); |
1148 for (SourcePositionTableIterator iter(source_position_table); !iter.done(); | 1148 for (SourcePositionTableIterator iter(source_position_table); !iter.done(); |
1149 iter.Advance()) { | 1149 iter.Advance()) { |
1150 if (iter.is_statement()) { | 1150 if (iter.is_statement()) { |
1151 jit_logger_->AddCodeLinePosInfoEvent( | 1151 jit_logger_->AddCodeLinePosInfoEvent( |
1152 jit_handler_data, iter.code_offset(), iter.source_position(), | 1152 jit_handler_data, iter.code_offset(), |
| 1153 iter.source_position().ScriptOffset(), |
1153 JitCodeEvent::STATEMENT_POSITION); | 1154 JitCodeEvent::STATEMENT_POSITION); |
1154 } | 1155 } |
1155 jit_logger_->AddCodeLinePosInfoEvent(jit_handler_data, iter.code_offset(), | 1156 jit_logger_->AddCodeLinePosInfoEvent( |
1156 iter.source_position(), | 1157 jit_handler_data, iter.code_offset(), |
1157 JitCodeEvent::POSITION); | 1158 iter.source_position().ScriptOffset(), JitCodeEvent::POSITION); |
1158 } | 1159 } |
1159 jit_logger_->EndCodePosInfoEvent(code, jit_handler_data); | 1160 jit_logger_->EndCodePosInfoEvent(code, jit_handler_data); |
1160 } | 1161 } |
1161 } | 1162 } |
1162 | 1163 |
1163 void Logger::CodeNameEvent(Address addr, int pos, const char* code_name) { | 1164 void Logger::CodeNameEvent(Address addr, int pos, const char* code_name) { |
1164 if (code_name == NULL) return; // Not a code object. | 1165 if (code_name == NULL) return; // Not a code object. |
1165 Log::MessageBuilder msg(log_); | 1166 Log::MessageBuilder msg(log_); |
1166 msg.Append("%s,%d,", | 1167 msg.Append("%s,%d,", |
1167 kLogEventsNames[CodeEventListener::SNAPSHOT_CODE_NAME_EVENT], pos); | 1168 kLogEventsNames[CodeEventListener::SNAPSHOT_CODE_NAME_EVENT], pos); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1779 | 1780 |
1780 if (profiler_listener_.get() != nullptr) { | 1781 if (profiler_listener_.get() != nullptr) { |
1781 removeCodeEventListener(profiler_listener_.get()); | 1782 removeCodeEventListener(profiler_listener_.get()); |
1782 } | 1783 } |
1783 | 1784 |
1784 return log_->Close(); | 1785 return log_->Close(); |
1785 } | 1786 } |
1786 | 1787 |
1787 } // namespace internal | 1788 } // namespace internal |
1788 } // namespace v8 | 1789 } // namespace v8 |
OLD | NEW |