[Vm-dev] Re: A trick to speedup #become: (but not becomeForward:)

Igor Stasenko siguctua at gmail.com
Sun Jul 31 16:24:18 UTC 2011


I found that similar primitive could be implemented to behave
analogically to becomeForward:
(to copy memory contents of one object over another one).

This is not strictly equivalent to becomeForward, since

if you have objects x , y
and forwarding x -> y
then all who were pointing to x will point to y.

While with copy-over, obviously the pointers remain unchanged. But it
may be not too important, since
the most often use case for #becomeForward: is like:

newObject := SomeClass new.
newObject initAndFillContents bla bla.

SomeGlobalObject becomeForward: newObject

( and newObject is not used anywhere outside this scope)

It is clear in such case, copying newObject contents ->
SomeGlobalObject will be enough for developer's intents,
and therefore an additional primitive which copies bytes from one
object to another could also be useful.


And yes, i'd like to hear your concerns about these primitives in
addition to what Andreas said.
Since i think we should introduce them into VMs to dramatically
speedup become :)


-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list