[squeak-dev] The Trunk: Kernel-nice.584.mcz

commits at source.squeak.org commits at source.squeak.org
Sat May 7 12:38:43 UTC 2011


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.584.mcz

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

Name: Kernel-nice.584
Author: nice
Time: 7 May 2011, 2:37:16.885 pm
UUID: 099b94aa-ca97-4f91-b60c-0509e9211391
Ancestors: Kernel-ul.583

Correct #whichSelectorsStoreInto: again, obviously testing is required ;)

Give Metaclass a chance to detect which method/selector writes into a class var.
Otherwise, the extension is not really usefull, most of these write are in class side.

=============== Diff against Kernel-ul.583 ===============

Item was changed:
  ----- Method: Class>>whichSelectorsStoreInto: (in category 'testing') -----
  whichSelectorsStoreInto: varName 
  	"Answer a collection of selectors whose methods access the argument, varName, as a named class variable. Or let super try with a named instance variable."
  	| ref |
  	ref := self classPool
  		associationAt: varName
  		ifAbsent: [ ^ super whichSelectorsStoreInto: varName ].
+ 	^self methodDict keys select: [:aSelector | (self methodDict at: aSelector) writesRef: ref ]!
- 	^self methodDict keys select: [:eachMethod | eachMethod writesRef: ref ]!

Item was added:
+ ----- Method: Metaclass>>whichMethodsStoreInto: (in category 'testing') -----
+ whichMethodsStoreInto: varName 
+ 	"Answer a collection of CompiledMethod which store into the argument, varName, as a named class variable. Or let super try with a named instance variable."
+ 	| ref |
+ 	ref := self classPool
+ 		associationAt: varName
+ 		ifAbsent: [ ^ super whichMethodsStoreInto: varName ].
+ 	^self methodDict values select: [:eachMethod | eachMethod writesRef: ref ]!

Item was added:
+ ----- Method: Metaclass>>whichSelectorsStoreInto: (in category 'testing') -----
+ whichSelectorsStoreInto: varName 
+ 	"Answer a collection of selectors whose methods access the argument, varName, as a named class variable. Or let super try with a named instance variable."
+ 	| ref |
+ 	ref := self classPool
+ 		associationAt: varName
+ 		ifAbsent: [ ^ super whichSelectorsStoreInto: varName ].
+ 	^self methodDict keys select: [:aSelector | (self methodDict at: aSelector) writesRef: ref ]!




More information about the Squeak-dev mailing list