[Vm-dev] Are AlignmentNops actually used?

Eliot Miranda eliot.miranda at gmail.com
Thu Sep 17 10:41:25 UTC 2020


Hi Boris,

> On Sep 17, 2020, at 1:59 AM, Boris Shingarov <boris at shingarov.com> wrote:
> 
> In my -- admittedly very limited (Squeak ReaderImages simulating ARMv7) -- tests I've never seen #concretizeAlignmentNops do anything.  It does get called, but it never emits any code.  This is because machineCodeSize=0, so the
> 
> 0 to: machineCodeSize - 1 by: 4 do:
>         [:p| self machineCodeAt: p put: 16rE1A00000].
> 
> gets no iterations.
> 
> Are there cases when this gets called with nonzero machineCodeSize, or is it a candidate for deletion?

Yes it is used.  In images using embedded blocks (EncoderForV3PlusClosures instruction set) and with x86 or x86_64 (variable-sized instructions with byte granularity), AlignmentNops are used to pad to align the fake method header embedded in machine code for each CogBlockMethod in a CogMethod.

__,,,^..^,,,__
Best, Eliot


More information about the Vm-dev mailing list