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 |
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) |
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) > |
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, 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?
_,,,^..^,,,_ best, Eliot |
Free forum by Nabble | Edit this page |