18683
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
9993
|
3 |
"
|
10059
|
4 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
|
|
5 |
All Rights Reserved
|
9993
|
6 |
|
10059
|
7 |
Permission is hereby granted, free of charge, to any person
|
|
8 |
obtaining a copy of this software and associated documentation
|
|
9 |
files (the 'Software'), to deal in the Software without
|
|
10 |
restriction, including without limitation the rights to use,
|
|
11 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12 |
copies of the Software, and to permit persons to whom the
|
|
13 |
Software is furnished to do so, subject to the following
|
|
14 |
conditions:
|
|
15 |
|
|
16 |
The above copyright notice and this permission notice shall be
|
|
17 |
included in all copies or substantial portions of the Software.
|
|
18 |
|
|
19 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
20 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
21 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
23 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
24 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
25 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
26 |
OTHER DEALINGS IN THE SOFTWARE.
|
9993
|
27 |
"
|
|
28 |
"{ Package: 'stx:libtool' }"
|
|
29 |
|
|
30 |
"{ NameSpace: Tools }"
|
|
31 |
|
|
32 |
HierarchicalItem subclass:#ProfilerInfoItem
|
|
33 |
instanceVariableNames:'method isBlock tally'
|
|
34 |
classVariableNames:''
|
|
35 |
poolDictionaries:''
|
|
36 |
category:'Interface-Browsers-New-Profiler'
|
|
37 |
!
|
|
38 |
|
|
39 |
!ProfilerInfoItem class methodsFor:'documentation'!
|
|
40 |
|
|
41 |
copyright
|
|
42 |
"
|
10059
|
43 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
|
|
44 |
All Rights Reserved
|
|
45 |
|
|
46 |
Permission is hereby granted, free of charge, to any person
|
|
47 |
obtaining a copy of this software and associated documentation
|
|
48 |
files (the 'Software'), to deal in the Software without
|
|
49 |
restriction, including without limitation the rights to use,
|
|
50 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
51 |
copies of the Software, and to permit persons to whom the
|
|
52 |
Software is furnished to do so, subject to the following
|
|
53 |
conditions:
|
9993
|
54 |
|
10059
|
55 |
The above copyright notice and this permission notice shall be
|
|
56 |
included in all copies or substantial portions of the Software.
|
|
57 |
|
|
58 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
59 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
60 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
61 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
62 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
63 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
64 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
65 |
OTHER DEALINGS IN THE SOFTWARE.
|
9993
|
66 |
"
|
|
67 |
! !
|
|
68 |
|
|
69 |
!ProfilerInfoItem methodsFor:'accessing'!
|
|
70 |
|
|
71 |
isBlock
|
|
72 |
^ isBlock ? false
|
|
73 |
|
|
74 |
"Created: / 01-12-2007 / 20:38:11 / janfrog"
|
|
75 |
"Modified: / 01-12-2007 / 23:54:48 / janfrog"
|
|
76 |
!
|
|
77 |
|
|
78 |
isBlock:aBoolean
|
|
79 |
isBlock := aBoolean.
|
|
80 |
|
|
81 |
"Created: / 01-12-2007 / 20:38:11 / janfrog"
|
|
82 |
!
|
|
83 |
|
|
84 |
label
|
|
85 |
^self tallyLabel, ' in ',
|
|
86 |
self methodLabel, ' ',
|
|
87 |
self packageLabel
|
|
88 |
|
|
89 |
"Created: / 01-12-2007 / 20:46:01 / janfrog"
|
|
90 |
!
|
|
91 |
|
|
92 |
method
|
|
93 |
^ method
|
|
94 |
|
|
95 |
"Created: / 01-12-2007 / 20:38:11 / janfrog"
|
|
96 |
!
|
|
97 |
|
|
98 |
method:aCompiledMethod
|
|
99 |
method := aCompiledMethod.
|
|
100 |
|
|
101 |
"Created: / 01-12-2007 / 20:38:11 / janfrog"
|
|
102 |
!
|
|
103 |
|
|
104 |
methodClass
|
|
105 |
|
|
106 |
| mthd |
|
|
107 |
mthd := self method.
|
10427
|
108 |
^mthd notNil
|
|
109 |
ifTrue:[method mclass]
|
|
110 |
ifFalse:[UndefinedObject]
|
9993
|
111 |
|
|
112 |
"Created: / 01-12-2007 / 20:49:57 / janfrog"
|
|
113 |
"Modified: / 28-08-2010 / 21:02:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10427
|
114 |
"Modified: / 02-08-2011 / 09:35:53 / cg"
|
9993
|
115 |
!
|
|
116 |
|
|
117 |
methodLabel
|
|
118 |
|
|
119 |
^(self isBlock ifTrue:['[] in '] ifFalse:['']),
|
10833
|
120 |
(self selector ? '???') ,
|
18683
|
121 |
(' [' , (self methodClass isNil
|
|
122 |
ifTrue:['???']
|
|
123 |
ifFalse:[self methodClass nameWithoutPrefix]) , ']') allBold
|
9993
|
124 |
|
|
125 |
"Created: / 01-12-2007 / 20:56:29 / janfrog"
|
|
126 |
"Modified: / 01-12-2007 / 23:58:35 / janfrog"
|
10833
|
127 |
"Modified: / 18-10-2011 / 17:04:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
18683
|
128 |
"Modified: / 13-03-2019 / 22:15:04 / Claus Gittinger"
|
9993
|
129 |
!
|
|
130 |
|
|
131 |
packageLabel
|
12025
|
132 |
|pkg|
|
9993
|
133 |
|
12025
|
134 |
pkg := method isNil ifTrue:['???'] ifFalse:[method package].
|
18683
|
135 |
^('[' , pkg , ']') allItalic
|
9993
|
136 |
|
|
137 |
"Created: / 01-12-2007 / 20:58:18 / janfrog"
|
18683
|
138 |
"Modified: / 13-03-2019 / 22:15:08 / Claus Gittinger"
|
9993
|
139 |
!
|
|
140 |
|
|
141 |
selector
|
|
142 |
|
|
143 |
| mthd |
|
|
144 |
mthd := self method.
|
10427
|
145 |
^mthd notNil
|
|
146 |
ifTrue:[method selector]
|
|
147 |
ifFalse:['<no method>']
|
9993
|
148 |
|
|
149 |
"Created: / 01-12-2007 / 20:49:13 / janfrog"
|
|
150 |
"Modified: / 28-08-2010 / 21:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10427
|
151 |
"Modified (format): / 02-08-2011 / 09:35:32 / cg"
|
9993
|
152 |
!
|
|
153 |
|
|
154 |
tally
|
|
155 |
^ tally ? 0
|
|
156 |
|
|
157 |
"Created: / 01-12-2007 / 20:38:11 / janfrog"
|
|
158 |
"Modified: / 01-12-2007 / 23:43:58 / janfrog"
|
|
159 |
!
|
|
160 |
|
|
161 |
tally:anInteger
|
|
162 |
tally := anInteger.
|
|
163 |
|
|
164 |
"Created: / 01-12-2007 / 20:38:11 / janfrog"
|
|
165 |
!
|
|
166 |
|
|
167 |
tallyAdd: anInteger
|
|
168 |
|
|
169 |
tally := self tally + anInteger
|
|
170 |
|
|
171 |
"Created: / 01-12-2007 / 22:53:55 / janfrog"
|
|
172 |
!
|
|
173 |
|
|
174 |
tallyLabel
|
|
175 |
|
|
176 |
^self tally printString , '% '
|
|
177 |
|
|
178 |
"Created: / 01-12-2007 / 20:47:09 / janfrog"
|
|
179 |
! !
|
|
180 |
|
17808
|
181 |
!ProfilerInfoItem methodsFor:'accessing-private'!
|
9993
|
182 |
|
|
183 |
setChildren: collection
|
|
184 |
|
|
185 |
children := collection.
|
|
186 |
children do:[:e|e parent:e]
|
|
187 |
|
|
188 |
"Created: / 01-12-2007 / 20:43:36 / janfrog"
|
|
189 |
! !
|
|
190 |
|
|
191 |
!ProfilerInfoItem methodsFor:'comparing'!
|
|
192 |
|
|
193 |
= anotherMethodInfo
|
|
194 |
|
|
195 |
^self class == anotherMethodInfo class
|
|
196 |
and:[self method = anotherMethodInfo method
|
|
197 |
and:[self isBlock = anotherMethodInfo isBlock]]
|
|
198 |
|
|
199 |
"Created: / 01-12-2007 / 21:20:33 / janfrog"
|
|
200 |
!
|
|
201 |
|
|
202 |
hash
|
|
203 |
|
|
204 |
^self method hash bitXor: [self isBlock hash]
|
|
205 |
|
|
206 |
"Created: / 01-12-2007 / 21:17:01 / janfrog"
|
|
207 |
! !
|
|
208 |
|
|
209 |
!ProfilerInfoItem class methodsFor:'documentation'!
|
|
210 |
|
|
211 |
version_CVS
|
17808
|
212 |
^ '$Header$'
|
9993
|
213 |
!
|
|
214 |
|
|
215 |
version_SVN
|
17808
|
216 |
^ '$Id$'
|
9993
|
217 |
! !
|
17808
|
218 |
|