Re: there is a subtle problem doing: mySlot := obj getSlot(slotname)

"Mildred Ki'Lya" <[email protected]> Tue, 8 Nov 2011 16:42:48 +0100
Newsgroups gmane.comp.lang.io
Message-ID <CAHU8Kxi8uQOuQANsVSSH8qHqLmU-mXZWn=kyKp0uSqOPxHyhxA@mail.gmail.com>
>
> That is a huge overhead on the system, wrapping all arguments in blocks.
> Block activation isn't exactly expensive, but when you start doing it all
> over the place, it adds up quickly. Using an inlineMethod would be
> marginally better, in terms of speed and pressure on the heap, but still
> would add up to significant overhead with the extra messages being used.
>

The idea was to wrap only objects that are activable, like the read barrier
you thought about. All other objects would be left unchanged.


>
> There's a simple solution which is cheap staring us in the face, I know
> it. Just haven't found it yet.
>

What about storing the activable bit with the slot itself, and introduce a
new operator.
I know, that  breaks code, but we can perhaps think further in that
direction for a solution that will be backward compatible.

The idea is simple, the activable bit is not stored in the method, but in
the object having the method as a slot. It is triggered using a new
operator. For instance:

A := Object clone do(
  performSomething <- method(...)
)

This would be equivalent to

A := Object clone do(
  newActivableSlot("performSomething", method(...))
)

When you do:

A performSomething

it would be equivalent to:

A getActivatedSlot("performSomething")

And getActivatedSlot would look to see if the slot was assigned using := or
<- operator (it would look up the activable bit). If the activable bit is
set for this slot, it would activate it before returning the result.

Mildred


-- 
Mildred Ki'Lya
http://mildred.fr