CompiledMethod>>#valueWithReceiver:arguments: deprecated implementation?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CompiledMethod>>#valueWithReceiver:arguments: deprecated implementation?

patrick.rein
Hi everyone,

a while back we discovered the following method with a comment:

CompiledMethod>>#valueWithReceiver: aReceiver arguments: anArray
        "This should be changed after the release of Squeak 4.3 to
                ^self class receiver: aReceiver withArguments: anArray executeMethod: self"
        ^ aReceiver withArgs: anArray executeMethod: self
       
Is the comment still valid? Should this be changed? I changed it in my image and have not seen any problems. Also the Kernel-Methods tests are running fine. Does anyone know more about the comment?

Bests
Patrick

Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethod>>#valueWithReceiver:arguments: deprecated implementation?

Eliot Miranda-2
Hi Patrick,

> On Dec 11, 2018, at 6:39 AM, <[hidden email]> <[hidden email]> wrote:
>
> Hi everyone,
>
> a while back we discovered the following method with a comment:
>
> CompiledMethod>>#valueWithReceiver: aReceiver arguments: anArray
>    "This should be changed after the release of Squeak 4.3 to
>        ^self class receiver: aReceiver withArguments: anArray executeMethod: self"
>    ^ aReceiver withArgs: anArray executeMethod: self
>    
> Is the comment still valid? Should this be changed? I changed it in my image and have not seen any problems. Also the Kernel-Methods tests are running fine. Does anyone know more about the comment?

I believe it’s my comment.  The point is that a proxy object won’t inherit [Proto]Object>>#withArgs:executeMethod: and so sending #withArgs:executeMethod: to it won’t do what’s expected at all.  The solution is to use a mirror primitive.  So yes, we should indeed make this change.  Someone (me?) needs to check that the VM support is there.  

>
> Bests
> Patrick

Eliot
_,,,^..^,,,_ (phone)

Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethod>>#valueWithReceiver:arguments: deprecated implementation?

patrick.rein
Hi Eliot,

I do not know whether that is of any help but I also noticed that the three implementations (Object/ProtoObject and CompiledMethod class) all point to primitive 188.

Bests
Patrick

>Hi Patrick,
>
>> On Dec 11, 2018, at 6:39 AM, <[hidden email]> <[hidden email]> wrote:
>>
>> Hi everyone,
>>
>> a while back we discovered the following method with a comment:
>>
>> CompiledMethod>>#valueWithReceiver: aReceiver arguments: anArray
>>    "This should be changed after the release of Squeak 4.3 to
>>        ^self class receiver: aReceiver withArguments: anArray executeMethod: self"
>>    ^ aReceiver withArgs: anArray executeMethod: self
>>    
>> Is the comment still valid? Should this be changed? I changed it in my image and have not seen any problems. Also the Kernel-Methods tests are running fine. Does anyone know more about the comment?
>
>I believe it’s my comment.  The point is that a proxy object won’t inherit [Proto]Object>>#withArgs:executeMethod: and so sending #withArgs:executeMethod: to it won’t do what’s expected at all.  The solution is to use a mirror primitive.  So yes, we should indeed make this change.  Someone (me?) needs to check that the VM support is there.  
>
>>
>> Bests
>> Patrick
>
>Eliot
>_,,,^..^,,,_ (phone)
>

Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethod>>#valueWithReceiver:arguments: deprecated implementation?

Eliot Miranda-2
In reply to this post by Eliot Miranda-2
Hi Patrick,

On Tue, Dec 11, 2018 at 7:22 AM <[hidden email]> wrote:
Hi Eliot,

I do not know whether that is of any help but I also noticed that the three implementations (Object/ProtoObject and CompiledMethod class) all point to primitive 188.

That's correct.  The primitive will serve for any of these signatures:

Smalltalk:
[Proto]Object>>withArgs: anArray executeMethod: aCompiledMethod
CompiledMethod class>>receiver: anObject withArguments: anArray executeMethod: aCompiledMethod

Newspeak:
VMMirror>>ifFail: aBlock object: anObject with: anArray executeMethod: aCompiledMethod

And the primitive did get updated for Spur so there's no problem with rewriting CompiledMethod>>#valueWithReceiver:arguments: to use CompiledMethod class>>receiver:withArguments:executeMethod:.  Do you want to do it or do you want me to do it?


Bests
Patrick

>Hi Patrick,
>
>> On Dec 11, 2018, at 6:39 AM, <[hidden email]> <[hidden email]> wrote:
>>
>> Hi everyone,
>>
>> a while back we discovered the following method with a comment:
>>
>> CompiledMethod>>#valueWithReceiver: aReceiver arguments: anArray
>>    "This should be changed after the release of Squeak 4.3 to
>>        ^self class receiver: aReceiver withArguments: anArray executeMethod: self"
>>    ^ aReceiver withArgs: anArray executeMethod: self
>>   
>> Is the comment still valid? Should this be changed? I changed it in my image and have not seen any problems. Also the Kernel-Methods tests are running fine. Does anyone know more about the comment?
>
>I believe it’s my comment.  The point is that a proxy object won’t inherit [Proto]Object>>#withArgs:executeMethod: and so sending #withArgs:executeMethod: to it won’t do what’s expected at all.  The solution is to use a mirror primitive.  So yes, we should indeed make this change.  Someone (me?) needs to check that the VM support is there. 
>
>>
>> Bests
>> Patrick
>
>Eliot
>_,,,^..^,,,_ (phone)
>



--
_,,,^..^,,,_
best, Eliot