Commit 1dfb8cd7 authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[x64][diasasm] Add more padding to disassembly

A mov can be up to 10 bytes, 6 for displacement, 4 for instr. Other
instructions (like pshufb) with a complex addressing mode can take 10
bytes too. So adjust the padding for disassembly of hex accordingly.
This requires fixing up all the test cases too.

Bug: v8:12207
Change-Id: I372d67a818a5dbfe6f49f67047493d7f67b59bcd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3180375Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77241}
parent 6a38c1d1
...@@ -2811,9 +2811,9 @@ int DisassemblerX64::InstructionDecode(v8::base::Vector<char> out_buffer, ...@@ -2811,9 +2811,9 @@ int DisassemblerX64::InstructionDecode(v8::base::Vector<char> out_buffer,
for (byte* bp = instr; bp < data; bp++) { for (byte* bp = instr; bp < data; bp++) {
outp += v8::base::SNPrintF(out_buffer + outp, "%02x", *bp); outp += v8::base::SNPrintF(out_buffer + outp, "%02x", *bp);
} }
// Indent instruction, leaving space for 9 bytes, i.e. 18 characters in hex. // Indent instruction, leaving space for 10 bytes, i.e. 20 characters in hex.
// 9-byte nop and rip-relative mov are (probably) the largest we emit. // 10-byte mov is (probably) the largest we emit.
while (outp < 18) { while (outp < 20) {
outp += v8::base::SNPrintF(out_buffer + outp, " "); outp += v8::base::SNPrintF(out_buffer + outp, " ");
} }
......
This diff is collapsed.
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