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

Unified Diff: src/perf-jit.cc

Issue 2023503002: Reland Implement .eh_frame writer and disassembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame-base
Patch Set: Rebase on master. Created 4 years, 5 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/objects.cc ('k') | src/v8.gyp » ('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 3ac179ec8f3e2447a053b45acff4f4c3312b004f..b318a4e7c0e59f224d7634ec4b376f4e787b2528 100644
--- a/src/perf-jit.cc
+++ b/src/perf-jit.cc
@@ -324,18 +324,16 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
}
void PerfJitLogger::LogWriteUnwindingInfo(Code* code) {
- EhFrameHdr eh_frame_hdr(code);
-
PerfJitCodeUnwindingInfo unwinding_info_header;
unwinding_info_header.event_ = PerfJitCodeLoad::kUnwindingInfo;
unwinding_info_header.time_stamp_ = GetTimestamp();
- unwinding_info_header.eh_frame_hdr_size_ = EhFrameHdr::kRecordSize;
+ unwinding_info_header.eh_frame_hdr_size_ = EhFrameConstants::kEhFrameHdrSize;
if (code->has_unwinding_info()) {
unwinding_info_header.unwinding_size_ = code->unwinding_info_size();
unwinding_info_header.mapped_size_ = unwinding_info_header.unwinding_size_;
} else {
- unwinding_info_header.unwinding_size_ = EhFrameHdr::kRecordSize;
+ unwinding_info_header.unwinding_size_ = EhFrameConstants::kEhFrameHdrSize;
unwinding_info_header.mapped_size_ = 0;
}
@@ -348,16 +346,13 @@ void PerfJitLogger::LogWriteUnwindingInfo(Code* code) {
sizeof(unwinding_info_header));
if (code->has_unwinding_info()) {
- // The last EhFrameHdr::kRecordSize bytes were a placeholder for the header.
- // Discard them and write the actual eh_frame_hdr (below).
- DCHECK_GE(code->unwinding_info_size(), EhFrameHdr::kRecordSize);
LogWriteBytes(reinterpret_cast<const char*>(code->unwinding_info_start()),
- code->unwinding_info_size() - EhFrameHdr::kRecordSize);
+ code->unwinding_info_size());
+ } else {
+ OFStream perf_output_stream(perf_output_handle_);
+ EhFrameWriter::WriteEmptyEhFrame(perf_output_stream);
}
- LogWriteBytes(reinterpret_cast<const char*>(&eh_frame_hdr),
- EhFrameHdr::kRecordSize);
-
char padding_bytes[] = "\0\0\0\0\0\0\0\0";
DCHECK_LT(padding_size, sizeof(padding_bytes));
LogWriteBytes(padding_bytes, padding_size);
« no previous file with comments | « src/objects.cc ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698