Baseline compiler emits RegDisp instructions when the Disp is 0

Description

In some situations we generate a displacement of 0 in the baseline compiler. For example, if we have 1 local then iload0 becomes "push [ESP+0]" when the operand stack is empty. Encoding this is RegDisp form creates an instruction of
opcode = 0xFF
modrm = 01b || 110b || 100b
(include /6 of the extended part of the opcode)
sib = 00100100b
imm8 = 0
ie. 4 bytes long. If this were RegInd form then the instruction could be:
opcode = 0xFF
modrm = 00b || 110b || 100b
sib = 00100100b
ie. 3 bytes long. We probably don't want to clutter up the assembler with "if (disp == 0) ..." so we should fix the baseline compiler.

Environment

None

Assignee

Unassigned

Reporter

Ian Rogers

Labels

None

Fix versions

Priority

Medium
Configure