[Vm-dev] VM Maker: VMMaker-oscog.33.mcz
Eliot Miranda
eliot.miranda at gmail.com
Mon Sep 27 00:02:44 UTC 2010
On Sun, Sep 26, 2010 at 1:15 PM, stephane ducasse <
stephane.ducasse at gmail.com> wrote:
>
> should I conclude that before your change even the default old vm would
> crash when we put a SmallInteger in a methodDict?
>
Yes.
> Because if I would have know I would not ask my question. I thought it was
> for something else you had in mind.
>
> Stef
>
> >
> > Eliot
> >
> > I wanted to understand what: ' Have various places check for
> isOopCOmpiledMethod:
> > rather than isCompiledMethod: to allow SmallIntegers to be used as
> methods.'
> > means
> > in which circumstances do we want to have smalltalkIntegers used
> as methods?
> > when we put an object instead of a compiled method and that by
> accident this is an integer?
> >
> > Looking at the code for the standard Interpreter, if anyone tried
> >
> > self class addSelector: #foo withMethod: 0.
> > self foo.
> >
> > then the VM would crash trying to determine if 0 was a compiled method
> because the VM uses isCompiledMethod: and isCompiledMethod: does not (and
> should not, because it is used elsewhere) guard against a tagged object.
> isOopCompiledMethod: does guard against a tagged object:
> >
> > isOopCompiledMethod: oop
> > ^(self isNonIntegerObject: oop) and: [self isCompiledMethod: oop]
> >
> > isCompiledMethod: obj
> > ^(self formatOf: obj) >= 12
> >
> > So in practice it's not an issue; presumably no-one is using
> SmallIntegers as methods ("Doctor it hurts when I..."). But if the VM
> provides a facility it is nice for it to provide that facility robustly (if
> there is no significant impact on performance).
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100926/2da6e30c/attachment.htm
More information about the Vm-dev
mailing list