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

Eliot Miranda eliot.miranda at gmail.com
Sat Jan 2 17:02:48 UTC 2021


Hi Nicolas,

> On Jan 2, 2021, at 12:33 AM, Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:
> 
> 
> Hi both,
> thanks for the hint, it's not obvious indeed !
> We may eventually do like the simulation, always shift the flags, something like:
> 
>     ^self shiftedImageHeaderFlags anyMask: 128
> 
> The shift method would always be inlined, and I guess that the C compiler would generate equally efficient code for those two expressions
>     (flags >> 2) & 128.
>     flags & 512.
> Anyway, we do not check flags in tight loops, do we?

No, abd actually the flags are only processed at startup, snapshot, and the vmParameter primitives.  Any flags which have an effect on execution (such as the fail-for-mixed-arithmetic flag) are extracted into variables at startup or in vmParameterAtPut abd read back into a flag bit from the variable at snapshot time.

> 
>> Le mar. 29 déc. 2020 à 05:52, Eliot Miranda <eliot.miranda at gmail.com> a écrit :
>>  
>> Hi Nicolas,
>> 
>>> On Sun, Dec 27, 2020 at 5:52 AM Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:
>>>  
>>> Hi all, Eliot,
>>> 
>>> Simulation says:
>>> 
>>>     ^(Smalltalk vmParameterAt: 48) anyMask: 128
>>> 
>>> VM says:
>>> 
>>>     ^imageHeaderFlags anyMask: 512
>>> 
>>> Is the difference intentional?
>> 
>> It is, and it's a confusing mess for which I apologize.  The issue is that the least significant two bits of the flags word are the full screen flag and the "vm is big endian" flag.  Neither of these needs a setter since the full screen flag is set via the toggle full screen primitive and the "vm is big endian" is a constant depending on the VM.  Hence Smalltalk vmParameterAt: 48 answers the flags bit shifted right 2 bits.  I get bit by this all the time and wish I had not introduced the shift.  Back in early October in VMMaker.oscog-eem.2837 I wrote completely incorrect code that screwed up several flags until VMMaker.oscog-eem.2848 that I fixed a week later.  But unfortunately the damage is done.  All we can do is comment the situation, while I beg forgiveness and forbearance.
>> 
>> _,,,^..^,,,_
>> best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20210102/bf26bacc/attachment.html>


More information about the Vm-dev mailing list