[squeak-dev] The Inbox: Kernel-cmm.586.mcz

commits at source.squeak.org commits at source.squeak.org
Mon May 23 19:55:32 UTC 2011


A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-cmm.586.mcz

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

Name: Kernel-cmm.586
Author: cmm
Time: 23 May 2011, 2:54:46.188 pm
UUID: 08000000-1508-901b-1508-901b14000000
Ancestors: Kernel-fbs.585

Move Object>>'tracing' messages to ProtoObject to allow tracing of proxy objects.

=============== Diff against Kernel-fbs.585 ===============

Item was removed:
- ----- Method: Object>>chasePointers (in category 'tracing') -----
- chasePointers
- 	PointerFinder on: self!

Item was removed:
- ----- Method: Object>>explorePointers (in category 'tracing') -----
- explorePointers
- 	PointerExplorer new openExplorerFor: self!

Item was removed:
- ----- Method: Object>>inboundPointers (in category 'tracing') -----
- inboundPointers
- "Answers a collection of all objects in the system that point to myself"
- 
- 	^ self inboundPointersExcluding: #()!

Item was removed:
- ----- Method: Object>>inboundPointersExcluding: (in category 'tracing') -----
- inboundPointersExcluding: objectsToExclude
- "Answer a list of all objects in the system that point to me, excluding those in the collection of objectsToExclude. I do my best to avoid creating any temporary objects that point to myself, especially method and block contexts. Adapted from PointerFinder class >> #pointersTo:except:"
- 
- 	| anObj pointers objectsToAlwaysExclude |
- 	Smalltalk garbageCollect.
- 	"big collection shouldn't grow, so it's contents array is always the same"
- 	pointers := OrderedCollection new: 1000.
- 
- 	"#allObjectsDo: and #pointsTo: are expanded inline to keep spurious
- 	 method and block contexts out of the results"
- 	anObj := self someObject.
- 	[0 == anObj] whileFalse: [ "We must use #== here, to avoid leaving the loop when anObj is another number that's equal to 0 (e.g. 0.0)."
- 		anObj isInMemory
- 			ifTrue: [((anObj instVarsInclude: self)
- 				or: [anObj class == self])
- 					ifTrue: [pointers add: anObj]].
- 		anObj := anObj nextObject].
- 
- 	objectsToAlwaysExclude := {
- 		pointers collector.
- 		thisContext.
- 		thisContext sender.
- 		thisContext sender sender.
- 		objectsToExclude.
- 	}.
- 
- 	^ pointers removeAllSuchThat: [:ea |
- 		(objectsToAlwaysExclude identityIncludes: ea)
- 			or: [objectsToExclude identityIncludes: ea]]!

Item was removed:
- ----- Method: Object>>outboundPointers (in category 'tracing') -----
- outboundPointers
- "Answers a list of all objects I am causing not to be garbage-collected"
- 
- 	| collection |
- 	collection := OrderedCollection new.
- 	self outboundPointersDo: [:ea | collection add: ea].
- 	^ collection!

Item was removed:
- ----- Method: Object>>outboundPointersDo: (in category 'tracing') -----
- outboundPointersDo: aBlock
- "do aBlock for every object I point to, exactly how the garbage collector would. Adapted from PointerFinder >> #followObject:"
- 
- 	aBlock value: self class.
- 	1 to: self class instSize do: [:i | aBlock value: (self instVarAt: i)].
- 	1 to: self basicSize do: [:i | aBlock value: (self basicAt: i)].!

Item was added:
+ ----- Method: ProtoObject>>chasePointers (in category 'tracing') -----
+ chasePointers
+ 	PointerFinder on: self!

Item was added:
+ ----- Method: ProtoObject>>explorePointers (in category 'tracing') -----
+ explorePointers
+ 	PointerExplorer new openExplorerFor: self!

Item was added:
+ ----- Method: ProtoObject>>inboundPointers (in category 'tracing') -----
+ inboundPointers
+ "Answers a collection of all objects in the system that point to myself"
+ 
+ 	^ self inboundPointersExcluding: #()!

Item was added:
+ ----- Method: ProtoObject>>inboundPointersExcluding: (in category 'tracing') -----
+ inboundPointersExcluding: objectsToExclude
+ "Answer a list of all objects in the system that point to me, excluding those in the collection of objectsToExclude. I do my best to avoid creating any temporary objects that point to myself, especially method and block contexts. Adapted from PointerFinder class >> #pointersTo:except:"
+ 
+ 	| anObj pointers objectsToAlwaysExclude |
+ 	Smalltalk garbageCollect.
+ 	"big collection shouldn't grow, so it's contents array is always the same"
+ 	pointers := OrderedCollection new: 1000.
+ 
+ 	"#allObjectsDo: and #pointsTo: are expanded inline to keep spurious
+ 	 method and block contexts out of the results"
+ 	anObj := self someObject.
+ 	[0 == anObj] whileFalse: [ "We must use #== here, to avoid leaving the loop when anObj is another number that's equal to 0 (e.g. 0.0)."
+ 		anObj isInMemory
+ 			ifTrue: [((anObj instVarsInclude: self)
+ 				or: [anObj class == self])
+ 					ifTrue: [pointers add: anObj]].
+ 		anObj := anObj nextObject].
+ 
+ 	objectsToAlwaysExclude := {
+ 		pointers collector.
+ 		thisContext.
+ 		thisContext sender.
+ 		thisContext sender sender.
+ 		objectsToExclude.
+ 	}.
+ 
+ 	^ pointers removeAllSuchThat: [:ea |
+ 		(objectsToAlwaysExclude identityIncludes: ea)
+ 			or: [objectsToExclude identityIncludes: ea]]!

Item was added:
+ ----- Method: ProtoObject>>outboundPointers (in category 'tracing') -----
+ outboundPointers
+ "Answers a list of all objects I am causing not to be garbage-collected"
+ 
+ 	| collection |
+ 	collection := OrderedCollection new.
+ 	self outboundPointersDo: [:ea | collection add: ea].
+ 	^ collection!

Item was added:
+ ----- Method: ProtoObject>>outboundPointersDo: (in category 'tracing') -----
+ outboundPointersDo: aBlock
+ "do aBlock for every object I point to, exactly how the garbage collector would. Adapted from PointerFinder >> #followObject:"
+ 
+ 	aBlock value: self class.
+ 	1 to: self class instSize do: [:i | aBlock value: (self instVarAt: i)].
+ 	1 to: self basicSize do: [:i | aBlock value: (self basicAt: i)].!




More information about the Squeak-dev mailing list