The Trunk: Kernel-ul.964.mcz

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

The Trunk: Kernel-ul.964.mcz

commits-2
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.964.mcz

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

Name: Kernel-ul.964
Author: ul
Time: 2 November 2015, 4:56:32.76 am
UUID: 5dbe95ce-96e3-4f4d-bdb1-520c50def26c
Ancestors: Kernel-nice.963

Spur-compatible Object >> #inboundPointersExcluding:.

=============== Diff against Kernel-nice.963 ===============

Item was changed:
  ----- Method: Object>>inboundPointersExcluding: (in category 'tracing') -----
  inboundPointersExcluding: objectsToExclude
  "Answer a list of all objects in the system that hold a reference to me, excluding those in the collection of objectsToExclude."
 
  | pointers object objectsToAlwaysExclude |
  Smalltalk garbageCollect.
  pointers := OrderedCollection new.
+ self systemNavigation allObjectsOrNil ifNotNil: [ :allObjects |
+ objectsToAlwaysExclude := {
+ allObjects.
+ thisContext.
+ thisContext sender.
+ thisContext sender sender.
+ objectsToExclude.
+ }.
+ 1 to: allObjects size do: [ :index |
+ object := allObjects at: index.
+ (object pointsTo: self) ifTrue: [
+ ((objectsToAlwaysExclude identityIncludes: object)
+ or: [ objectsToExclude identityIncludes: object ])
+ ifFalse: [ pointers add: object ] ] ].
+ ^pointers ].
  "SystemNavigation >> #allObjectsDo: is inlined here with a slight modification: the marker object is pointers. This gives better results, because the value of pointers, it's inner objects and transient method contexts will not be iterated over."
  object := self someObject.
  [ object == pointers ] whileFalse: [
  (object isInMemory and: [ object pointsTo: self ]) ifTrue: [
  pointers add: object ].
  object := object nextObject ].
  objectsToAlwaysExclude := {
  thisContext.
  thisContext sender.
  thisContext sender sender.
  objectsToExclude.
  }.
  ^pointers removeAllSuchThat: [ :ea |
  (objectsToAlwaysExclude identityIncludes: ea)
  or: [ objectsToExclude identityIncludes: ea ] ]!