Hi Stefan,<div><br></div><div>    can you mail me your tests?<br><br><div class="gmail_quote">On Sun, Dec 11, 2011 at 4:59 PM, Stefan Marr <span dir="ltr">&lt;<a href="mailto:squeak@stefan-marr.de">squeak@stefan-marr.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Eliot:<br>
<br>
Are there any known issues with primitivePerformInSuperclass?<br>
<br>
And, ehm, what is the functionality that is supposed to be supported?<br>
<br>
I try with a doit, and everything works fine.<br>
But when it is used in a TestCase, it crashes :-/<br>
<br>
&quot;&quot;&quot;<br>
Exception Type:  EXC_BAD_ACCESS (SIGBUS)<br>
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000<br>
Crashed Thread:  0  Dispatch queue: com.apple.main-thread<br>
<br>
Thread 0 Crashed:  Dispatch queue: com.apple.main-thread<br>
0   org.squeakfoundation.Squeak         0x0004ef5a primitivePerformInSuperclass + 42<br>
<br>
Thread 1:  Dispatch queue: com.apple.libdispatch-manager<br>
[...]<br>
&quot;&quot;&quot;<br>
<br>
<br>
With regard to the supported functionality, I would expect it to mirror perform more or less exactly, but the image I use, only knows &#39;perform: selector withArguments: argArray inSuperclass: lookupClass&#39; which uses an explict array for the arguments.<br>

However, from the doIt, the code below seems to work.<br>
And, well, when I use the debugger, it works of course too...<br>
<br>
performSuper: aSymbol<br>
        &lt;primitive: 100&gt;<br>
        ^ self perform: aSymbol withArguments: (Array new: 0) inSuperclass: self class superclass<br>
<br>
performSuper: aSymbol with: anObject<br>
        &lt;primitive: 100&gt;<br>
        ^ self perform: aSymbol withArguments: (Array with: anObject) inSuperclass: self class superclass<br>
<br>
<br>
I also tried to put the code from the doit into a class, and see whether that indirection makes a difference, since I remember that you have some special treatment for doits in Cog, right?<br>
<br>
Thanks<br>
Stefan<br>
<br>
<br>
On 08 Dec 2011, at 03:01, Eliot Miranda wrote:<br>
<br>
&gt; Hi Stefan,<br>
&gt;<br>
&gt; On Wed, Dec 7, 2011 at 4:09 PM, Stefan Marr &lt;<a href="mailto:squeak@stefan-marr.de">squeak@stefan-marr.de</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi:<br>
&gt;<br>
&gt; &gt;From the current implementation, which I find in the interpreter, and from testing on Cog I assume that primitive 83, that is &#39;perform:&#39;, does easily handle an arbitrary number of parameters.<br>
&gt;<br>
&gt; Is that correct, or does for instance Cog do something else? (it does not seem so)<br>
&gt;<br>
&gt; That&#39;s correct. The primitive (InterpreterPrimitives&gt;&gt;primitivePerform) is written in terms of argumentCount and so should cope with any number of arguments up to the maximum (15 is the limit in CompiledMethod, 31 in the bytecode set I believe).<br>

&gt;<br>
&gt; I am just asking, because the number of parameters of the Object&gt;&gt;#perform:with: variants goes only up to three. And, the comment does not mention it. (at least in a recent Pharo image)<br>
&gt;<br>
&gt; Furthermore, I guess, there is an upper limit on the number of arguments with regard to frame size?<br>
&gt;<br>
&gt; Not in the StackVM or the Cog VM since these are running on a stack, not in a context, and so there&#39;s always plenty of headroom to push args on the stack during a perform.  At least the method/bytecode set&#39;s limit on argumentCount is going to bite before the stack size.  Similarly with perform:withArguments:, as long as the number of arguments is &lt;= LargeFrameSize (56 slots?) the primitive will push arguments.  Of course, the number of arguments must match the method that is found, and so the real limits are CompiledMethod&#39;s and the bytecode set&#39;s.<br>

&gt;<br>
&gt; cheers,<br>
&gt;<br>
&gt;<br>
&gt; Thanks<br>
&gt; Stefan<br>
&gt;<br>
&gt; --<br>
&gt; Stefan Marr<br>
&gt; Software Languages Lab<br>
&gt; Vrije Universiteit Brussel<br>
&gt; Pleinlaan 2 / B-1050 Brussels / Belgium<br>
&gt; <a href="http://soft.vub.ac.be/~smarr" target="_blank">http://soft.vub.ac.be/~smarr</a><br>
&gt; Phone: <a href="tel:%2B32%202%20629%202974" value="+3226292974">+32 2 629 2974</a><br>
&gt; Fax:   <a href="tel:%2B32%202%20629%203525" value="+3226293525">+32 2 629 3525</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
&gt;<br>
<font color="#888888"><br>
--<br>
Stefan Marr<br>
Software Languages Lab<br>
Vrije Universiteit Brussel<br>
Pleinlaan 2 / B-1050 Brussels / Belgium<br>
<a href="http://soft.vub.ac.be/~smarr" target="_blank">http://soft.vub.ac.be/~smarr</a><br>
Phone: <a href="tel:%2B32%202%20629%202974" value="+3226292974">+32 2 629 2974</a><br>
Fax:   <a href="tel:%2B32%202%20629%203525" value="+3226293525">+32 2 629 3525</a><br>
<br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>
</div>