[Vm-dev] VM Maker: VMMaker.oscog-nice.2761.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Jun 23 19:00:38 UTC 2020


Ah yes, I see a related issue now for the simple ifTrue: / or ifFalse:

    x := self check ifTrue: [ 2 ]

will be transformed into

    self check ifTrue: [x := 2]

missing the implicit  x := nil in the false branch!

Also we lost many valid ()?: for some reason to be inquired.



Le mar. 23 juin 2020 à 20:25, Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> a écrit :

>
>
> Le mar. 23 juin 2020 à 19:32, Eliot Miranda <eliot.miranda at gmail.com> a
> écrit :
>
>>
>> Hi Nicolas,
>>
>>    on reviewing this code first I really like transformInAssignmentTo: ;
>> it's a much nicer design than my hack.  Now, a specific issue...
>>
>> I see
>> TReturnNode>>transformInAssignmentTo: aTVariableNode
>> "a return shall not be assigned:
>> x := condition ifTrue: [^nil] ifFalse: [2]
>> shall be transformed into:
>> condition ifTrue: [^nil] ifFalse: [x := 2]"
>> ^self
>>
>> The issue here is that if x is a global variable then a necessary
>> side-effect will be lost.  Hence I think we need to refactor
>> transformInAssignmentTo: to transformInAssignmentTo:codeGen: so that we can
>> query whether the variable is in fact global in the current scope.
>>
>> Hi Eliot,
> I do not really understand the concern here...
> I fail to see the relation with the lifetime of the variable
> Do you have an example?
> Or does it interfere with some inlining tricks?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200623/6d14eb77/attachment.html>


More information about the Vm-dev mailing list