[Vm-dev] Re: SmallInetger as methods was not ready yet....now
leves at elte.hu
Fri Dec 3 22:12:14 UTC 2010
On Fri, 3 Dec 2010, stephane ducasse wrote:
> On Dec 3, 2010, at 7:02 PM, Andreas Raab wrote:
>>> maybe supporting SmallInteger as methods was not a good idea :(
>> FWIW, Objects as methods weren't intended for SmallInts; they were intended for stuff like method wrappers. Using SmallIntegers for methods is a hack and I'm not surprised it doesn't work.
> Me too. They were worked well for normal objects. This is good and valuable hook.
>> But it is easy to fix - just wrap your ints into something else and you're good to go.
> It does not work in mariano special need because the idea was to push as far as possible the idea that we do not have to allocate any new objects and avoid any proxy memory allocation cost. So clearly this is may be a too hackish hack. Else a plain simple (but allocating memory proxy works well but we wanted to know what is the lowest boundary).
I have a working package that can swap out CompiledMethods and replace
them with SmallIntegers in the MethodDictionaries. When the method is
about to be used by the system, the CompiledMethod is automatically
swapped back. It uses the existing ObjectsAsMethods implementation, so I
say that SmallIntegers can be used like any other object in this regard.
I didn't test it with SqueakVM, but it definitely works with CogVM.
>> - Andreas
More information about the Vm-dev