I cannot believe it but it seems to work. I would really appreaciate if someone can take a look, and consider to integrate it. <br>Having no way to execute a method on a receveir WITHOUT sending a message to the object, is really a problem. I am implementing proxies, which understand NOTHING (their class has method dictionary in nil and I use the cannotInterpret trick) and so I CANNOT send a message because I will be in loop. I have a similar problem with primitiveChangeClassTo:  but fortunately, Eliot did #adoptInstance: which receiver is the class and not the object. <br>
<br>Anyway, this is the method <br><br>CompiledMethod &gt;&gt; executeWithReceiver: aReceiver arguments: anArray <br> &quot;Execute the compiledMethod against the aReceiver and args in argArray.&quot;<br><br>&lt;primitive: 190&gt;<br>
   self primitiveFailed<br><br><br>And this is the primitive. <br><br><br>StackInterpreterPrimitives &gt;&gt; primitiveExecuteWithReceiverArguments<br>    &quot;method, recevier, and the array of arguments are on top of stack.  Execute method against receiver and args.<br>
     Set primitiveFunctionPointer because no cache lookup has been done for the method, and<br>     hence primitiveFunctionPointer is stale.&quot;<br>    | receiverMethod argCnt argumentArray primitiveIndex receiverObject |<br>
    receiverMethod := self stackValue: 2.<br>    receiverObject := self stackValue: 1.<br>    argumentArray := self stackTop.<br>    ((objectMemory isOopCompiledMethod: receiverMethod)<br>     and: [objectMemory isArray: argumentArray]) ifFalse:<br>
        [^self primitiveFailFor: PrimErrBadArgument].<br>    argCnt := self argumentCountOf: receiverMethod.<br>    argCnt = (objectMemory fetchWordLengthOf: argumentArray) ifFalse:<br>        [^self primitiveFailFor: PrimErrBadNumArgs].<br>
    self pop: 3.<br>    self push: receiverObject.<br>    0 to: argCnt - 1 do:<br>        [:i|<br>        self push: (objectMemory fetchPointer: i ofObject: argumentArray)].<br>    newMethod := receiverMethod.<br>    primitiveIndex := self primitiveIndexOf: newMethod.<br>
    primitiveFunctionPointer := self functionPointerFor: primitiveIndex inClass: nil.<br>    argumentCount := argCnt.<br>    &quot;We set the messageSelector for executeMethod below since things<br>     like the at cache read messageSelector and so it cannot be left stale.&quot;<br>
    messageSelector := objectMemory nilObject.<br>    self executeNewMethod.<br>    &quot;Recursive xeq affects primErrorCode&quot;<br>    self initPrimCall<br><br><br>Thanks for taking a look and hopefully integrate this or something better,<br>
<br>Mariano<br><br><br><div class="gmail_quote">On Wed, Apr 20, 2011 at 2:42 PM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 4/20/2011 14:29, Mariano Martinez Peck wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
CompiledMethod &gt;&gt; valueWithReceiver: aReceiver arguments: anArray<br>
    &quot;Execute compiledMethod against the receiver and args in argArray. The receiver is the CompiledMethod&quot;<br>
<br>
&lt;primitive: 666&gt;<br>
    self primitiveFailed<br>
<br>
<br>
Where the primitive is send directly, and not a message to the receiver.<br>
<br>
Is something like this available or I would need to create a new primitive?<br>
</blockquote>
<br></div>
Which by the way, is the primitive that should exist, and Object&gt;&gt;withArgs:executeMethod: should be nuked ASAP. There is no reason to pollute the Object namespace any more than absolutely necessary.<br>
<br>
Cheers,<br><font color="#888888">
  - Andreas<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>