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

Unified Diff: src/perf-jit.cc

Issue 2109613004: Remove position info from relocation info. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@turbosourcepos
Patch Set: fix Created 4 years, 6 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/mips64/assembler-mips64.cc ('k') | src/ppc/assembler-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/perf-jit.cc
diff --git a/src/perf-jit.cc b/src/perf-jit.cc
index df251fde6e10685944c3a45e5113c56fc23cb40b..3ac179ec8f3e2447a053b45acff4f4c3312b004f 100644
--- a/src/perf-jit.cc
+++ b/src/perf-jit.cc
@@ -30,6 +30,7 @@
#include "src/assembler.h"
#include "src/eh-frame.h"
#include "src/objects-inl.h"
+#include "src/source-position-table.h"
#if V8_OS_LINUX
#include <fcntl.h>
@@ -246,8 +247,8 @@ void PerfJitLogger::LogRecordedBuffer(AbstractCode* abstract_code,
void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
// Compute the entry count and get the name of the script.
uint32_t entry_count = 0;
- for (RelocIterator it(code, RelocInfo::kPositionMask); !it.done();
- it.next()) {
+ for (SourcePositionTableIterator iterator(code->source_position_table());
+ !iterator.done(); iterator.Advance()) {
entry_count++;
}
if (entry_count == 0) return;
@@ -292,10 +293,11 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
int script_line_offset = script->line_offset();
Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
+ Address code_start = code->instruction_start();
- for (RelocIterator it(code, RelocInfo::kPositionMask); !it.done();
- it.next()) {
- int position = static_cast<int>(it.rinfo()->data());
+ for (SourcePositionTableIterator iterator(code->source_position_table());
+ !iterator.done(); iterator.Advance()) {
+ int position = iterator.source_position();
int line_number = Script::GetLineNumber(script, position);
// Compute column.
int relative_line_number = line_number - script_line_offset;
@@ -310,7 +312,8 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
}
PerfJitDebugEntry entry;
- entry.address_ = reinterpret_cast<uint64_t>(it.rinfo()->pc());
+ entry.address_ =
+ reinterpret_cast<uint64_t>(code_start + iterator.code_offset());
entry.line_number_ = line_number;
entry.column_ = column_offset;
LogWriteBytes(reinterpret_cast<const char*>(&entry), sizeof(entry));
« no previous file with comments | « src/mips64/assembler-mips64.cc ('k') | src/ppc/assembler-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698