<div dir="ltr">Hi David,<br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 17, 2015 at 8:03 PM, David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On Mon, May 18, 2015 at 01:46:36AM +0200, Levente Uzonyi wrote:<br>
><br>
> On Sun, 17 May 2015, <a href="mailto:commits@squeakvm.org">commits@squeakvm.org</a> wrote:<br>
><br>
> ><br>
> >Revision: 3348<br>
> >Author: eliot<br>
> >Date: 2015-05-17 16:03:01 -0700 (Sun, 17 May 2015)<br>
> >Log Message:<br>
> >-----------<br>
> >CogVM source as per VMMaker.oscog-eem.1311<br>
> ><br>
> >General:<br>
> >Make the bounds check in primitiveObject:perform:...<br>
> >more restrictive and fix bugs in the commentary.<br>
> ><br>
> >Make stack pages a reasonable size. My math was<br>
> >wrong and the size was half as big as intended.<br>
> ><br>
> >Extend the fastPrimTrace scheme to trace stack overflow, prim failure and<br>
> >prim<br>
> >retry to help debug the phantom stack frame bug in Cog Spur.<br>
> ><br>
> >Cogit:<br>
> >Revamp icache flushing in the Cogit for ARM. Move icache flush for<br>
> >generated<br>
> >methods/pics to the fillIn*Header: routines. Make sure the cache is<br>
> >flushed<br>
> >in generateCaptureCStackPointers:. Flush the entire PIC when extending it.<br>
> ><br>
> >Spur:<br>
> >Fix ceActivateFailingPrimitiveMethod: to return properly after retrying<br>
> >a primitive after checkForAndFollowForwardedPrimitiveState. e.g. fixes<br>
> > | s | 1 to: 5 do: [:i| s := 'bar'. s becomeForward: 'bzzt' copy. 'foo' <=<br>
> > s]<br>
> ><br>
> >Fix bug in followForwardedFrameContents:stackPointer: so that arguments are<br>
> >actually followed. N.B. drives the above bug underground ;-).<br>
> >so that named constants (defines) are not elided.<br>
> ><br>
> >Newspeak:<br>
> >Remove landmine left from restructing implicit receiver and outer sends as<br>
> >clean sends.<br>
> ><br>
> >Slang:<br>
> >Fix constant elimination on arithmetic generation.<br>
> ><br>
> >Plugins:<br>
> >Regenerated because of changes in accessorDepth calculation,<br>
> >constant elimination, and read-before-use initialization.<br>
><br>
> My compiler is unhappy about assigning integers to various structs. I<br>
> guess a few type declarations are missing. See below.<br>
><br>
<br>
This looks like a change to the code generator, possibly to force<br>
initialization of variables. The variable declarations are in the<br>
Smalltalk source for OSProcessPlugin. There is no explicit assignment<br>
of zero to those structure variables in OSPP. I am guessing this was<br>
added to the C code generator (slang). Maybe that is not a good thing<br>
to do.<br></blockquote><div><br></div><div>But in <span class="Apple-style-span" style="border-collapse:collapse;font-size:14px;color:rgb(0,0,0)">CogVM source as per VMMaker.oscog-eem.1313</span></div><span class="Apple-style-span" style="border-collapse:collapse;font-size:14px;color:rgb(0,0,0)"><br>Make accessor depth calculation more accurate by not considering<br>fetchInteger:ofObject: and arraySize: et al as object accessors.<br><br>Make the read-before-written initializer safer, only initialzing simple types.<br></span><div><br></div><div><br></div><div>The point is that Smalltalk initializes all temporaries to nil, so for faithful translation Slang should initialize those variables read-before-written with 0. But there is plugin code for which a naive approach won't work. Still, the changes made to Slang have settled down and no longer is Slang generating erroneous initializations. So, IMO, this /is/ a good idea, it just needed polishing.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Dave<br>
<br>
<br>
<br>
> >Modified:<br>
> >branches/Cog/nsspursrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c<br>
> >===================================================================<br>
> >---<br>
> >branches/Cog/nsspursrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c<br>
> >2015-05-17 20:13:47 UTC (rev 3347)<br>
> >+++<br>
> >branches/Cog/nsspursrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c<br>
> >2015-05-17 23:03:01 UTC (rev 3348)<br>
> >@@ -1,5 +1,5 @@<br>
> >/* Automatically generated by<br>
> >- VMPluginCodeGenerator VMMaker.oscog-eem.1113 uuid:<br>
> >9b08eea7-d3db-440f-ba64-16abc799fcf8<br>
> >+ VMPluginCodeGenerator VMMaker.oscog-eem.1311 uuid:<br>
> >61f8144b-089d-4ca4-9e81-4ccfa6de0fc3<br>
> > from<br>
> > UnixOSProcessPlugin<br>
> > VMConstruction-Plugins-OSProcessPlugin.oscog-eem.50 uuid:<br>
> > 67b1e805-4efd-476c-8cf3-b4a5e14e22a9<br>
> > */<br>
> >@@ -1221,6 +1221,7 @@<br>
> > sqInt SigStackSize;<br>
> > stack_t sigstack;<br>
> ><br>
> >+ sigstack = 0;<br>
><br>
> sigstack is of type stack_t<br>
><br>
> > if (useSignalStack >= 0) {<br>
> > return useSignalStack != 0;<br>
> > }<br>
> >@@ -1456,6 +1457,8 @@<br>
> > FILEHANDLETYPE *writerIOStreamPtr;<br>
> > SQFile *writerPtr;<br>
> ><br>
> >+ readerIOStream = 0;<br>
> >+ writerIOStream = 0;<br>
> ><br>
> > /* Create the anonymous OS pipe */<br>
> ><br>
> >@@ -1517,6 +1520,8 @@<br>
> > FILEHANDLETYPE *writerIOStreamPtr;<br>
> > SQFile *writerPtr;<br>
> ><br>
> >+ readerIOStream = 0;<br>
> >+ writerIOStream = 0;<br>
> ><br>
> > /* Create the anonymous OS pipe */<br>
> ><br>
> >@@ -1945,6 +1950,7 @@<br>
> > sqInt semaphoreIndex;<br>
> > sqInt sigNum;<br>
> ><br>
> >+ semaphoreIndex = 0;<br>
> > index = stackValue(0);<br>
> > if (index == (nilObject())) {<br>
> > semaphoreIndex = 0;<br>
> >@@ -2440,6 +2446,8 @@<br>
> > FILEHANDLETYPE *writerIOStreamPtr;<br>
> > SQFile *writerPtr;<br>
> ><br>
> >+ readerIOStream = 0;<br>
> >+ writerIOStream = 0;<br>
> ><br>
> > /* Create the anonymous OS pipe */<br>
> ><br>
> >@@ -2502,6 +2510,8 @@<br>
> > FILEHANDLETYPE *writerIOStreamPtr;<br>
> > SQFile *writerPtr;<br>
> ><br>
> >+ readerIOStream = 0;<br>
> >+ writerIOStream = 0;<br>
> ><br>
> > /* Create the anonymous OS pipe */<br>
> ><br>
> >@@ -4147,6 +4157,7 @@<br>
> >{<br>
> > struct sigaction sigchldHandlerAction;<br>
> ><br>
> >+ sigchldHandlerAction = 0;<br>
> ><br>
> ># if defined(SA_NOCLDSTOP)<br>
> > sigchldHandlerAction.sa_sigaction = reapChildProcess;<br>
> >@@ -4192,6 +4203,8 @@<br>
> > struct sigaction oldHandlerAction;<br>
> > struct sigaction sigHandlerAction;<br>
> ><br>
> >+ oldHandlerAction = 0;<br>
> >+ sigHandlerAction = 0;<br>
><br>
> The above two have the type struct sigaction.<br>
><br>
><br>
> Levente<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>