Hello lists,
(see http://en.wikipedia.org/wiki/Cell_division for explanation what mitosis is ;)
i just finished another torturing session in slang land, and finally made some of it working :)
I added a two new primitives, which aimed towards creating a new heap by cloning a designated set of objects from existing one. A first primitive is helps you to create a closed graph by reporting a set of objects which is referenced by objects in provided array, but not included in this array itself.
A second primitive is actually serves for creating a baby heap. I takes two array arguments: objects graph, and replacements (or substitutions).
The rules is simple: each object included in first array, should have references to objects which included in this array as well i.e. (objects identityIncludes: (objects at: x) someIvar ) == true
or if its not , then it can be found in a substitutions array. A substitutions array is a flat array of pairs oop -> index, where oop can be any oop, and index is a smallint index of item in objects array. Upon creation of new heap, all refs to oops in 'substitutions' array will be replaced by refs from 'objects' array by taking corresponding index.
Both array arguments should contain oops only (except from indexes in substitutions array) , should not contain duplicates and their intersection should be empty , i.e. (objects intersection: substitutions) isEmpty == true.
All of these rules actually serving to ensure that newly created object memory will form a fully closed graph (hence its oops can be cloned to a standalone object memory).
There are also, an initial example how to create a 'baby' object memory load http://www.squeaksource.com/HydraVM/HydraVM-sig.17.mcz
and do:
HydraClone new cloneIdleProcess
Of course you will need new VM. Sorry, i didn't published an update of sources yet. I can only give you a prebuilt one. Once i had a write access to ftp.squeak.org/HydraVM but i forgot credentials/key to it. (if Box Admins help me with this, i will upload it there). Or, you can write me in private and i will send you binaries.
P.S. I want to give a credit to Klaus D. Witzel who helped me to finish these new features, and inspired to do it :)