On 22 Mar 2012, at 14:45, Camillo Bruni wrote: > let's have some fun and do > > Object subclass: #Behavior > uses: TPureBehavior > instanceVariableNames: 'superclass methodDict format layout' > classVariableNames: 'ObsoleteSubclasses' > poolDictionaries: '' > category: 'Kernel-Classes' > > proceed over the several warnings not to change Behavior and BOOM! :D
Check classNameIndex and thisClassIndex in the VM implementation. They are typically the hardcoded indices into the expected object layout of Class objects. And you just changed the layout -> BOOM! magic ;) I don't know how much overhead it is to examine such kind of indices dynamically, but we do deduce indices based on inst var names to be able to support the different object layouts. For my stuff, I do that at VM startup, which would not help you. David did it dynamically for the Process class and checked the object identity of the class I think, to know when to update the index table after a layout change. Best regards Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525