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