Are AlignmentNops actually used?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Are AlignmentNops actually used?

Boris Shingarov
 
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?

Reply | Threaded
Open this post in threaded view
|

Re: Are AlignmentNops actually used?

Eliot Miranda-2
 
Hi Boris,

> On Sep 17, 2020, at 1:59 AM, Boris Shingarov <[hidden email]> 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