'From Pharo1.3a of ''18 January 2011'' [Latest update: #13178] on 10 May 2011 at 5:49:35 pm'!!CompiledMethod methodsFor: 'source code management' stamp: 'IgorStasenko 5/10/2011 17:35'!destroySourcePointer	"If receiver has trailer with source pointer,	replace it with empty trailer. But do this only if receiver has a trailer with source pointer, but something else"	(self trailer hasSourcePointer) ifTrue: [		self becomeForward: (self copyWithTrailerBytes: CompiledMethodTrailer empty) ]! !!CompiledMethod methodsFor: 'source code management' stamp: 'IgorStasenko 5/10/2011 17:34'!dropSourcePointer	"When receiver is deinstalled from its class, its not managed anymore by development tools	and it's hard to predict, how long a method could stay in the image, because if it contains blocks,	they could still reference it. 	Therefore we trying to preserve as much as we can , actually by embedding the method's source code into its trailer	"	self trailer hasSourcePointer ifTrue: [		self becomeForward: 			(self copyWithTrailerBytes: 				(CompiledMethodTrailer new sourceCode: self getSource))]! !!Behavior methodsFor: 'adding/removing methods' stamp: 'IgorStasenko 5/10/2011 17:46'!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 VM's method cache, either by selector or by method.	Also, let old compiled method carry its own source code by embedding it	into trailer"	oldMethodOrNil ifNotNil: [		oldMethodOrNil flushCache.		oldMethodOrNil dropSourcePointer.		].	selector flushCache.! !!Behavior methodsFor: 'private' stamp: 'IgorStasenko 5/10/2011 17:48'!basicRemoveSelector: selector 	"Assuming that the argument, selector (a Symbol), is a message selector 	in my method dictionary, remove it and its method."	| oldMethod |	oldMethod := self methodDict at: selector ifAbsent: [^ self].	self methodDict removeKey: selector.	"Now flush Pharo's method cache, either by selector or by method"	oldMethod flushCache.	"Let method carry its own source code in trailer"	oldMethod dropSourcePointer.		selector flushCache! !