[squeak-dev] The Trunk: System-mt.1141.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 4 15:52:40 UTC 2020

Marcel Taeumel uploaded a new version of System to project The Trunk:

==================== Summary ====================

Name: System-mt.1141
Author: mt
Time: 4 March 2020, 4:52:35.632827 pm
UUID: b85e0b36-6160-4947-b6ab-bfa1fd8223d1
Ancestors: System-mt.1140

To deprecate Behavior >> #forgetDoIts, copy the originial clean-up code to ImageSegment to deal for old segments later on. Maybe we can remove it even here.

=============== Diff against System-mt.1140 ===============

Item was changed:
  ----- Method: ImageSegment>>comeFullyUpOnReload: (in category 'fileIn') -----
  comeFullyUpOnReload: smartRefStream
  	"fix up the objects in the segment that changed size.  An object in the segment is the wrong size for the modern version of the class. Construct a fake class that is the old size.  Replace the modern class with the old one in outPointers.  Load the segment. Traverse the instances, making new instances by copying fields, and running conversion messages.  Keep the new instances.  Bulk forward become the old to the new.  Let go of the fake objects and classes.
  	After the install (below), arrayOfRoots is filled in. Globalize new classes.  Caller may want to do some special install on certain objects in arrayOfRoots.
  	May want to write the segment out to disk in its new form."
  	| mapFakeClassesToReal receiverClasses rootsToUnhiberhate myProject existing forgetDoItsClass endianness |
  	forgetDoItsClass := Set new.
  	RecentlyRenamedClasses := nil.		"in case old data hanging around"
  	mapFakeClassesToReal := smartRefStream reshapedClassesIn: outPointers.
  		"Dictionary of just the ones that change shape. Substitute them in outPointers."
  	self fixCapitalizationOfSymbols.
  	endianness := self endianness.
  	segment := self loadSegmentFrom: segment outPointers: outPointers.
  	arrayOfRoots := segment first.
  	mapFakeClassesToReal isEmpty ifFalse: [
  		self reshapeClasses: mapFakeClassesToReal refStream: smartRefStream
  	"When a Project is stored, arrayOfRoots has all objects in the project, except those in outPointers"
  	arrayOfRoots do: [:importedObject |
  		((importedObject isMemberOf: WideString) or: [importedObject isMemberOf: WideSymbol]) ifTrue: [
  			importedObject mutateJISX0208StringToUnicode.
  			importedObject class = WideSymbol ifTrue: [
  				"self halt."
  				Symbol hasInterned: importedObject asString ifTrue: [:multiSymbol |
  					multiSymbol == importedObject ifFalse: [
  						importedObject becomeForward: multiSymbol.
  		(importedObject isMemberOf: TTCFontSet) ifTrue: [
  			existing := TTCFontSet familyName: importedObject familyName
  						pointSize: importedObject pointSize.	"supplies default"
  			existing == importedObject ifFalse: [importedObject becomeForward: existing].
  	receiverClasses := self restoreEndianness: endianness ~~ Smalltalk endianness.		"rehash sets"
  	smartRefStream checkFatalReshape: receiverClasses.
  	"Classes in this segment."
  	arrayOfRoots do: [:importedObject |
  		importedObject class class == Metaclass ifTrue: [forgetDoItsClass add: importedObject. self  declare: importedObject]].
  	rootsToUnhiberhate := OrderedCollection new.
  	arrayOfRoots do: [:importedObject |
  		((importedObject isMemberOf: ScriptEditorMorph)
  			or: [(importedObject isKindOf: TileMorph)
  				or: [(importedObject isMemberOf: ScriptingTileHolder)
  					or: [importedObject isKindOf: CompoundTileMorph]]]) ifTrue: [
  			rootsToUnhiberhate add: importedObject
  		(importedObject isMemberOf: Project) ifTrue: [
  			myProject := importedObject.
  			importedObject ensureChangeSetNameUnique.
  			Project addingProject: importedObject.
  			importedObject restoreReferences.
  			self dependentsRestore: importedObject.
  			ScriptEditorMorph writingUniversalTiles:
  				((importedObject projectPreferenceAt: #universalTiles) ifNil: [false])]].
  	myProject ifNotNil: [
  		myProject world setProperty: #thingsToUnhibernate toValue: rootsToUnhiberhate asArray.
  	mapFakeClassesToReal isEmpty ifFalse: [
  		mapFakeClassesToReal keysAndValuesDo: [:aFake :aReal |
  			aFake removeFromSystemUnlogged.
  			aFake becomeForward: aReal].
  		SystemOrganization removeEmptyCategories].
+ 	forgetDoItsClass do: [:c | self forgetDoItsInClass: c].
- 	forgetDoItsClass do: [:c | c forgetDoIts].
  	"^ self"

Item was added:
+ ----- Method: ImageSegment>>forgetDoItsInClass: (in category 'private') -----
+ forgetDoItsInClass: aClass
+ 	"get rid of old DoIt methods and bogus entries in the ClassOrganizer."
+ 	SystemChangeNotifier uniqueInstance doSilently: [
+ 		aClass organization
+ 			removeElement: #DoIt;
+ 			removeElement: #DoItIn:.
+ 	].
+ 	aClass 
+ 		basicRemoveSelector: #DoIt;
+ 		basicRemoveSelector: #DoItIn:!

More information about the Squeak-dev mailing list