[Pkg] The Trunk: Kernel-eem.590.mcz

commits at source.squeak.org commits at source.squeak.org
Tue May 24 01:10:54 UTC 2011


Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.590.mcz

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

Name: Kernel-eem.590
Author: eem
Time: 23 May 2011, 6:10:15.256 pm
UUID: bbcacb44-5bd6-40fe-965a-697b4b126ffd
Ancestors: Kernel-nice.589

Fix whichSelectorsReferTo:special:byte:thorough: for
Float bindingOf: #NaN, so that one can browse references
to the NaN class var.
Use literaslsDo: instead of literals do: in spaceUsed.

=============== Diff against Kernel-nice.589 ===============

Item was changed:
  ----- Method: Behavior>>spaceUsed (in category 'private') -----
  spaceUsed
  	"Answer a rough estimate of number of bytes used by this class and its metaclass. Does not include space used by class variables."
  
  	| space |
  	space := 0.
  	self methodsDo: [:method |
  		space := space + 16.  "dict and org'n space"
  		space := space + (method size + 6 "hdr + avg pad").
+ 		method literalsDo: [:lit |
- 		method literals do: [:lit |
  			(lit isMemberOf: Array) ifTrue: [space := space + ((lit size + 1) * 4)].
  			(lit isMemberOf: Float) ifTrue: [space := space + 12].
  			(lit isMemberOf: ByteString) ifTrue: [space := space + (lit size + 6)].
  			(lit isMemberOf: LargeNegativeInteger) ifTrue: [space := space + ((lit size + 1) * 4)].
  			(lit isMemberOf: LargePositiveInteger) ifTrue: [space := space + ((lit size + 1) * 4)]]].
  		^ space!

Item was changed:
  ----- Method: Behavior>>whichSelectorsReferTo:special:byte:thorough: (in category 'testing method dictionary') -----
  whichSelectorsReferTo: literal special: specialFlag byte: specialByte thorough: thorough
  	"Answer a set of selectors whose methods access the argument as a literal. If thorough is true, then dives into the compact literal notation, making it slow but thorough "
  
  	| who |
  	who := IdentitySet new.
  	self selectorsAndMethodsDo: [ :selector :method |
  		(((thorough
  			ifFalse: [ method hasLiteral: literal ]
  			ifTrue: [ method hasLiteralThorough: literal ]) or: [
  				specialFlag and: [ method scanFor: specialByte ] ]) and: [
  			literal isVariableBinding not or: [
+ 				"N.B. (method indexOfLiteral: literal) < method numLiterals copes with l;ooking for
+ 				Float bindingOf: #NaN, since (Float bindingOf: #NaN) ~= (Float bindingOf: #NaN)."
+ 				(method indexOfLiteral: literal) ~= 0] ]) ifTrue: [
- 				method literals allButLast includes: literal] ]) ifTrue: [
  			who add: selector ] ].
  	^who!



More information about the Packages mailing list