| 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()));
|
| + 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()));
|
| + 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();
|
|
|