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

Unified Diff: src/profiler/cpu-profiler.cc

Issue 1737043002: [Interpreter] Log source positions for bytecode arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_cpu_profiler
Patch Set: TickLinesBaseline now works with more source positions Created 4 years, 10 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/ppc/assembler-ppc.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/cpu-profiler.cc
diff --git a/src/profiler/cpu-profiler.cc b/src/profiler/cpu-profiler.cc
index 50558f77d50d344a7a730eea4b4243738a66f476..22030bfc71ad61287c7bb156471763116506b94d 100644
--- a/src/profiler/cpu-profiler.cc
+++ b/src/profiler/cpu-profiler.cc
@@ -287,8 +287,15 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
}
}
} else {
- DCHECK(abstract_code->IsBytecodeArray());
- // TODO(rmcilroy): source position tracking for bytecode arrays.
+ BytecodeArray* bytecode = abstract_code->GetBytecodeArray();
+ line_table = new JITLineInfoTable();
+ interpreter::SourcePositionTableIterator it(
+ bytecode->source_position_table());
+ for (; !it.done(); it.Advance()) {
+ int line_number = script->GetLineNumber(it.source_position()) + 1;
+ int pc_offset = it.bytecode_offset() + BytecodeArray::kHeaderSize;
+ line_table->SetPosition(pc_offset, line_number);
+ }
}
}
rec->entry = profiles_->NewCodeEntry(
« no previous file with comments | « src/ppc/assembler-ppc.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698