[Pkg] The Trunk: Kernel-fbs.785.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jul 6 14:00:31 UTC 2013

Frank Shearar uploaded a new version of Kernel to project The Trunk:

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

Name: Kernel-fbs.785
Author: fbs
Time: 6 July 2013, 2:58:36.802 pm
UUID: c844ee59-dba5-ab4c-9ede-f6fb08725bcd
Ancestors: Kernel-fbs.784

Move ObjectOut to MorphicExtras-SqueakPage to be closer to the other sqp stuff. This at least separates SqueakPage code from Kernel, while we figure out how to properly disentagle things.

=============== Diff against Kernel-fbs.784 ===============

Item was removed:
- ProtoObject subclass: #ObjectOut
- 	instanceVariableNames: 'url page recursionFlag'
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'Kernel-Objects'!
- !ObjectOut commentStamp: '<historical>' prior: 0!
- I am a stand-in for an object that is out on the disk.  The object that is out on the disk is the head of a tree of objects that are out.  See SqueakPage.
- When any message is sent to me, I don't understand it, and bring in my true object.  I become myself with the objects and resend the message.  
- I may not represent the object nil.  
- The file is represented as a url, and that url may point at any file on the net.  
- page is a SqueakPage.
- If the cache already has an object, widely in use, that claims to be the object for my url, what do I do?  I can't become him, since others believe that he is the true object.  Run through memory and replace refs to me with refs to him.  Be careful not to trigger a fault.  Become me to a string, then find pointers and replace?
- [[[They don't want to end up holding an ObjectOut.  (would oscillate back and forth)  This is a problem.  A user could bring in two trees that both refer to a 3rd url.  (check with cache before installing any new ObjectOut) Two trees could be written to the same url.
- Or, I remain an ObjectOut, and keep getting notUnderstood, and keep returning the other guy.
- Or I smash the cache, and install MY page and object.  Other guy is a copy -- still in, but with no place in the cache.  When we both write to the same url, there will be trouble.]  No -- search and replace.]]]
- !

Item was removed:
- ----- Method: ObjectOut>>comeFullyUpOnReload: (in category 'object storage') -----
- comeFullyUpOnReload: smartRefStream
- 	"Normally this read-in object is exactly what we want to store.  Try to dock first.  If it is here already, use that one."
- 	| sp |
- 	"Transcript show: 'has ref to: ', url; cr."
- 	(sp := SqueakPageCache pageCache at: page ifAbsent: [nil]) ifNotNil: [
- 		sp isContentsInMemory ifTrue: [^ sp contentsMorph]].
- 	^ self!

Item was removed:
- ----- Method: ObjectOut>>doesNotUnderstand: (in category 'fetch from disk') -----
- doesNotUnderstand: aMessage 
- 	"Bring in the object, install, then resend aMessage"
- 	| realObject oldFlag response |
- 	oldFlag := recursionFlag.
- 	recursionFlag := true.
- 	"fetch the object"
- 	realObject := self xxxFetch.		"watch out for the become!!"
- 			"Now we ARE the realObject"
- 	oldFlag == true ifTrue: [
- 		response := (UIManager default chooseFrom: #('proceed normally' 'debug')
- 			title: 'Object being fetched for a second time.
- Should not happen, and needs to be fixed later.').
- 		response = 2 ifTrue: [self halt]].	"We are already the new object"
- 	"Can't be a super message, since this is the first message sent to this object"
- 	^ realObject perform: aMessage selector withArguments: aMessage arguments!

Item was removed:
- ----- Method: ObjectOut>>isInMemory (in category 'basics') -----
- isInMemory
- 	"We are a place holder for an object that is out."
- 	^ false!

Item was removed:
- ----- Method: ObjectOut>>objectForDataStream: (in category 'object storage') -----
- objectForDataStream: refStrm
-     "Return an object to store on a data stream (externalize myself)."
-     ^ self!

Item was removed:
- ----- Method: ObjectOut>>readDataFrom:size: (in category 'object storage') -----
- readDataFrom: aDataStream size: varsOnDisk
- 	"Make self be an object based on the contents of aDataStream, which was generated by the object's storeDataOn: method. Return self."
- 	| cntInstVars |
- 	cntInstVars := self xxxClass instSize.
- 	self xxxClass isVariable
- 		ifTrue: [self xxxClass error: 'needs updating']	"assume no variable subclasses"
- 		ifFalse: [cntInstVars := varsOnDisk].
- 	aDataStream beginReference: self.
- 	1 to: cntInstVars do:
- 		[:i | self xxxInstVarAt: i put: aDataStream next].
- "	1 to: cntIndexedVars do:
- 		[:i | self basicAt: i put: aDataStream next].
- "
- 	^ self!

Item was removed:
- ----- Method: ObjectOut>>storeDataOn: (in category 'object storage') -----
- storeDataOn: aDataStream
- 	"Store myself on a DataStream. See also objectToStoreOnDataStream.
- 	must send 'aDataStream beginInstance:size:'"
- 	| cntInstVars |
- 	cntInstVars := self class instSize.
- 	"cntIndexedVars := self basicSize."
- 	aDataStream
- 		beginInstance: self xxxClass
- 		size: cntInstVars "+ cntIndexedVars".
- 	1 to: cntInstVars do:
- 		[:i | aDataStream nextPut: (self xxxInstVarAt: i)].
- "	1 to: cntIndexedVars do:
- 		[:i | aDataStream nextPut: (self basicAt: i)]
- "!

Item was removed:
- ----- Method: ObjectOut>>url: (in category 'access') -----
- url: aString
- 	url := aString!

Item was removed:
- ----- Method: ObjectOut>>veryDeepCopyWith: (in category 'object storage') -----
- veryDeepCopyWith: deepCopier
- 	"Copy me and the entire tree of objects I point to.  An object in the tree twice is copied once, and both references point to him.  deepCopier holds a dictionary of objects we have seen.  Some classes refuse to be copied.  Some classes are picky about which fields get deep copied."
- 	| class index sub subAss new absent |
- 	new := deepCopier references at: self ifAbsent: [absent := true].
- 	absent ifNil: [^ new].	"already done"
- 	class := self xxxClass.
- 	class isMeta ifTrue: [^ self].		"a class"
- 	new := self xxxClone.
- 	"not a uniClass"
- 	deepCopier references at: self put: new.	"remember"
- 	"class is not variable"
- 	index := class instSize.
- 	[index > 0] whileTrue: 
- 		[sub := self xxxInstVarAt: index.
- 		(subAss := deepCopier references associationAt: sub ifAbsent: [nil])
- 			ifNil: [new xxxInstVarAt: index put: (sub veryDeepCopyWith: deepCopier)]
- 			ifNotNil: [new xxxInstVarAt: index put: subAss value].
- 		index := index - 1].
- 	new rehash.	"force Sets and Dictionaries to rehash"
- 	^ new
- !

Item was removed:
- ----- Method: ObjectOut>>xxxClass (in category 'basics') -----
- xxxClass
- 	"Primitive. Answer the object which is the receiver's class. Essential. See 
- 	Object documentation whatIsAPrimitive."
- 	<primitive: 111>
- 	self primitiveFailed!

Item was removed:
- ----- Method: ObjectOut>>xxxClone (in category 'basics') -----
- xxxClone
- 	<primitive: 148>
- 	self primitiveFailed!

Item was removed:
- ----- Method: ObjectOut>>xxxInstVarAt: (in category 'basics') -----
- xxxInstVarAt: index 
- 	"Primitive. Answer a fixed variable in an object. The numbering of the 
- 	variables corresponds to the named instance variables. Fail if the index 
- 	is not an Integer or is not the index of a fixed variable. Essential. See 
- 	Object documentation whatIsAPrimitive."
- 	<primitive: 73>
- 	self primitiveFailed !

Item was removed:
- ----- Method: ObjectOut>>xxxInstVarAt:put: (in category 'basics') -----
- xxxInstVarAt: anInteger put: anObject 
- 	"Primitive. Store a value into a fixed variable in the receiver. The 
- 	numbering of the variables corresponds to the named instance variables. 
- 	Fail if the index is not an Integer or is not the index of a fixed variable. 
- 	Answer the value stored as the result. Using this message violates the 
- 	principle that each object has sovereign control over the storing of 
- 	values into its instance variables. Essential. See Object documentation 
- 	whatIsAPrimitive."
- 	<primitive: 74>
- 	self primitiveFailed !

Item was removed:
- ----- Method: ObjectOut>>xxxReset (in category 'access') -----
- xxxReset
- 	"mark as never brought in"
- 	recursionFlag := nil!

More information about the Packages mailing list