<div dir="ltr">Yes exactly, my version in inbox should correct these new failures<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/5 Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 5 April 2013 01:37, Nicolas Cellier<br>
<div class="im">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt; Please review Compiler-nice.260 in the inbox because emitying code of a<br>
&gt; special assigment for effect seems to push twice the binding and pop only<br>
&gt; once. (If you run Decompiler tests you can see it)<br>
<br>
</div>Like this?: <a href="http://build.squeak.org/job/SqueakTrunk/256/testReport/junit/Tests.Compiler/DecompilerTests/testDecompilerInClassesDAtoDM/" target="_blank">http://build.squeak.org/job/SqueakTrunk/256/testReport/junit/Tests.Compiler/DecompilerTests/testDecompilerInClassesDAtoDM/</a><br>

<span class="HOEnZb"><font color="#888888"><br>
frank<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
&gt; 2013/4/3 &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt;<br>
&gt;<br>
&gt;&gt; Eliot Miranda uploaded a new version of Compiler to project The Trunk:<br>
&gt;&gt; <a href="http://source.squeak.org/trunk/Compiler-eem.258.mcz" target="_blank">http://source.squeak.org/trunk/Compiler-eem.258.mcz</a><br>
&gt;&gt;<br>
&gt;&gt; ==================== Summary ====================<br>
&gt;&gt;<br>
&gt;&gt; Name: Compiler-eem.258<br>
&gt;&gt; Author: eem<br>
&gt;&gt; Time: 3 April 2013, 12:59:36.409 pm<br>
&gt;&gt; UUID: 7721a43f-63e6-4524-bb6d-48eddc955654<br>
&gt;&gt; Ancestors: Compiler-eem.257<br>
&gt;&gt;<br>
&gt;&gt; Fix store of special bindings.  Exsting code dropped the<br>
&gt;&gt; value assigned from the stack, so v := binding := expr would<br>
&gt;&gt; leave v holding binding, not expr.  New code generates<br>
&gt;&gt;         push expr<br>
&gt;&gt;         push binding<br>
&gt;&gt;         duplicate expr (by pushTemp: of expr&#39;s stack index)<br>
&gt;&gt;         send value:<br>
&gt;&gt;         pop<br>
&gt;&gt;<br>
&gt;&gt; =============== Diff against Compiler-eem.257 ===============<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;   ----- Method: AssignmentNode&gt;&gt;emitCodeForEffect:encoder: (in category<br>
&gt;&gt; &#39;code generation&#39;) -----<br>
&gt;&gt;   emitCodeForEffect: stack encoder: encoder<br>
&gt;&gt;<br>
&gt;&gt; +       variable emitCodeForLoad: stack forValue: false encoder: encoder.<br>
&gt;&gt; -       variable emitCodeForLoad: stack encoder: encoder.<br>
&gt;&gt;         value emitCodeForValue: stack encoder: encoder.<br>
&gt;&gt;         pc := encoder methodStreamPosition + 1. &quot;debug pc is first byte of<br>
&gt;&gt; the store, i.e. the next byte&quot;.<br>
&gt;&gt;         variable emitCodeForStorePop: stack encoder: encoder!<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;   ----- Method: AssignmentNode&gt;&gt;emitCodeForValue:encoder: (in category<br>
&gt;&gt; &#39;code generation&#39;) -----<br>
&gt;&gt;   emitCodeForValue: stack encoder: encoder<br>
&gt;&gt;<br>
&gt;&gt; +       variable emitCodeForLoad: stack forValue: true encoder: encoder.<br>
&gt;&gt; -       variable emitCodeForLoad: stack encoder: encoder.<br>
&gt;&gt;         value emitCodeForValue: stack encoder: encoder.<br>
&gt;&gt;         pc := encoder methodStreamPosition + 1. &quot;debug pc is first byte of<br>
&gt;&gt; the store, i.e. the next byte&quot;.<br>
&gt;&gt;         variable emitCodeForStore: stack encoder: encoder!<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;   ----- Method: AssignmentNode&gt;&gt;sizeCodeForEffect: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt;   sizeCodeForEffect: encoder<br>
&gt;&gt;<br>
&gt;&gt; +       ^(variable sizeCodeForLoad: encoder forValue: false)<br>
&gt;&gt; -       ^(variable sizeCodeForLoad: encoder)<br>
&gt;&gt;         + (value sizeCodeForValue: encoder)<br>
&gt;&gt;         + (variable sizeCodeForStorePop: encoder)!<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;   ----- Method: AssignmentNode&gt;&gt;sizeCodeForValue: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt;   sizeCodeForValue: encoder<br>
&gt;&gt;<br>
&gt;&gt; +       ^(variable sizeCodeForLoad: encoder forValue: true)<br>
&gt;&gt; -       ^(variable sizeCodeForLoad: encoder)<br>
&gt;&gt;         + (value sizeCodeForValue: encoder)<br>
&gt;&gt;         + (variable sizeCodeForStore: encoder)!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: BytecodeEncoder&gt;&gt;sizePushTempLong: (in category &#39;opcode<br>
&gt;&gt; sizing&#39;) -----<br>
&gt;&gt; + sizePushTempLong: tempIndex<br>
&gt;&gt; +       ^self sizeOpcodeSelector: #genPushTempLong: withArguments:<br>
&gt;&gt; {tempIndex}!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: EncoderForV3&gt;&gt;genPushTempLong: (in category &#39;bytecode<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt; + genPushTempLong: tempIndex<br>
&gt;&gt; +       &quot;See BlueBook page 596&quot;<br>
&gt;&gt; +       (tempIndex &gt;= 0 and: [tempIndex &lt; 64]) ifTrue:<br>
&gt;&gt; +               [&quot;128   10000000 jjkkkkkk       Push (Receiver Variable,<br>
&gt;&gt; Temporary Location, Literal Constant, Literal Variable) [jj] #kkkkkk&quot;<br>
&gt;&gt; +                stream<br>
&gt;&gt; +                       nextPut: 128;<br>
&gt;&gt; +                       nextPut: 64 + tempIndex.<br>
&gt;&gt; +                ^self].<br>
&gt;&gt; +       ^self outOfRangeError: &#39;index&#39; index: tempIndex range: 0 to: 63!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: FieldNode&gt;&gt;emitCodeForLoad:encoder: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt; - emitCodeForLoad: stack encoder: encoder<br>
&gt;&gt; -       rcvrNode emitCodeForValue: stack encoder: encoder.<br>
&gt;&gt; -       fieldDef accessKey ifNotNil:[<br>
&gt;&gt; -               super emitCodeForValue: stack encoder: encoder.<br>
&gt;&gt; -       ].!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: FieldNode&gt;&gt;emitCodeForLoad:forValue:encoder: (in category<br>
&gt;&gt; &#39;code generation&#39;) -----<br>
&gt;&gt; + emitCodeForLoad: stack forValue: forValue encoder: encoder<br>
&gt;&gt; +       rcvrNode emitCodeForValue: stack encoder: encoder.<br>
&gt;&gt; +       fieldDef accessKey ifNotNil:<br>
&gt;&gt; +               [super emitCodeForValue: stack encoder: encoder]!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: LeafNode&gt;&gt;emitCodeForLoad:encoder: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt; - emitCodeForLoad: stack encoder: encoder<br>
&gt;&gt; -       &quot;Default is to do nothing.<br>
&gt;&gt; -        Subclasses may need to override.&quot;!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: LeafNode&gt;&gt;emitCodeForLoad:forValue:encoder: (in category<br>
&gt;&gt; &#39;code generation&#39;) -----<br>
&gt;&gt; + emitCodeForLoad: stack forValue: forValue encoder: encoder<br>
&gt;&gt; +       &quot;Default is to do nothing.<br>
&gt;&gt; +        Subclasses may need to override.&quot;!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: LeafNode&gt;&gt;sizeCodeForLoad: (in category &#39;code generation&#39;)<br>
&gt;&gt; -----<br>
&gt;&gt; - sizeCodeForLoad: encoder<br>
&gt;&gt; -       &quot;Default is to do nothing.<br>
&gt;&gt; -        Subclasses may need to override.&quot;<br>
&gt;&gt; -       ^0!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: LeafNode&gt;&gt;sizeCodeForLoad:forValue: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt; + sizeCodeForLoad: encoder forValue: forValue<br>
&gt;&gt; +       &quot;Default is to do nothing.<br>
&gt;&gt; +        Subclasses may need to override.&quot;<br>
&gt;&gt; +       ^0!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: LiteralVariableNode&gt;&gt;emitCodeForLoad:encoder: (in category<br>
&gt;&gt; &#39;code generation&#39;) -----<br>
&gt;&gt; - emitCodeForLoad: stack encoder: encoder<br>
&gt;&gt; -       writeNode ifNotNil:<br>
&gt;&gt; -               [encoder genPushLiteral: index.<br>
&gt;&gt; -                stack push: 1]!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: LiteralVariableNode&gt;&gt;emitCodeForLoad:forValue:encoder: (in<br>
&gt;&gt; category &#39;code generation&#39;) -----<br>
&gt;&gt; + emitCodeForLoad: stack forValue: forValue encoder: encoder<br>
&gt;&gt; +       &quot;If a normal literal variable (not sending value:), do nothing.<br>
&gt;&gt; +        If for value (e.g. v := Binding := expr) do nothing; the work<br>
&gt;&gt; will be done in emitCodeForStore:encoder:.<br>
&gt;&gt; +        If not for value then indeed load.  The rest of the work will be<br>
&gt;&gt; done in  emitCodeForStorePop:encoder:.&quot;<br>
&gt;&gt; +       (writeNode isNil or: [forValue]) ifTrue: [^self].<br>
&gt;&gt; +       encoder genPushLiteral: index.<br>
&gt;&gt; +       stack push: 1!<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;   ----- Method: LiteralVariableNode&gt;&gt;emitCodeForStore:encoder: (in<br>
&gt;&gt; category &#39;code generation&#39;) -----<br>
&gt;&gt;   emitCodeForStore: stack encoder: encoder<br>
&gt;&gt; +       | exprOffset |<br>
&gt;&gt;         writeNode ifNil: [^encoder genStoreLiteralVar: index].<br>
&gt;&gt; +       &quot;On entry the stack has only the expression.  Push the binding,<br>
&gt;&gt; +        duplicate the expression, send #value: and pop.&quot;<br>
&gt;&gt; +       exprOffset := stack position - 1.<br>
&gt;&gt; +       encoder genPushLiteral: index.<br>
&gt;&gt; +       stack push: 1.<br>
&gt;&gt; +       encoder genPushTempLong: exprOffset.<br>
&gt;&gt; +       stack push: 1.<br>
&gt;&gt; -       &quot;THIS IS WRONG!!!! THE VALUE IS LOST FROM THE STACK!!!!<br>
&gt;&gt; -        The various value: methods on Association ReadOnlyVariableBinding<br>
&gt;&gt; -        etc _do not_ return the value assigned; they return the<br>
&gt;&gt; receiver.&quot;<br>
&gt;&gt; -       &quot;Should generate something more like<br>
&gt;&gt; -               push expr<br>
&gt;&gt; -               push lit<br>
&gt;&gt; -               push temp (index of expr)<br>
&gt;&gt; -               send value:<br>
&gt;&gt; -               pop<br>
&gt;&gt; -       or use e.g. valueForStore:&quot;<br>
&gt;&gt; -       self flag: #bogus.<br>
&gt;&gt;         writeNode<br>
&gt;&gt;                 emitCode: stack<br>
&gt;&gt;                 args: 1<br>
&gt;&gt;                 encoder: encoder<br>
&gt;&gt; +               super: false.<br>
&gt;&gt; +       stack pop: 1.<br>
&gt;&gt; +       encoder genPop!<br>
&gt;&gt; -               super: false!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: LiteralVariableNode&gt;&gt;sizeCodeForLoad: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt; - sizeCodeForLoad: encoder<br>
&gt;&gt; -       self reserve: encoder.<br>
&gt;&gt; -       ^(key isVariableBinding and: [key isSpecialWriteBinding])<br>
&gt;&gt; -               ifTrue: [encoder sizePushLiteral: index]<br>
&gt;&gt; -               ifFalse: [0]!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: LiteralVariableNode&gt;&gt;sizeCodeForLoad:forValue: (in<br>
&gt;&gt; category &#39;code generation&#39;) -----<br>
&gt;&gt; + sizeCodeForLoad: encoder forValue: forValue<br>
&gt;&gt; +       self reserve: encoder.<br>
&gt;&gt; +       ^(key isVariableBinding and: [key isSpecialWriteBinding and:<br>
&gt;&gt; [forValue not]])<br>
&gt;&gt; +               ifTrue: [encoder sizePushLiteral: index]<br>
&gt;&gt; +               ifFalse: [0]!<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;   ----- Method: LiteralVariableNode&gt;&gt;sizeCodeForStore: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt;   sizeCodeForStore: encoder<br>
&gt;&gt;         self reserve: encoder.<br>
&gt;&gt;         (key isVariableBinding and: [key isSpecialWriteBinding]) ifFalse:<br>
&gt;&gt;                 [^encoder sizeStoreLiteralVar: index].<br>
&gt;&gt;         code &lt; 0 ifTrue:<br>
&gt;&gt;                 [self flag: #dubious.<br>
&gt;&gt;                  self code: (self code: self index type: LdLitType)].<br>
&gt;&gt; -       &quot;THIS IS WRONG!!!! THE VALUE IS LOST FROM THE STACK!!!!<br>
&gt;&gt; -        The various value: methods on Association ReadOnlyVariableBinding<br>
&gt;&gt; -        etc _do not_ return the value assigned; they return the<br>
&gt;&gt; receiver.&quot;<br>
&gt;&gt; -       &quot;Should generate something more like<br>
&gt;&gt; -               push expr<br>
&gt;&gt; -               push lit<br>
&gt;&gt; -               push temp (index of expr)<br>
&gt;&gt; -               send value:<br>
&gt;&gt; -               pop&quot;<br>
&gt;&gt; -       self flag: #bogus.<br>
&gt;&gt;         writeNode := encoder encodeSelector: #value:.<br>
&gt;&gt; +       &quot;On entry the stack has only the expression.  Push the binding,<br>
&gt;&gt; +        duplicate the expression, send #value: and pop.&quot;<br>
&gt;&gt; +       ^(encoder sizePushLiteral: index)<br>
&gt;&gt; +         + (encoder sizePushTempLong: 0) &quot;we don&#39;t know yet, hence long,<br>
&gt;&gt; sigh...&quot;<br>
&gt;&gt; +         + (writeNode sizeCode: encoder args: 1 super: false)<br>
&gt;&gt; +         + encoder sizePop!<br>
&gt;&gt; -       ^writeNode sizeCode: encoder args: 1 super: false!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: TempVariableNode&gt;&gt;emitCodeForLoad:encoder: (in category<br>
&gt;&gt; &#39;code generation&#39;) -----<br>
&gt;&gt; - emitCodeForLoad: stack encoder: encoder<br>
&gt;&gt; -       remoteNode ~~ nil ifTrue:<br>
&gt;&gt; -               [remoteNode emitCodeForLoadFor: self stack: stack encoder:<br>
&gt;&gt; encoder]!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: TempVariableNode&gt;&gt;emitCodeForLoad:forValue:encoder: (in<br>
&gt;&gt; category &#39;code generation&#39;) -----<br>
&gt;&gt; + emitCodeForLoad: stack forValue: forValue encoder: encoder<br>
&gt;&gt; +       remoteNode ~~ nil ifTrue:<br>
&gt;&gt; +               [remoteNode emitCodeForLoadFor: self stack: stack encoder:<br>
&gt;&gt; encoder]!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: TempVariableNode&gt;&gt;sizeCodeForLoad: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt; - sizeCodeForLoad: encoder<br>
&gt;&gt; -       ^remoteNode<br>
&gt;&gt; -               ifNil: [0]<br>
&gt;&gt; -               ifNotNil: [remoteNode sizeCodeForLoadFor: self encoder:<br>
&gt;&gt; encoder]!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: TempVariableNode&gt;&gt;sizeCodeForLoad:forValue: (in category<br>
&gt;&gt; &#39;code generation&#39;) -----<br>
&gt;&gt; + sizeCodeForLoad: encoder forValue: forValue<br>
&gt;&gt; +       ^remoteNode<br>
&gt;&gt; +               ifNil: [0]<br>
&gt;&gt; +               ifNotNil: [remoteNode sizeCodeForLoadFor: self encoder:<br>
&gt;&gt; encoder]!<br>
&gt;&gt;<br>
&gt;&gt; Item was removed:<br>
&gt;&gt; - ----- Method: VariableNode&gt;&gt;emitCodeForLoad:encoder: (in category &#39;code<br>
&gt;&gt; generation&#39;) -----<br>
&gt;&gt; - emitCodeForLoad: stack encoder: encoder<br>
&gt;&gt; -       &quot;Do nothing&quot;!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: VariableNode&gt;&gt;emitCodeForLoad:forValue:encoder: (in<br>
&gt;&gt; category &#39;code generation&#39;) -----<br>
&gt;&gt; + emitCodeForLoad: stack forValue: forValue encoder: encoder<br>
&gt;&gt; +       &quot;Do nothing&quot;!<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>