[Vm-dev] Re: SmallInetger as methods was not ready yet....now maybe?

Igor Stasenko siguctua at gmail.com
Fri Dec 3 18:33:53 UTC 2010

On 3 December 2010 19:15, Andreas Raab <andreas.raab at gmx.de> wrote:
> On 12/3/2010 10:07 AM, Igor Stasenko wrote:
>> On 3 December 2010 19:02, Andreas Raab<andreas.raab at gmx.de>  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. But it is easy to fix - just wrap
>>> your ints into something else and you're good to go.
>> clearly, VM should not crash if it finds smallint in method dictionary.
>> Of course, it may 'not work', but in less destructive way.
> Well, there are limits. By the same argument you can come up with any number
> of things that currently crash the VM where one might say the VM should
> react in a less destructive way (thisContext swapSender: 0 anyone?).
> Performance is important in this area and having to throw in a bunch of
> checks all over the place is something that I'm not to fond of.
> If you really want to do something here I'd do it entirely differently: Add
> a primitive to the VM that can answer the question "can you execute this
> object?" and use it before adding something to the method dictionary. That
> way you won't be able to create a method dictionary that contains stuff
> which is not executable.
the problem is, that when you want it, you can always end up with
method dictionary which contains 'non-executable' objects.

methodDict at: #foo put: foo.
foo becomeForward: somethingNonExecutable.

so, adding a primitive which tells if given object could be added to
method dictionary or not gives nothing in a sense of having
VM which doesn't crash at some point.

> Cheers,
>  - Andreas

Best regards,
Igor Stasenko AKA sig.

More information about the Vm-dev mailing list