Commit e2ce4681 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Revert of Decompiler improvements. (patchset #2 id:20001 of...

Revert of Decompiler improvements. (patchset #2 id:20001 of https://codereview.chromium.org/1177123002/)

Reason for revert:
Code printout has become unreadable. Offsets are printed in decimal numbers everywhere else. This is inconsistent with the rest of the code-base. Some examples are tables for deoptimization data, safepoints and exception handlers. I would be fine with this change if _all_ tracing would be adapted. But there are _many_ places to touch.

Original issue's description:
> Decompiler improvements.
>
> The main motivation is simplifying profiling activities:
>
> 1) Use hex instead of decimal for offsets, just like perf does. This
> affects --print-opt-code
>
> 2) When printing block information, indicate loop information: if
> block is header, where the end is; if block is in a loop, where the
> loop starts. This affects --code-comments.
>
> Using --print-opt-code --code-comments, and cross-referencing with data
> obtained from perf, one may now find the block a hotspot belongs to
> without needing to do hex2dec/dec2hex conversions. Once found, loop info
> is available locally, on the block.
>
> BUG=
>
> Committed: https://crrev.com/32f4bd659d38eb5485eedb1d0dd236ff1bdc01d5
> Cr-Commit-Position: refs/heads/master@{#28964}

TBR=jarin@chromium.org,stichnot@chromium.org,jvoung@chromium.org,mtrofin@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1188093002

Cr-Commit-Position: refs/heads/master@{#29046}
parent 33ae0e67
...@@ -97,29 +97,12 @@ Handle<Code> CodeGenerator::GenerateCode() { ...@@ -97,29 +97,12 @@ Handle<Code> CodeGenerator::GenerateCode() {
if (FLAG_code_comments) { if (FLAG_code_comments) {
// TODO(titzer): these code comments are a giant memory leak. // TODO(titzer): these code comments are a giant memory leak.
Vector<char> buffer = Vector<char>::New(200); Vector<char> buffer = Vector<char>::New(200);
char* buffer_start = buffer.start(); SNPrintF(buffer, "-- B%d start%s%s%s%s --", block->rpo_number().ToInt(),
block->IsDeferred() ? " (deferred)" : "",
int next = SNPrintF( block->needs_frame() ? "" : " (no frame)",
buffer, "-- B%d start%s%s%s%s", block->rpo_number().ToInt(), block->must_construct_frame() ? " (construct frame)" : "",
block->IsDeferred() ? " (deferred)" : "", block->must_deconstruct_frame() ? " (deconstruct frame)" : "");
block->needs_frame() ? "" : " (no frame)", masm()->RecordComment(buffer.start());
block->must_construct_frame() ? " (construct frame)" : "",
block->must_deconstruct_frame() ? " (deconstruct frame)" : "");
buffer = buffer.SubVector(next, buffer.length());
if (block->IsLoopHeader()) {
next =
SNPrintF(buffer, " (loop up to %d)", block->loop_end().ToInt());
buffer = buffer.SubVector(next, buffer.length());
}
if (block->loop_header().IsValid()) {
next =
SNPrintF(buffer, " (in loop %d)", block->loop_header().ToInt());
buffer = buffer.SubVector(next, buffer.length());
}
SNPrintF(buffer, " --");
masm()->RecordComment(buffer_start);
} }
masm()->bind(GetLabel(current_block_)); masm()->bind(GetLabel(current_block_));
for (int i = block->code_start(); i < block->code_end(); ++i) { for (int i = block->code_start(); i < block->code_end(); ++i) {
......
...@@ -43,7 +43,7 @@ const char* V8NameConverter::NameOfAddress(byte* pc) const { ...@@ -43,7 +43,7 @@ const char* V8NameConverter::NameOfAddress(byte* pc) const {
int offs = static_cast<int>(pc - code_->instruction_start()); int offs = static_cast<int>(pc - code_->instruction_start());
// print as code offset, if it seems reasonable // print as code offset, if it seems reasonable
if (0 <= offs && offs < code_->instruction_size()) { if (0 <= offs && offs < code_->instruction_size()) {
SNPrintF(v8_buffer_, "%x (%p)", offs, pc); SNPrintF(v8_buffer_, "%d (%p)", offs, pc);
return v8_buffer_.start(); return v8_buffer_.start();
} }
} }
...@@ -146,7 +146,7 @@ static int DecodeIt(Isolate* isolate, std::ostream* os, ...@@ -146,7 +146,7 @@ static int DecodeIt(Isolate* isolate, std::ostream* os,
} }
// Instruction address and instruction offset. // Instruction address and instruction offset.
out.AddFormatted("%p %4x ", prev_pc, prev_pc - begin); out.AddFormatted("%p %4d ", prev_pc, prev_pc - begin);
// Instruction. // Instruction.
out.AddFormatted("%s", decode_buffer.start()); out.AddFormatted("%s", decode_buffer.start());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment