Commit 16515b16 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[disassembler] Increase padding on x64

There are instructions that take 7 bytes, e.g.
4881ec10000000 REX.W subq rsp,0x10

Hence increase the padding from 12 characters to 14 characters to
restore alignment.

Drive-by: Rewrite the padding loop to make it more readable and add a
comment.

R=jkummerow@chromium.org

Change-Id: Iddd6a721574fc47b4a072fe40c2f5e90cb3d1186
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2996200Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75480}
parent ed6b07a6
......@@ -2885,7 +2885,8 @@ int DisassemblerIA32::InstructionDecode(v8::base::Vector<char> out_buffer,
for (byte* bp = instr; bp < data; bp++) {
outp += v8::base::SNPrintF(out_buffer + outp, "%02x", *bp);
}
for (int i = 6 - instr_len; i >= 0; i--) {
// Indent instruction, leaving space for 6 bytes, i.e. 12 characters in hex.
while (outp < 12) {
outp += v8::base::SNPrintF(out_buffer + outp, " ");
}
......
......@@ -2801,7 +2801,8 @@ int DisassemblerX64::InstructionDecode(v8::base::Vector<char> out_buffer,
for (byte* bp = instr; bp < data; bp++) {
outp += v8::base::SNPrintF(out_buffer + outp, "%02x", *bp);
}
for (int i = 6 - instr_len; i >= 0; i--) {
// Indent instruction, leaving space for 7 bytes, i.e. 14 characters in hex.
while (outp < 14) {
outp += v8::base::SNPrintF(out_buffer + outp, " ");
}
......
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