<br><br><div class="gmail_quote">On Thu, May 7, 2009 at 10:45 AM, Yoshiki Ohshima <span dir="ltr">&lt;<a href="mailto:yoshiki@vpri.org">yoshiki@vpri.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
At Thu, 7 May 2009 09:04:54 -0700,<br>
<div class="im">Eliot Miranda wrote:<br>
&gt;<br>
&gt; - remove stack access from the API, writing them as SmartSyntaxPlugins where arguments are passed in as parameters,<br>
&gt; returning the result on success and 0 (not SmallInteger 0) on<br>
&gt; failure<br>
<br>
</div>  In these days, nobody would care much about it, but this would<br>
make it harder to simulate a platform independent performance primitive in the image?</blockquote><div><br></div><div>I don&#39;t think it makes any difference.  In the simulator the VM could e.g. use perform:withArguments: to invoke the primitive.  The real VM needs to do something similar and have glue to the platform&#39;s native calling convention, which can be as simple as a 32-element switch statement:</div>
<div><span class="Apple-style-span" style="white-space: pre; ">                </span>switch (numArgs) {</div><div><span class="Apple-style-span" style="white-space: pre; ">                </span>case 0: result = primitiveFunctionPointer(stackTop()); break;</div>
<div><span class="Apple-style-span" style="white-space: pre; ">                </span>case 1: result = primtiveFunctionPointer(stackValue(1),stackTop); break;</div><div><span class="Apple-style-span" style="white-space: pre; ">                </span>...</div>
<div>or as sophisticated as machine code generated on the fly.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">&gt; - provide isImmediateObject: and use it in place of isIntegerObject: when the objective is to select heap objects. Use<br>

&gt; isCharacterObject: when the objective is to select a character. I<br>
&gt; intend to add immediate characters within the next few months.<br>
<br>
</div>  Are you going to use UTF-32 or UTF-16 for it?</blockquote><div><br></div><div>Characters would be Unicode code points (WideString is UTF-32 right?).  UTF-16 is a variable-length string encoding.  Presumably there will be primitive converters to/from UTF-16 to WideString.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<font color="#888888"><br>
-- Yoshiki<br>
<br>
</font></blockquote></div><br>