[Pkg] The Trunk: System-mt.1076.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Aug 2 07:20:19 UTC 2019


Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1076.mcz

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

Name: System-mt.1076
Author: mt
Time: 2 August 2019, 9:20:11.092774 am
UUID: fbc3d082-9bf6-9c4e-bbdc-68998f044637
Ancestors: System-mt.1075

Fixes sent-messages and global-refs lookup in system navigation.

=============== Diff against System-mt.1075 ===============

Item was changed:
  ----- Method: SystemNavigation>>allGlobalRefsWithout: (in category 'query') -----
  allGlobalRefsWithout: classesAndMessagesPair 
  	"Answer a set of symbols that may be refs to Global names. In some  
  	sense we should only need the associations, but this will also catch, eg,  
  	HTML tag types. This method computes its result in the absence of  
  	specified classes and messages."
+ 
- 	"may be a problem if namespaces are introduced as for the moment  
- 	only Smalltalk is queried. sd 29/4/03"
  	| globalRefs absentClasses absentSelectors |
  	globalRefs := IdentitySet new: CompiledMethod instanceCount.
  	absentClasses := classesAndMessagesPair first.
  	absentSelectors := classesAndMessagesPair second.
  	"sd 29/04/03"
  	Cursor execute
+ 		showWhile: [self environment allClassesAndTraitsDo:
+ 				[:cls | ((absentClasses includes: cls)
- 		showWhile: [self environment allClassesDo:
- 				[:cls | ((absentClasses includes: cls name)
  						ifTrue: [{}]
  						ifFalse: [{cls. cls class}])
  						do: [:cl | (absentSelectors isEmpty
  								ifTrue: [cl selectors]
  								ifFalse: [cl selectors copyWithoutAll: absentSelectors])
  								do: [:sel | "Include all capitalized symbols for good 
  									measure"
  									(cl compiledMethodAt: sel) allLiteralsDo: [:m |
  										((m isSymbol)
  												and: [m size > 0
  														and: [m first canBeGlobalVarInitial]])
  											ifTrue: [globalRefs add: m].
  										]]]]].
  	^ globalRefs!

Item was changed:
  ----- Method: SystemNavigation>>allSentMessagesWithout: (in category 'query') -----
  allSentMessagesWithout: classesAndMessagesPair 
  	"Answer the set of selectors which are sent somewhere in the system,  
  	computed in the absence of the supplied classes and messages."
  	| sent absentClasses absentSelectors |
  	sent := IdentitySet new: CompiledMethod instanceCount.
  	absentClasses := classesAndMessagesPair first.
  	absentSelectors := classesAndMessagesPair second.
  	"sd 29/04/03"
  	Cursor execute showWhile: [
  		self environment allClassesAndTraitsDo: [:cls |
+ 			((absentClasses includes: cls)
- 			((absentClasses includes: cls name)
  				ifTrue: [{}]
  				ifFalse: [{cls. cls classSide}])
  					do: [:each | (absentSelectors isEmpty
  						ifTrue: [each selectors]
  						ifFalse: [each selectors copyWithoutAll: absentSelectors])
  						do: [:sel | "Include all sels, but not if sent by self"
  							(each compiledMethodAt: sel) allLiteralsDo: [:m | 
+ 								self flag: #dicuss. "mt: How to distinguish a symbol from a selector?"
+ 								(m isSymbol and: [m first isLowercase])
+ 									ifTrue: ["might be sent"
+ 										m == sel ifFalse: [sent add: m]].
- 									(m isSymbol)
- 										ifTrue: ["might be sent"
- 											m == sel
- 												ifFalse: [sent add: m]].
  									]]]]].
  	"The following may be sent without being in any literal frame"
  	Smalltalk specialSelectorNames do: [:sel | sent add: sel].
  	Smalltalk presumedSentMessages	do: [:sel | sent add: sel].
  	^ sent.!



More information about the Packages mailing list