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

Unified Diff: src/log.cc

Issue 11552033: This patch is the propagation version of https://codereview.chromium.org/10824032 patch (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 11 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
« src/log.h ('K') | « src/log.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
===================================================================
--- src/log.cc (revision 13419)
+++ src/log.cc (working copy)
@@ -455,6 +455,7 @@
address_to_name_map_(NULL),
is_initialized_(false),
code_event_handler_(NULL),
+ support_moved_code_(true),
last_address_(NULL),
prev_sp_(NULL),
prev_function_(NULL),
@@ -472,12 +473,15 @@
void Logger::IssueCodeAddedEvent(Code* code,
+ Script* script,
const char* name,
size_t name_len) {
JitCodeEvent event;
+ memset(&event, 0, sizeof(event));
event.type = JitCodeEvent::CODE_ADDED;
event.code_start = code->instruction_start();
event.code_len = code->instruction_size();
+ event.script = v8::Handle<v8::Script>(reinterpret_cast<v8::Script*>(script));
event.name.str = name;
event.name.len = name_len;
@@ -516,7 +520,38 @@
code_event_handler_(&event);
}
+void Logger::IssueAddCodeLinePosInfoEvent(void* line_info,
+ int pc_offset,
+ int position,
+ JitCodeEvent::PositionType
+ position_type) {
danno 2013/02/01 13:43:10 nit: indentation
+ JitCodeEvent event;
+ event.type = JitCodeEvent::CODE_ADD_LINE_POS_INFO;
+ event.user_data = line_info;
+ event.line_info.offset = pc_offset;
+ event.line_info.pos = position;
+ event.line_info.position_type = position_type;
+ code_event_handler_(&event);
+}
+
+void* Logger::IssueStartCodePosInfoEvent() {
+ JitCodeEvent event;
+ event.type = JitCodeEvent::CODE_START_LINE_INFO_RECORDING;
+
+ code_event_handler_(&event);
+ return event.user_data;
+}
+
+void Logger::IssueEndCodePosInfoEvent(Code* code, void* line_info) {
+ JitCodeEvent event;
+ event.type = JitCodeEvent::CODE_END_LINE_INFO_RECORDING;
+ event.code_start = code->instruction_start();
+ event.user_data = line_info;
+
+ code_event_handler_(&event);
+}
+
#define DECLARE_EVENT(ignore1, name) name,
static const char* const kLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS] = {
LOG_EVENTS_AND_TAGS_LIST(DECLARE_EVENT)
@@ -900,7 +935,7 @@
name_buffer_->AppendBytes(comment);
}
if (code_event_handler_ != NULL) {
- IssueCodeAddedEvent(code, name_buffer_->get(), name_buffer_->size());
+ IssueCodeAddedEvent(code, NULL, name_buffer_->get(), name_buffer_->size());
}
if (!log_->IsEnabled()) return;
if (FLAG_ll_prof) {
@@ -940,7 +975,7 @@
name_buffer_->AppendString(name);
}
if (code_event_handler_ != NULL) {
- IssueCodeAddedEvent(code, name_buffer_->get(), name_buffer_->size());
+ IssueCodeAddedEvent(code, NULL, name_buffer_->get(), name_buffer_->size());
}
if (!log_->IsEnabled()) return;
if (FLAG_ll_prof) {
@@ -987,7 +1022,12 @@
name_buffer_->AppendString(name);
}
if (code_event_handler_ != NULL) {
- IssueCodeAddedEvent(code, name_buffer_->get(), name_buffer_->size());
+ Script* script =
+ shared->script()->IsScript() ? Script::cast(shared->script()) : NULL;
+ IssueCodeAddedEvent(code,
+ script,
+ name_buffer_->get(),
+ name_buffer_->size());
}
if (!log_->IsEnabled()) return;
if (FLAG_ll_prof) {
@@ -1037,7 +1077,12 @@
name_buffer_->AppendInt(line);
}
if (code_event_handler_ != NULL) {
- IssueCodeAddedEvent(code, name_buffer_->get(), name_buffer_->size());
+ Script* script =
+ shared->script()->IsScript() ? Script::cast(shared->script()) : NULL;
+ IssueCodeAddedEvent(code,
+ script,
+ name_buffer_->get(),
+ name_buffer_->size());
}
if (!log_->IsEnabled()) return;
if (FLAG_ll_prof) {
@@ -1078,7 +1123,7 @@
name_buffer_->AppendInt(args_count);
}
if (code_event_handler_ != NULL) {
- IssueCodeAddedEvent(code, name_buffer_->get(), name_buffer_->size());
+ IssueCodeAddedEvent(code, NULL, name_buffer_->get(), name_buffer_->size());
}
if (!log_->IsEnabled()) return;
if (FLAG_ll_prof) {
@@ -1116,7 +1161,7 @@
name_buffer_->AppendString(source);
}
if (code_event_handler_ != NULL) {
- IssueCodeAddedEvent(code, name_buffer_->get(), name_buffer_->size());
+ IssueCodeAddedEvent(code, NULL, name_buffer_->get(), name_buffer_->size());
}
if (!log_->IsEnabled()) return;
if (FLAG_ll_prof) {
@@ -1160,7 +1205,30 @@
DeleteEventInternal(CODE_DELETE_EVENT, from);
}
+void Logger::CodeLinePosInfoAddEvent(void* line_info,
+ int pc_offset,
+ int position,
+ JitCodeEvent::PositionType position_type) {
+ if (code_event_handler_ != NULL) {
+ IssueAddCodeLinePosInfoEvent(line_info, pc_offset, position, position_type);
+ }
+}
+void* Logger::CodeStartLinePosInfoRecordEvent() {
+ if (code_event_handler_ != NULL) {
+ return IssueStartCodePosInfoEvent();
+ } else {
+ return NULL;
+ }
+}
+
+void Logger::CodeEndLinePosInfoRecordEvent(Code* code,
+ void* line_info) {
+ if (code_event_handler_ != NULL) {
+ IssueEndCodePosInfoEvent(code, line_info);
+ }
+}
+
void Logger::SnapshotPositionEvent(Address addr, int pos) {
if (!log_->IsEnabled()) return;
if (FLAG_ll_prof) LowLevelSnapshotPositionEvent(addr, pos);
@@ -1733,9 +1801,10 @@
void Logger::SetCodeEventHandler(uint32_t options,
- JitCodeEventHandler event_handler) {
+ JitCodeEventHandler event_handler,
+ bool support_moved_code) {
code_event_handler_ = event_handler;
-
+ support_moved_code_ = support_moved_code;
if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) {
HandleScope scope;
LogCodeObjects();
« src/log.h ('K') | « src/log.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698