oh , and forgot to note, that having a source code available at all times is quite useful in cases, when your methods using some kind of DSL. Because decompiler can only reconstruct a source code of smalltalk methods, but not the ones, which were authored using customized parser/compiler .. like using Helvetia.
Btw, the change i proposing is _minimal_ and straightforward: basicAddSelector: selector withMethod: compiledMethod "Add the message selector with the corresponding compiled method to the receiver's method dictionary. Do this without sending system change notifications" | oldMethodOrNil | oldMethodOrNil := self lookupSelector: selector. self methodDict at: selector put: compiledMethod. compiledMethod methodClass: self. compiledMethod selector: selector. "Now flush Pharo's method cache, either by selector or by method" oldMethodOrNil ifNotNil: [ oldMethodOrNil flushCache. ++++ oldMethodOrNil dropSourcePointer. ]. selector flushCache. :) -- Best regards, Igor Stasenko AKA sig.