[Vm-dev] Small discrepancy in fileTimesInUTC between simulation & VM

David T. Lewis lewis at mail.msen.com
Mon Dec 28 15:17:50 UTC 2020

On Sun, Dec 27, 2020 at 02:51:44PM +0100, Nicolas Cellier wrote:
> Hi all, Eliot,
> Simulation says:
>     ^(Smalltalk vmParameterAt: 48) anyMask: 128
> VM says:
>     ^imageHeaderFlags anyMask: 512
> Is the difference intentional?

Eliot will give a better answer, but I am fairly sure that this is
intentional. See StackInterpreter>>getImageHeaderFlagsParameter for

At first glance this looks like a conversion from Smalltalk Integer
to C int, but I think that is just a coincidence. The getImageHeaderFlags
method gives the value that is written to the snapshot file header,
but the first two bits of that value are not of interest for the
VM parameter, hence the shift right by 2 to get the value used for
the VM parameter.

As an aside, I find the use of bit masks (anyMask: or allMask:) for
bit testing to be hard to read, maybe it would be good to have this:

  Integer>>testBit: bitNumber
      "Answer whether the bit at bitNumber is set"
      ^ 0 ~= (self bitAt: bitNumber)


More information about the Vm-dev mailing list