The Trunk: System-mt.1218.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-mt.1218.mcz

commits-2
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1218.mcz

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

Name: System-mt.1218
Author: mt
Time: 18 February 2021, 4:54:03.4367 pm
UUID: 1cbfb74f-d6b3-6c49-986a-c17bb1760d43
Ancestors: System-mt.1217

Removes dependency of System from EToys with a pragma-based extension.

=============== Diff against System-mt.1217 ===============

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 existing forgetDoItsClass endianness |
- | 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])]].
 
+ "Let all extensions work with the current arrayOfRoots."
+ self processRoots.
- 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].
  "^ self"
  !

Item was added:
+ ----- Method: ImageSegment>>processRoots (in category 'fileIn') -----
+ processRoots
+
+ ImageSegment methodsDo: [:method |
+ (method hasPragma: #rootsEnumerator) ifTrue: [
+ self executeMethod: method]].!