Index: src/cpu-profiler.cc |
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc |
index 54fec77a2a3a3b6f087ffd546ba5cd1221546321..b9c63bd9663d80f75e142477405a687ee8cf7677 100644 |
--- a/src/cpu-profiler.cc |
+++ b/src/cpu-profiler.cc |
@@ -257,18 +257,35 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); |
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
rec->start = code->address(); |
+ ASSERT(Script::cast(shared->script())); |
alph
2014/08/11 12:18:15
nit: DCHECK here and everywhere else.
Also cast d
Denis Pravdin
2014/08/11 13:11:50
DCHECK is undefined. Do you suggest to use the CHE
alph
2014/08/11 13:41:04
Rebaseline to the latest version. They've been int
|
+ Script* script = Script::cast(shared->script()); |
+ |
+ // Get line info from the relocation information. |
+ JITLineInfoTable* line_table = new JITLineInfoTable(); |
+ Handle<Script> script_handle(Script::cast(shared->script())); |
alph
2014/08/11 12:18:15
nit: you can use the 'script' pointer calculated a
Denis Pravdin
2014/08/11 13:11:49
Acknowledged.
|
+ for (RelocIterator it(code); !it.done(); it.next()) { |
+ RelocInfo::Mode mode = it.rinfo()->rmode(); |
+ if (RelocInfo::IsPosition(mode)) { |
+ int position = static_cast<int>(it.rinfo()->data()); |
+ if (position >= 0) { |
+ int pc_offset = static_cast<int>(it.rinfo()->pc() - code->address()); |
+ int line_number = script->GetLineNumber(position) + 1; |
+ line_table->SetPosition(pc_offset, line_number); |
+ } |
+ } |
+ } |
+ |
rec->entry = profiles_->NewCodeEntry( |
tag, |
profiles_->GetFunctionName(shared->DebugName()), |
CodeEntry::kEmptyNamePrefix, |
profiles_->GetName(source), |
line, |
- column); |
+ column, |
+ line_table); |
if (info) { |
rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); |
} |
- ASSERT(Script::cast(shared->script())); |
- Script* script = Script::cast(shared->script()); |
rec->entry->set_script_id(script->id()->value()); |
rec->size = code->ExecutableSize(); |
rec->shared = shared->address(); |