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