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

David T. Lewis lewis at mail.msen.com
Thu Mar 17 12:52:48 UTC 2016

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.


More information about the Vm-dev mailing list