<br><br><div class="gmail_quote">On Tue, Jun 28, 2011 at 5:33 AM, Igor Stasenko <span dir="ltr"><<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>></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 <<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>> wrote:<br>
> /Users/sig/projects/cog/blessed/src/vm/cogit.c:15864: error: lvalue<br>
> required as left operand of assignment<br>
> /Users/sig/projects/cog/blessed/src/vm/cogit.c:15864: error: lvalue<br>
> required as left operand of assignment<br>
><br>
> here the problematic line:<br>
><br>
> case SSConstant:<br>
> inst = (shouldAnnotateObjectReference((self_in_storeToReg->constant))<br>
> ? annotateobjRef(gMoveCwR((self_in_storeToReg->constant), reg),<br>
> (self_in_storeToReg->constant))<br>
>>>> : /* begin MoveCq:R: */quickConstant = (self_in_storeToReg->constant),genoperandoperand(MoveCqR, quickConstant, reg));<br>
> break;<br>
><br>
><br>
> seems like code generator producing bad code.<br>
> Or maybe i'm not initializing stuff properly (since there are new<br>
> options which may need to be passed?)<br>
><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->constant))<br>
? annotateobjRef(gMoveCwR ( (self_in_storeToReg->constant), reg),<br>
(self_in_storeToReg->constant))<br>
: /* begin MoveCq:R: */({ quickConstant =<br>
(self_in_storeToReg->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 <api> it is retained. <api> marks methods used outside the source file (e.g. in cogit.c). So if it is marked <api> but optional it needs to be filtered out. I implemented <option: #SomeKey) for this and eliminated the <cogit: #CogitClassName> tag, since it is now subsumed by <option: ...>.</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>
> --<br>
<div><div></div><div class="h5">> Best regards,<br>
> Igor Stasenko AKA sig.<br>
><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>