summaryrefslogtreecommitdiff
path: root/deps/v8/src/perf-jit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/perf-jit.cc')
-rw-r--r--deps/v8/src/perf-jit.cc50
1 files changed, 7 insertions, 43 deletions
diff --git a/deps/v8/src/perf-jit.cc b/deps/v8/src/perf-jit.cc
index ac1362c9a9..0e427df4ef 100644
--- a/deps/v8/src/perf-jit.cc
+++ b/deps/v8/src/perf-jit.cc
@@ -211,7 +211,7 @@ void PerfJitLogger::LogRecordedBuffer(AbstractCode* abstract_code,
// We only support non-interpreted functions.
if (!abstract_code->IsCode()) return;
Code* code = abstract_code->GetCode();
- DCHECK(code->instruction_start() == code->address() + Code::kHeaderSize);
+ DCHECK(code->raw_instruction_start() == code->address() + Code::kHeaderSize);
// Debug info has to be emitted first.
if (FLAG_perf_prof && shared != nullptr) {
@@ -223,11 +223,11 @@ void PerfJitLogger::LogRecordedBuffer(AbstractCode* abstract_code,
}
const char* code_name = name;
- uint8_t* code_pointer = reinterpret_cast<uint8_t*>(code->instruction_start());
+ uint8_t* code_pointer = reinterpret_cast<uint8_t*>(code->InstructionStart());
// Code generated by Turbofan will have the safepoint table directly after
// instructions. There is no need to record the safepoint table itself.
uint32_t code_size = code->is_turbofanned() ? code->safepoint_table_offset()
- : code->instruction_size();
+ : code->InstructionSize();
// Unwinding info comes right after debug info.
if (FLAG_perf_prof_unwinding_info) LogWriteUnwindingInfo(code);
@@ -235,8 +235,8 @@ void PerfJitLogger::LogRecordedBuffer(AbstractCode* abstract_code,
WriteJitCodeLoadEntry(code_pointer, code_size, code_name, length);
}
-void PerfJitLogger::LogRecordedBuffer(wasm::WasmCode* code, const char* name,
- int length) {
+void PerfJitLogger::LogRecordedBuffer(const wasm::WasmCode* code,
+ const char* name, int length) {
base::LockGuard<base::RecursiveMutex> guard_file(file_mutex_.Pointer());
if (perf_output_handle_ == nullptr) return;
@@ -270,42 +270,6 @@ void PerfJitLogger::WriteJitCodeLoadEntry(const uint8_t* code_pointer,
LogWriteBytes(reinterpret_cast<const char*>(code_pointer), code_size);
}
-void PerfJitLogger::LogRecordedBuffer(const InstructionStream* stream,
- const char* name, int length) {
- if (FLAG_perf_basic_prof_only_functions) return;
-
- base::LockGuard<base::RecursiveMutex> guard_file(file_mutex_.Pointer());
-
- if (perf_output_handle_ == nullptr) return;
-
- const char* code_name = name;
- uint8_t* code_pointer = stream->bytes();
- uint32_t code_size = static_cast<uint32_t>(stream->byte_length());
-
- // TODO(jgruber): Do we need unwinding info?
-
- static const char string_terminator[] = "\0";
-
- PerfJitCodeLoad code_load;
- code_load.event_ = PerfJitCodeLoad::kLoad;
- code_load.size_ = sizeof(code_load) + length + 1 + code_size;
- code_load.time_stamp_ = GetTimestamp();
- code_load.process_id_ =
- static_cast<uint32_t>(base::OS::GetCurrentProcessId());
- code_load.thread_id_ = static_cast<uint32_t>(base::OS::GetCurrentThreadId());
- code_load.vma_ = 0x0; // Our addresses are absolute.
- code_load.code_address_ = reinterpret_cast<uint64_t>(code_pointer);
- code_load.code_size_ = code_size;
- code_load.code_id_ = code_index_;
-
- code_index_++;
-
- LogWriteBytes(reinterpret_cast<const char*>(&code_load), sizeof(code_load));
- LogWriteBytes(code_name, length);
- LogWriteBytes(string_terminator, 1);
- LogWriteBytes(reinterpret_cast<const char*>(code_pointer), code_size);
-}
-
namespace {
std::unique_ptr<char[]> GetScriptName(Handle<Script> script) {
@@ -354,7 +318,7 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
debug_info.event_ = PerfJitCodeLoad::kDebugInfo;
debug_info.time_stamp_ = GetTimestamp();
- debug_info.address_ = reinterpret_cast<uint64_t>(code->instruction_start());
+ debug_info.address_ = reinterpret_cast<uint64_t>(code->InstructionStart());
debug_info.entry_count_ = entry_count;
uint32_t size = sizeof(debug_info);
@@ -377,7 +341,7 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
debug_info.size_ = size + padding;
LogWriteBytes(reinterpret_cast<const char*>(&debug_info), sizeof(debug_info));
- Address code_start = code->instruction_start();
+ Address code_start = code->InstructionStart();
for (SourcePositionTableIterator iterator(code->SourcePositionTable());
!iterator.done(); iterator.Advance()) {