<div dir="ltr">Hi Denis, Hi Norbert,<div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 6, 2018 at 6:30 AM, Denis Kudriashov <span dir="ltr"><<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>></span> wrote:<br><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"><div dir="ltr"><div>Hi.</div><div><br></div><div>I guess "quick" methods are compiled as special primitives. For example accessors are primitives too:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><br></div><div>(Point >> #x) isPrimitive</div></blockquote><div><br></div><div> There is another method #isRealPrimitive which checks for explicit primitive call.</div></div></blockquote><div><br></div><div>That's right.  The scheme is as follows:</div><div><br></div><div>Numbered primitives used to be 9 bits fields and primitive numbers 1 through 255 were for conventional primitives, and primitive numbers 256 through 512 were for quick primitives, such that 256 through 263 pushed specific constants and 264 through 512 pushed the inst vars, 263 pushing inst var 0, 264 pushing inst var 1, etc.  Here's the relevant section of the VM's primitive table:</div><div><br></div><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">           </span>"Quick Push Const Methods"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">           </span>(256 nil) "primitivePushSelf"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>(257 nil) "primitivePushTrue"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>(258 nil) "primitivePushFalse"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">               </span>(259 nil) "primitivePushNil"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">         </span>(260 nil) "primitivePushMinusOne"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">            </span>(261 nil) "primitivePushZero"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>(262 nil) "primitivePushOne"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">         </span>(263 nil) "primitivePushTwo"</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>"Quick Push Inst Var Methods"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>(264 519 nil) "primitiveLoadInstVar"</div></div><div><br></div><div>Now we have 16 bits of primitive index.  The scheme up to 32767 is the same; 1 through 32767 are available for conventional primitives, with 256 through 512 reserved for quick primitives.  Numbers 32768 through 65535 are reserved for use "inline primitives".  We divide the 32k values from 32767 on up into four 8k groups.  Sista has the first 8k.  Lowcode has the second 8k, and the remaining two groups of 8k are unassigned, reserved for future use.</div><div><br></div><div><br></div><div>Now that SistaV1 and Spur support up to 64k inst vars one could argue that we should extend the range of numbers available to quick primitives.  But in the JIT there's no difference between the code generated for a quick primitive and the code generated for a conventional pshInstVar:/pushConstant:, methodReturnTop.  IQuicjk primitive serve to improve performance only in the interpreter.  So given that we have no classes defining more than 210 inst vars (in my image) I don't think its a pressing need :-)</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"><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-01-06 13:24 GMT+01:00 Norbert Hartl <span dir="ltr"><<a href="mailto:norbert@hartl.name" target="_blank">norbert@hartl.name</a>></span>:<br><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">Can anyone explain why<br>
<br>
(Morph>>#asDraggableMorph) isPrimitive.<br>
<br>
returns true?<br>
<span class="gmail-m_-3480718828073411440HOEnZb"><font color="#888888"><br>
Norbert<br></font></span></blockquote></div></div></div></div></blockquote></div><div><br></div><div 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>