author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 29 Jan 2012 15:33:37 +0000 | |
branch | jv |
changeset 12125 | 0c49a3b13e43 |
parent 12123 | 4bde08cebd48 |
child 12128 | a7ff7d66ee85 |
permissions | -rw-r--r-- |
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:['']), |
|
12125 | 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" |
|
12125 | 123 |
"Modified: / 18-10-2011 / 17:04:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9993 | 124 |
! |
125 |
||
126 |
packageLabel |
|
127 |
||
128 |
^('[' , self method package , ']') asText allItalic |
|
129 |
||
130 |
"Created: / 01-12-2007 / 20:58:18 / janfrog" |
|
131 |
! |
|
132 |
||
133 |
selector |
|
134 |
||
135 |
| mthd | |
|
136 |
mthd := self method. |
|
10427 | 137 |
^mthd notNil |
138 |
ifTrue:[method selector] |
|
139 |
ifFalse:['<no method>'] |
|
9993 | 140 |
|
141 |
"Created: / 01-12-2007 / 20:49:13 / janfrog" |
|
142 |
"Modified: / 28-08-2010 / 21:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10427 | 143 |
"Modified (format): / 02-08-2011 / 09:35:32 / cg" |
9993 | 144 |
! |
145 |
||
146 |
tally |
|
147 |
^ tally ? 0 |
|
148 |
||
149 |
"Created: / 01-12-2007 / 20:38:11 / janfrog" |
|
150 |
"Modified: / 01-12-2007 / 23:43:58 / janfrog" |
|
151 |
! |
|
152 |
||
153 |
tally:anInteger |
|
154 |
tally := anInteger. |
|
155 |
||
156 |
"Created: / 01-12-2007 / 20:38:11 / janfrog" |
|
157 |
! |
|
158 |
||
159 |
tallyAdd: anInteger |
|
160 |
||
161 |
tally := self tally + anInteger |
|
162 |
||
163 |
"Created: / 01-12-2007 / 22:53:55 / janfrog" |
|
164 |
! |
|
165 |
||
166 |
tallyLabel |
|
167 |
||
168 |
^self tally printString , '% ' |
|
169 |
||
170 |
"Created: / 01-12-2007 / 20:47:09 / janfrog" |
|
171 |
! ! |
|
172 |
||
173 |
!ProfilerInfoItem methodsFor:'accessing - private'! |
|
174 |
||
175 |
setChildren: collection |
|
176 |
||
177 |
children := collection. |
|
178 |
children do:[:e|e parent:e] |
|
179 |
||
180 |
"Created: / 01-12-2007 / 20:43:36 / janfrog" |
|
181 |
! ! |
|
182 |
||
183 |
!ProfilerInfoItem methodsFor:'comparing'! |
|
184 |
||
185 |
= anotherMethodInfo |
|
186 |
||
187 |
^self class == anotherMethodInfo class |
|
188 |
and:[self method = anotherMethodInfo method |
|
189 |
and:[self isBlock = anotherMethodInfo isBlock]] |
|
190 |
||
191 |
"Created: / 01-12-2007 / 21:20:33 / janfrog" |
|
192 |
! |
|
193 |
||
194 |
hash |
|
195 |
||
196 |
^self method hash bitXor: [self isBlock hash] |
|
197 |
||
198 |
"Created: / 01-12-2007 / 21:17:01 / janfrog" |
|
199 |
! ! |
|
200 |
||
201 |
!ProfilerInfoItem class methodsFor:'documentation'! |
|
202 |
||
203 |
version_CVS |
|
12125 | 204 |
^ '§Header: /cvs/stx/stx/libtool/Tools__ProfilerInfoItem.st,v 1.4 2011/10/18 15:29:55 vrany Exp §' |
9993 | 205 |
! |
206 |
||
207 |
version_SVN |
|
12123
4bde08cebd48
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10833
diff
changeset
|
208 |
^ '$Id: Tools__ProfilerInfoItem.st 7486 2009-10-26 22:06:24Z vranyj1 $' |
12125 | 209 |
! ! |