The Trunk: System-eem.1005.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.1005.mcz

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

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

Name: System-eem.1005
Author: eem
Time: 14 March 2018, 1:23:08.798781 pm
UUID: 57fc42cd-8d6b-477b-a7c7-1b79908da696
Ancestors: System-eem.1004

Provide SystemNavigation>>[browse]AllCallsOn:fromMethodReferences:labelled: and use it to fix a regression in allCallsOn:localToPackage:, which neglected to look at package extensions.

Update allCallsOn:fromBehaviors:sorted: to use the new multiple bytecode set aware scanning machinery.

=============== Diff against System-eem.1004 ===============

Item was removed:
- ----- Method: SmalltalkImage>>hasSpecialSelector:ifTrueSetByte: (in category 'special objects') -----
- hasSpecialSelector: aLiteral ifTrueSetByte: aBlock
-
- 1 to: self specialSelectorSize do:
- [:index |
- (self specialSelectorAt: index) == aLiteral
- ifTrue: [aBlock value: index + 16rAF. ^true]].
- ^false!

Item was changed:
  ----- Method: SystemNavigation>>allCallsOn:fromBehaviors:sorted: (in category 'query') -----
  allCallsOn: aLiteral fromBehaviors: behaviors sorted: sorted
+ "Answer a collection of all the methods implemented by behaviors that call on aLiteral even deeply embedded in literal arrays."
- "Answer a collection of all the methods implemented by behaviors that call on aLiteral even deeply embedded in literal array."
 
+ | result |
- | result special thorough byte |
  result := OrderedCollection new.
+ CompiledCode
+ scanBlocksForLiteral: aLiteral
+ do: [:primaryScanner :secondaryScanner | | thorough |
+ "Possibly search for literals embedded in literal arrays or pragmas, etc."
+ thorough := self class thoroughSenders.
+ behaviors do:
+ [ :behavior |
+ behavior selectorsAndMethodsDo:
+ [ :selector :method |
+ (method
+ refersTo: aLiteral
+ primaryBytecodeScanner: primaryScanner
+ secondaryBytecodeScanner: secondaryScanner
+ thorough: thorough) ifTrue:
+ [result addLast: (MethodReference class: behavior selector: selector)]]]].
+ sorted ifTrue:
+ [result sort].
- special := Smalltalk hasSpecialSelector: aLiteral ifTrueSetByte: [ :b | byte := b ].
- "Possibly search for symbols imbedded in literal arrays"
- thorough := aLiteral isSymbol and: [ self class thoroughSenders ].
- behaviors do: [ :behavior |
- | list |
- list := behavior whichSelectorsReferTo: aLiteral special: special byte: byte thorough: thorough.
- list do: [ :selector |
- result add: (MethodReference class: behavior selector: selector) ] ].
- sorted ifTrue: [ result sort ].
  ^result!

Item was added:
+ ----- Method: SystemNavigation>>allCallsOn:fromMethodReferences:sorted: (in category 'query') -----
+ allCallsOn: aLiteral fromMethodReferences: methodReferences sorted: sorted
+ "Answer a collection of all the methods implemented by behaviors that call on aLiteral even deeply embedded in literal arrays."
+
+ | result |
+ result := CompiledCode
+ scanBlocksForLiteral: aLiteral
+ do: [:primaryScanner :secondaryScanner | | thorough |
+ "Possibly search for literals embedded in literal arrays or pragmas, etc."
+ thorough := self class thoroughSenders.
+ methodReferences select:
+ [ :reference |
+ reference compiledMethod
+ refersTo: aLiteral
+ primaryBytecodeScanner: primaryScanner
+ secondaryBytecodeScanner: secondaryScanner
+ thorough: thorough]].
+ sorted ifTrue:
+ [result sort].
+ ^result!

Item was changed:
  ----- Method: SystemNavigation>>allCallsOn:localToPackage: (in category 'query') -----
  allCallsOn: aLiteral localToPackage: packageNameOrInfo
  "Answer a sorted collection of MethodReferences for all the methods that call on aLiteral in the given package."
 
+ | result |
+ result := self
+ allCallsOn: aLiteral
+ fromBehaviors: (self packageInfoFor: packageNameOrInfo) classesAndMetaClasses
+ sorted: false.
+ result := result, (self
+ allCallsOn: aLiteral
+ fromMethodReferences: (self packageInfoFor: packageNameOrInfo) extensionMethods
+ sorted: false).
+ ^result sort!
- ^self
- allCallsOn: aLiteral
- fromBehaviors: (self packageInfoFor: packageNameOrInfo) classesAndMetaClasses
- sorted: true!

Item was added:
+ ----- Method: SystemNavigation>>browseAllCallsOn:fromMethodReferences:labelled: (in category 'browse') -----
+ browseAllCallsOn: aLiteral fromMethodReferences: methodReferences labelled: sourceLabel
+ "Create and schedule a Message Set browser for all the methods that call on aLiteral within methodReferences."
+
+ ^self
+ headingAndAutoselectForLiteral: aLiteral
+ do: [ :label :autoSelect |
+ self
+ browseMessageList: [self allCallsOn: aLiteral
+ fromMethodReferences: methodReferences
+ sorted: true]
+ name: label, ' from ', sourceLabel
+ autoSelect: autoSelect]!