[Vm-dev] Why "object becomeForward: 3" is not working?

Denis Kudriashov dionisiydk at gmail.com
Thu Mar 17 13:35:27 UTC 2016


So to implement becomeForward: with integer argument it is needed to scan
all references to receiver and change pointers body to hold integer value.
Am I right?

2016-03-17 13:52 GMT+01:00 David T. Lewis <lewis at mail.msen.com>:

>
> On Thu, Mar 17, 2016 at 09:57:51AM +0100, Denis Kudriashov wrote:
> >
> > Hi.
> >
> > I investigate that #becomeForward: is not working for SmallInteger args.
> It
> > is mentioned in method comment:
> >
> > Fails if either argument is a SmallInteger.
> >
> >
> > I guess that it is not working for any immediate argument. For example it
> > is failed for Character too.
> >
> > So I am interesting why it is not supported?
>
> The become mechanism is swapping references to objects, such that the
> object pointers that pointed to one object are all now pointing to another.
> An immediate object such as SmallInteger is hiding its value within the
> object pointer itself (so it not really a pointer when used in this way).
> The immediate object "pointer" is therefore not able to participate in
> reference swapping.
>
> Dave
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160317/0fbe0771/attachment.htm


More information about the Vm-dev mailing list