<div dir="ltr"><div dir="ltr">On Tue, Aug 11, 2020 at 2:26 PM David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">One of the interesting aspects of Squeak is how a Class in the image is<br>
used to make new object instances in the Squeak VM object memory.<br>
<br>
I collected some of my recent notes on this topic and put them on the<br>
swiki at <a href="http://wiki.squeak.org/squeak/6646" rel="noreferrer" target="_blank">http://wiki.squeak.org/squeak/6646</a><br>
<br>
Dave<br></blockquote><div><br></div><div>You are right that some values in the instSpec are unused. However, the instSpec is only used to initialize each object's format bits. Some of the bits are used to store the size of values that are smaller than a full 32 bit word. The size in the object header always refers to full words, so the actual size in e.g. bytes is sizeInWords * 4 - sizeFromFormatBits.</div><div><br></div><div>So you can't use format code <span style="color:rgb(0,0,0)">9 to mean "indexable short (16-bit) field" because codes 8-</span><span style="color:rgb(0,0,0)">11 are already used for 8</span>-bit fields of differing sizes between whole words. Format 8 means all 4 bytes of the last word are used, format 9 means only 3 bytes of the last word are actually used, format 10 means 2 bytes are used, and format 11 means only one byte is used. (Or the other way around, I forgot)</div><div><br></div><div>To add 16 bit fields you need 2 unused format codes, one fore even and one for odd length.</div><div><br></div><div>For 64 bit fields you would only need a single code.</div><div><br></div><div>Unless you find another unused bit in the object header we don't have enough bits to represent both 16 and 64 bit arrays. One way may be to not ever allow odd 16 bit arrays I guess?</div><div><br></div><div>- Vanessa -<br></div><div> </div></div></div>