<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Fabio,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 13, 2020 at 2:00 PM Fabio Niephaus <<a href="mailto:lists@fniephaus.com">lists@fniephaus.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Mon, Jan 13, 2020 at 10:57 PM Fabio Niephaus <<a href="mailto:lists@fniephaus.com" target="_blank">lists@fniephaus.com</a>> wrote:<br>
><br>
> Hi Eliot,<br>
><br>
> If you believe plugins would benefit from these three classes, please<br>
> go ahead. There's not too much space left in the current<br>
> specialObjectsArray, but while we're talking about it: may I propose<br>
> to add SmallFloat64 at index 12 ("was BlockContext"). Or how does Cog<br>
> find/use this class in 64-bit images?<br>
<br>
Just had a look and it looks like Cog relies on the class to be at a<br>
fixed index in classTableFirstPage:<br>
<br>
classSmallFloat<br>
  <api><br>
  ^self fetchPointer: self smallFloatTag ofObject: classTableFirstPage<br>
<br>
Not sure this is a clean solution?<br></blockquote><div><br></div><div>The point is that the immediate tag patterns map to the classes for those tag patterns.  So taking the class table page as a zero-relative array</div><div><br></div><div>0 => nil</div><div>1 => SmallInteger<span class="gmail-Apple-tab-span" style="white-space:pre">         </span>- tag pattern 1 is SmallInteger in both 32 and 64 bit images)</div><div>2 => Character<span class="gmail-Apple-tab-span" style="white-space:pre">         - tag pattern 2 is Character in both 32 and 64 bit images</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">3 => SmallInteger          - tag pattern 3 is SmallInteger in 32 bit images (31 bit SmallIntegers)</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">4 => SmallFloat64            - tag pattern 4 is SmallFloat64 in 64-bit images</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">5 => nil</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">6 => nil</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">7 => nil</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">And so the class of an immediate is obtained by indexing the classTableFirstPage with its tag pattern.  Note also that in 64-bits testing for SmallInteger, Character and SmallFloat64 are single bit tests.  One does not need to do e.g. (oop asInteger bitAnd: 7) = 2 to identify a Character; one can simply do oop asInteger anyMask: 2.</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">I would describe this as clean simple and efficient.  What strikes you as unclean about it?</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
><br>
> newArray at: 10 put: BoxedFloat64.<br>
> ...<br>
> newArray at: 12 put: SmallFloat64. "was BlockContext."<br></blockquote><div><br></div><div>There is no need to provide the immediate classes; ione never synthesizes their instances via their class object.  One synthesizes using their tag pattern.  I'm wanting to use  index 12 for WideString, which is far more useful inside a plugin, given that we already have constructor functions for integer, character and float immediates.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
><br>
><br>
> Fabio<br>
><br>
> On Mon, Jan 13, 2020 at 8:22 PM tim Rowledge <<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>> wrote:<br>
> ><br>
> > Speaking from my magnificent golden embossed throne in the Great Hall of our bigly cathedral, I say unto you "go for it my son, and may you have success"<br>
> ><br>
> ><br>
> > > On 2020-01-13, at 9:47 AM, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br>
> > ><br>
> > > Hi All,<br>
> > ><br>
> > >     currently the following slots in the specialObjectsArray are unused in both Squeak and Pharo (& I suspect Cuis).<br>
> > ><br>
> > >       newArray at: 32 put: nil. "was the prototype Float"<br>
> > >       newArray at: 33 put: nil. "was the prototype 4-byte LargePositiveInteger"<br>
> > >       newArray at: 34 put: nil. "was the prototype Point"<br>
> > ><br>
> > > The specialObjectsArray already contains ByteArray<br>
> > >       newArray at: 27 put: ByteArray.<br>
> > ><br>
> > > I would like to have a full set of little-endian unsigned integer arrays.  In Spur Squeak these are ByteArray, DoubleByteArray, WordArray (Bitmap is big endian), and DoubleWordArray.  The VM's at:[put:] directly supports these four at the JIT level giving us efficient unsigned access.  There is also efficient signed access for some signed arrays but these are less useful (at least in theVM simulator).<br>
> > ><br>
> > > I want to make all four unsigned integer array classs available to plugins etc via the interpreterProxy.  So here's a formal request to reserve these values for use as follows:<br>
> > >       newArray at: 27 put: ByteArray.<br>
> > > ...<br>
> > >       newArray at: 32 put: DoubleByteArray.<br>
> > >       newArray at: 33 put: WordArray.<br>
> > >       newArray at: 34 put: DoubleWordArray.<br>
> > ><br>
> > > _,,,^..^,,,_<br>
> > > best, Eliot<br>
> > ><br>
> > ><br>
> ><br>
> ><br>
> > tim<br>
> > --<br>
> > tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
> > Fractured Idiom:- LE ROI EST MORT. JIVE LE ROI - The King is dead.  No kidding.<br>
> ><br>
> ><br>
> ><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div></div></div></div></div></div></div></div>