The Trunk: System-eem.1194.mcz

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

The Trunk: System-eem.1194.mcz

commits-2
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1194.mcz

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

Name: System-eem.1194
Author: eem
Time: 2 December 2020, 9:58:22.669121 pm
UUID: e3212f4a-d84c-4e35-b05e-ab5e16af91c0
Ancestors: System-tonyg.1193

When computing SystemNavigation>>allSentMessagesWithout: use anyAndAllSelectorsDo: which does a much better job than the existing code, and uses (indirectly) Scanner>>isMessageSelector: which provides a single point of definition to maintain cnsistency across tools, etc.

=============== Diff against System-tonyg.1193 ===============

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) ifTrue: [{}] ifFalse: [{cls. cls classSide}]) do:
+ [:each |
+ (absentSelectors isEmpty
- Cursor execute showWhile: [
- self environment allClassesAndTraitsDo: [:cls |
- ((absentClasses includes: cls)
- 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) anyAndAllSelectorsDo:
+ [:m|
+ m == sel ifFalse:
+ [sent add: m]]]]]].
- 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 size > 0 and: [m first isLowercase]])
- 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!
- Smalltalk presumedSentMessages do: [:sel | sent add: sel].
- ^ sent.!