[Pharo-project] Ideas for CompiledMethod proxies?
eliot.miranda at gmail.com
Tue Nov 30 23:45:59 CET 2010
On Tue, Nov 30, 2010 at 2:33 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:
> Thanks to both for answering me.
> Now, I have very very newbie question.
> In my case, JUST BECAUSE i am testing, I directly access the CompiledMethod
> using MethodDictionary >> #at:ifAbsent:
> thus, I can intercept and load back the original proxy.
> Now, if I understood well, when you send a simple message to an object, the
> method lookup is done at VM side, and there is no call to MethodDictionary
> >> #at:ifAbsent:
> So, what I am saying is that someone (the system) can send messages to a
> SmallInteger that acts as a compiled methods, without accessing it by
> MethodDictionary >> #at:ifAbsent:.
> If that message is understood by the SmallInetger, then it will probably
> answer something different than the original method.
You're forgetting that the VM executes the methods it finds in a method
dictionary, except if the VM finds other than a CompiledMethod in a method
dictionary, in which case it sends run:with:in: to it. So the VM won't send
anything to the SmallInteger method proxy other than run:with:in:. If it
didn't send run:with:in: it would crash trying to execute the SmallInteger.
> Now, maybe what I am thinking cannot happen.
> Thanks once again
> On Tue, Nov 30, 2010 at 10:23 PM, Levente Uzonyi <leves at elte.hu> wrote:
>> On Tue, 30 Nov 2010, Igor Stasenko wrote:
>> .. and then you need to change #do: , #associationsDo: etc etc..
>> Or he can subclass MethodDictionary and override those methods.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-project