CompiledMethod>>#valueWithReceiver:arguments:

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

CompiledMethod>>#valueWithReceiver:arguments:

Tim Johnson-2

Hi all,

Browsing through a 5.1+ image today, I noticed that CompiledMethod>>#valueWithReceiver:arguments: reads as follows.  Does this method indeed need to be changed?

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

Thanks,
Tim




Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethod>>#valueWithReceiver:arguments:

Tobias Pape
Hi

> On 19.03.2018, at 07:33, Tim Johnson <[hidden email]> wrote:
>
> Hi all,
>
> Browsing through a 5.1+ image today, I noticed that CompiledMethod>>#valueWithReceiver:arguments: reads as follows.  Does this method indeed need to be changed?
>
> 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

There are some places like that.
Maybe we really should tackle them already :D

best regards
        -Tobias


Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethod>>#valueWithReceiver:arguments:

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

On Mar 18, 2018, at 11:33 PM, Tim Johnson <[hidden email]> wrote:

Hi all,

Browsing through a 5.1+ image today, I noticed that CompiledMethod>>#valueWithReceiver:arguments: reads as follows.  Does this method indeed need to be changed?

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


If the system is to be used with exotic proxies (and it is) then yes, ish :-).  I think the VM changes are in place.  But the receiver:withArguments:executeMethod: method could be on the instance side.  So please /don't/ put it on the class side.  The class send is pointless.

  IMO it would be better to put the primitive in valueWithReceiver:arguments: itself, but presumably the authors thought it easier to avoid the stack shuffling required to remove the compiled method (something I find dubious; perform:withArguments: has to do more).  But that would require a new numbered primitive.

Thanks,
Tim