<br><br><div class="gmail_quote">On Tue, Jun 28, 2011 at 5:33 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
On 28 June 2011 12:32, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt; /Users/sig/projects/cog/blessed/src/vm/cogit.c:15864: error: lvalue<br>
&gt; required as left operand of assignment<br>
&gt; /Users/sig/projects/cog/blessed/src/vm/cogit.c:15864: error: lvalue<br>
&gt; required as left operand of assignment<br>
&gt;<br>
&gt; here the problematic line:<br>
&gt;<br>
&gt;        case SSConstant:<br>
&gt;                                inst = (shouldAnnotateObjectReference((self_in_storeToReg-&gt;constant))<br>
&gt;                        ? annotateobjRef(gMoveCwR((self_in_storeToReg-&gt;constant), reg),<br>
&gt; (self_in_storeToReg-&gt;constant))<br>
&gt;&gt;&gt;&gt;                     : /* begin MoveCq:R: */quickConstant = (self_in_storeToReg-&gt;constant),genoperandoperand(MoveCqR, quickConstant, reg));<br>
&gt;                break;<br>
&gt;<br>
&gt;<br>
&gt; seems like code generator producing bad code.<br>
&gt; Or maybe i&#39;m not initializing stuff properly (since there are new<br>
&gt; options which may need to be passed?)<br>
&gt;<br>
<br>
</div></div>The fix is to change the generator to produce a following:<br>
<br>
({ statement a; statement b; })<br></blockquote><div><br></div><div>No. ({ ... }) is a gcc-speciofic extension.  See previous message for correct fix (checking in now).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
instead of<br>
<br>
statement a, statement b<br>
<br>
If you consider a slang code like:<br>
<br>
v := self something ifTrue: [ 1 ] ifFalse: [ x := self doSomething.<br>
self returnValue].<br>
<br>
a generator should produce something like following:<br>
<br>
v = something() ? 1 : ({ x = doSomething(); returnValue(); });<br>
<br>
Then it will work well (at least in GCC).<br>
<br>
I changed the C code to check if compiler can swallow it:<br>
<div class="im"><br>
inst = (shouldAnnotateObjectReference((self_in_storeToReg-&gt;constant))<br>
                        ? annotateobjRef(gMoveCwR ( (self_in_storeToReg-&gt;constant), reg),<br>
(self_in_storeToReg-&gt;constant))<br>
                                                : /* begin MoveCq:R: */({ quickConstant =<br>
(self_in_storeToReg-&gt;constant); genoperandoperand(MoveCqR,<br>
</div>quickConstant, reg);}) );<br>
<br>
<br>
Anyways, a code generator needs to be fixed, or code in #storeToReg:<br>
and #popToReg: needs to be rewritten to not confuse the generator.<br>
<br>
<br>
Another issue is with<br>
/Users/sig/projects/cog/blessed/src/vm/gcc3x-cointerp.c:10137: error:<br>
‘cmDynSuperEntryOffset’ undeclared (first use in this function)<br>
/Users/sig/projects/cog/blessed/src/vm/gcc3x-cointerp.c:10137: error:<br>
(Each undeclared identifier is reported only once<br>
/Users/sig/projects/cog/blessed/src/vm/gcc3x-cointerp.c:10137: error:<br>
for each function it appears in.)<br>
<br>
as far as i see, this variable is used only when compiling newspeak vm<br>
(there are a lot of places with<br>
#if NEWSPEAK .. #else , and this variable used only in newspeak blocks.<br>
<br>
But somehow it slept through and introduced in cog.<br></blockquote><div><br></div><div>Because it is marked as &lt;api&gt; it is retained.  &lt;api&gt; marks methods used outside the source file (e.g. in cogit.c).  So if it is marked &lt;api&gt; but optional it needs to be filtered out.  I implemented &lt;option: #SomeKey) for this and eliminated the &lt;cogit: #CogitClassName&gt; tag, since it is now subsumed by &lt;option: ...&gt;.</div>
<div><br></div><div>Thanks, Igor!</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Probably #ceDynamicSuperSend:to:numArgs:<br>
should also contain<br>
        self cppIf: NewspeakVM<br>
                ifTrue: []<br>
clause.<br>
<br>
&gt; --<br>
<div><div></div><div class="h5">&gt; Best regards,<br>
&gt; Igor Stasenko AKA sig.<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>best,<div>Eliot</div><br>