2 "Support functions to help with development"
4 "#as: implementations do: [| :each | inform: each definitionLocation ]."
6 "(#parseExpression findOn: {Syntax Parser}) definitionLocation"
10 x@(Root traits) allRoles
15 delegate roleReader >> [| :r | r selector -> r rolePositions] >> result]
16 ] writingAs: ExtensibleArray
19 d@(Debugger traits) printCurrentStack &limit: limit &stream: out &showLocation: showLocation
22 [baseFramePointer := (d interpreter framePointerOf: #printCurrentStack).
24 printBacktrace &limit: limit &stream: out &showLocation: showLocation ]
27 x@(Root traits) methodsUsingMe
32 delegate roleReader do:
33 [| :role selector findOnArray positions |
34 selector := role selector.
35 findOnArray := (Array newSize: selector arity).
36 positions := role rolePositions.
39 findOnArray at: position put:
40 ((positions bitAnd: 1 << position) isZero
41 ifTrue: [NoRole] ifFalse: [x]).
42 (role selector findOn: findOnArray) ifNotNilDo:
44 (method isSameAs: PrimitiveMethod) ifFalse:
45 [result nextPut: method method]]]]]
49 x@(Root traits) mostCommonlyCalledMethods
51 x methodsUsingMe sortBy: [| :x :y | x callCount >= y callCount]
54 x@(Root traits) printMostCommonlyCalledMethods
56 x mostCommonlyCalledMethods do:
57 [| :m | inform: '%@ count: %@ at: %r', m, m callCount, m definitionLocation].
60 m@(CompiledMethod traits) breakOnEntry
62 regCount := m registerCount.
63 m registerCount := regCount + 2.
64 m method code := {VM SSACode loadEnvironment. regCount.
65 VM SSACode directSendMessage. regCount + 1. #break. 1. regCount} ; m method code.
68 m@(CompiledMethod traits) clearBreaks
71 obj@(Root traits) completeSelectorFrom: s@(String traits)
74 select: [| :item | (item value bitAnd: 1) = 1 /\ [item key beginsWith: s]]
78 m@(Method traits) reload
80 m sourceTree ifNotNilDo:
81 [| :src | (src source resource as: Module) load]