[Pharo-project] SmallInteger as Methods [WAS] Re: Ideas for CompiledMethod proxies?
On Sat, Nov 20, 2010 at 7:50 PM, Eliot Miranda <eliot.miranda@gmail.com>wrote:
On Sat, Nov 20, 2010 at 10:28 AM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
Thanks Levente. I like this idea. I've been doing proxies for classes, normal objects, etc and I never thought about using SmallIntegers. This is because I usually need to do a #become: between the original object and the proxy. But in this case this is not needed, since I just need a methodDict at: put: . And this is a good idea because I don't need an object header per proxy instance.
I will try to implement this. Thank you very much for all the answers.
I did a quick implementation and it works. The only problem is that you can't swap-out a method that's used by the swap-in code.
It doesn't work here. It seems I cannot use SmallInteger like methods. The #run:with:in: is never call and the image crashes.
That's simply a bug and we should fix it. What crashes, the Interpreter, Cog or both? Prepare a reproducible test case (image, change set etc) and we can try and fix this.
To reproduce just file in the attached cs. Then evaluate the following: TestCase methodDict at: #assert: put: 4. TestCase new assert: 'zaraza'. If works, you should have a debugger in SmallInteger >> #run:with:in: otherwise, a crash. I've tested in mac vms like: Squeak 4.2.5beta1U Squeak 5.8b4 and it crash. In Squeak 64-32 5.7b1 it just hangs forever (I guess at some point it will crash). And in Cog it works perfect! The problem is that I am using my own VM and I cannot use COG. So, if Cog has fixed this, I would like to know the changes so that to apply it to my VM. Maybe it is already fixed in latest VMMaker, but I couldn't compile it....(other story) Thanks for any help. Mariano
best Eliot
Example (be carefull, it may crash your image):
TestCase methodDict at: #assert: put: 4. TestCase new assert: 'zaraza'.
I am checking the VM side now to see if I find something.
Cheers
Mariano
Levente
Mariano
Levente
Thanks
Mariano
participants (1)
-
Mariano Martinez Peck