Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: src/log.cc

Issue 2248673002: Avoid accessing Isolate in source position logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « src/log.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698