<br><br><div class="gmail_quote">On Thu, Mar 14, 2013 at 11:27 AM, Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Slang: foo isIntegerOop<br>
C: interpreterProxy->isIntegerObject(foo)<br>
<br>
Slang: interpreterProxy isIntegerObject: foo<br>
C: (foo & 1)<br>
<br>
SmartSyntaxInterpreterPlugin: y u no smart?<br></blockquote><div><br></div><div>IMO the second one is a bug. Notionally plugins can't assume the representation of SmallInteger so they should always use interpreterProxy->isIntegerObject(foo). Inside, the interpreter knows the representation and hence uses (foo & 1).</div>
<div><br></div><div>And note that the slow form just got faster for internal primitives. The Cog slang now generates</div><div><br></div><div><div>#if !defined(SQUEAK_BUILTIN_PLUGIN)</div><div>...</div><div>static sqInt (*isIntegerObject)(sqInt objectPointer);</div>
</div><div><div>...</div><div>#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */</div><div>...</div><div>extern sqInt isIntegerObject(sqInt objectPointer);</div></div><div>...</div><div><br></div><div>So no indirection through interpreterProxy for internal plugins. So one thing to do is to generate</div>
<div><div><div><br></div><div>#if !defined(SQUEAK_BUILTIN_PLUGIN)</div><div>...</div><div>static sqInt (*isIntegerObject)(sqInt objectPointer);</div></div><div><div>...</div><div>#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */</div>
<div>...</div><div># define isIntegerObject(objectPointer) ((sqInt)(objectPointer) & 1)</div></div><div>...</div></div><div><br></div><div><br></div><div>BTW, no senders of isIntegerOop in my Cog dev image.</div></div>
-- <br>best,<div>Eliot</div>