Tobias Pape uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-topa.743.mcz ==================== Summary ==================== Name: System-topa.743 Author: topa Time: 25 June 2015, 10:28:42.468 am UUID: c215550f-71ae-4d36-859e-c11709db1363 Ancestors: System-topa.742 Character special-casing: as for DataStream as for SmartRefStream =============== Diff against System-topa.742 =============== Item was changed: ----- Method: SmartRefStream>>readInstanceSize:clsname:refPosn: (in category 'read write') ----- readInstanceSize: instSize clsname: className refPosn: refPosn "The common code to read the contents of an arbitrary instance. ASSUMES: readDataFrom:size: sends me beginReference: after it instantiates the new object but before reading nested objects. NOTE: We must restore the current reference position after recursive calls to next. Three cases for files from older versions of the system: 1) Class has not changed shape, read it straight. 2) Class has changed instance variables (or needs fixup). Call a particular method to do it. 3) There is a new class instead. Find it, call a particular method to read. All classes used to construct the structures dictionary *itself* need to be in 'steady' and they must not change!! See setStream:" | anObject newName newClass dict oldInstVars isMultiSymbol | self flag: #bobconv. self setCurrentReference: refPosn. "remember pos before readDataFrom:size:" newName := renamed at: className ifAbsent: [className]. + newName == #Character + ifTrue: [^ self readCharacterOfSize: instSize]. isMultiSymbol := newName = #MultiSymbol or: [newName = #WideSymbol]. "isMultiSymbol ifTrue: [self halt]." newClass := Smalltalk at: newName asSymbol. (steady includes: newClass) & (newName == className) ifTrue: [ anObject := newClass isVariable "Create it here" ifFalse: [newClass basicNew] ifTrue: [newClass basicNew: instSize - (newClass instSize)]. anObject := anObject readDataFrom: self size: instSize. self setCurrentReference: refPosn. "before returning to next" isMultiSymbol ifTrue: [^ Symbol intern: anObject asString]. ^ anObject]. oldInstVars := structures at: className ifAbsent: [ self error: 'class is not in structures list']. "Missing in object file" anObject := newClass createFrom: self size: instSize version: oldInstVars. "only create the instance" self beginReference: anObject. dict := self catalogValues: oldInstVars size: instSize. "indexed vars as (1 -> val) etc." dict at: #ClassName put: className. "so conversion method can know it" "Give each superclass a chance to make its changes" self storeInstVarsIn: anObject from: dict. "ones with the same names" anObject := self applyConversionMethodsTo: anObject className: className varMap: dict. self setCurrentReference: refPosn. "before returning to next" isMultiSymbol ifTrue: [^ Symbol intern: anObject asString]. ^ anObject! |
Free forum by Nabble | Edit this page |