author | Claus Gittinger <cg@exept.de> |
Fri, 26 Oct 2012 11:48:52 +0200 | |
changeset 2958 | 4bb6acd04cfe |
parent 2951 | 340d0405f582 |
child 2960 | 8adc66fe55fb |
permissions | -rw-r--r-- |
2357 | 1 |
"{ Package: 'stx:libcomp' }" |
2 |
||
3 |
ByteCodeCompiler subclass:#InstrumentingCompiler |
|
2949 | 4 |
instanceVariableNames:'method methodEntryInfo blockInvocationInfo' |
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'System-Compiler-Instrumentation' |
|
2357 | 8 |
! |
9 |
||
2634 | 10 |
InstrumentationInfo subclass:#StatementExecutionInfo |
2949 | 11 |
instanceVariableNames:'startPosition count' |
12 |
classVariableNames:'' |
|
13 |
poolDictionaries:'' |
|
14 |
privateIn:InstrumentingCompiler |
|
2359 | 15 |
! |
16 |
||
2635 | 17 |
InstrumentationInfo subclass:#MethodInvocationInfo |
2949 | 18 |
instanceVariableNames:'infoPerReceiverClass' |
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
21 |
privateIn:InstrumentingCompiler |
|
2357 | 22 |
! |
23 |
||
24 |
Object subclass:#MethodInvocationInfoPerReceiverClass |
|
2949 | 25 |
instanceVariableNames:'infoPerSendingMethod' |
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:InstrumentingCompiler::MethodInvocationInfo |
|
2357 | 29 |
! |
30 |
||
31 |
Object subclass:#MethodInvocationInfoPerSendingMethod |
|
2949 | 32 |
instanceVariableNames:'countPerSendersClass invokedViaPerform' |
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:InstrumentingCompiler::MethodInvocationInfo::MethodInvocationInfoPerReceiverClass |
|
2948 | 36 |
! |
37 |
||
38 |
InstrumentingCompiler::MethodInvocationInfo subclass:#MethodInvocationInfoForCoverageInAlreadyEnteredState |
|
2949 | 39 |
instanceVariableNames:'' |
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:InstrumentingCompiler |
|
2357 | 43 |
! |
44 |
||
2711 | 45 |
InstrumentingCompiler::MethodInvocationInfo subclass:#MethodInvocationInfoInAlreadyEnteredState |
2949 | 46 |
instanceVariableNames:'' |
47 |
classVariableNames:'' |
|
48 |
poolDictionaries:'' |
|
49 |
privateIn:InstrumentingCompiler |
|
2711 | 50 |
! |
51 |
||
2715 | 52 |
InstrumentingCompiler::StatementExecutionInfo subclass:#VariableAccessExecutionInfo |
2949 | 53 |
instanceVariableNames:'' |
54 |
classVariableNames:'' |
|
55 |
poolDictionaries:'' |
|
56 |
privateIn:InstrumentingCompiler |
|
2715 | 57 |
! |
58 |
||
2390 | 59 |
InstrumentingCompiler::StatementExecutionInfo subclass:#BlockExecutionInfo |
2949 | 60 |
instanceVariableNames:'endPosition' |
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:InstrumentingCompiler |
|
2390 | 64 |
! |
65 |
||
2715 | 66 |
InstrumentingCompiler::VariableAccessExecutionInfo subclass:#ReadAccessExecutionInfo |
2949 | 67 |
instanceVariableNames:'' |
68 |
classVariableNames:'' |
|
69 |
poolDictionaries:'' |
|
70 |
privateIn:InstrumentingCompiler |
|
2715 | 71 |
! |
72 |
||
73 |
InstrumentingCompiler::VariableAccessExecutionInfo subclass:#WriteAccessExecutionInfo |
|
2949 | 74 |
instanceVariableNames:'' |
75 |
classVariableNames:'' |
|
76 |
poolDictionaries:'' |
|
77 |
privateIn:InstrumentingCompiler |
|
2715 | 78 |
! |
79 |
||
2357 | 80 |
!InstrumentingCompiler class methodsFor:'documentation'! |
81 |
||
82 |
documentation |
|
83 |
" |
|
2632 | 84 |
an experiment - recompile classes using this compiler adds instrumentation code. |
85 |
This remembers who calls a method from where (methodInvocationInfo) what the receiver's types are |
|
86 |
(inherited classes) and how often basic blocks (blockExecutionInfo) and statements |
|
87 |
(statementExecutionInfo) are invoked . |
|
88 |
||
89 |
The who-calls and receiver type info may produce some overhead, which can be avoided by |
|
90 |
using the somewhat more naive InstrumentingForSimpleCoverageCompiler (that is what people are |
|
91 |
used to from the C/Java world, anyway). |
|
92 |
||
93 |
From the first bulk, we can compute the inheritanceCoverage info (which methods have been called for which |
|
94 |
subclass) in addition to the known line and block coverages. |
|
2357 | 95 |
" |
96 |
! ! |
|
97 |
||
98 |
!InstrumentingCompiler class methodsFor:'compilation-public'! |
|
99 |
||
100 |
compileClass:aClass |
|
101 |
"compile all methods of aClass with instrumentation" |
|
102 |
||
2958 | 103 |
aClass instAndClassMethodsDo:[:eachMethod | |
2357 | 104 |
self compileMethod:eachMethod |
105 |
]. |
|
106 |
! |
|
107 |
||
108 |
compileMethod:aMethod |
|
109 |
"compile a single method with instrumentation" |
|
110 |
||
111 |
self |
|
112 |
compile:(aMethod source) |
|
113 |
forClass:(aMethod mclass) |
|
114 |
inCategory:(aMethod category) |
|
2958 | 115 |
! |
116 |
||
117 |
compilePackage:aPackageID |
|
118 |
"compile all classes of a package instrumentation" |
|
119 |
||
120 |
Smalltalk allClassesInPackage:aPackageID do:[:eachClass | |
|
121 |
self compileClass:eachClass |
|
122 |
]. |
|
123 |
||
124 |
" |
|
125 |
InstrumentingCompiler compilePackage:'exept:workflow'. |
|
126 |
InstrumentingCompiler compilePackage:'exept:expecco'. |
|
127 |
" |
|
2357 | 128 |
! ! |
129 |
||
130 |
!InstrumentingCompiler class methodsFor:'special'! |
|
131 |
||
132 |
allInstrumentedMethods |
|
133 |
^ InstrumentedMethod allInstances |
|
134 |
||
135 |
" |
|
136 |
self allInstrumentedMethods |
|
137 |
" |
|
138 |
||
139 |
"Modified: / 27-04-2010 / 13:37:51 / cg" |
|
140 |
! |
|
141 |
||
142 |
callersOf:aMethod do:aBlock |
|
2632 | 143 |
"enumerate all callers of aMethod into a block" |
144 |
||
2357 | 145 |
|info| |
146 |
||
147 |
info := aMethod methodInvocationInfo. |
|
148 |
info notNil ifTrue:[ |
|
149 |
info callingMethodsDo:[:callingMethod | |
|
150 |
aBlock value:callingMethod |
|
151 |
] |
|
152 |
] |
|
153 |
||
154 |
"Modified: / 27-04-2010 / 13:35:00 / cg" |
|
2632 | 155 |
"Modified (comment): / 07-08-2011 / 15:08:33 / cg" |
2357 | 156 |
! |
157 |
||
158 |
isInstrumented:aMethod |
|
159 |
^ aMethod isInstrumented |
|
160 |
||
161 |
" |
|
162 |
self methodInfoOf:aMethod |
|
163 |
" |
|
164 |
||
165 |
"Modified: / 27-04-2010 / 13:35:21 / cg" |
|
166 |
! |
|
167 |
||
168 |
methodInfoOf:aMethod |
|
169 |
<resource: #obsolete> |
|
170 |
||
171 |
self obsoleteMethodWarning:'please use Method >> methodInvocationInfo'. |
|
172 |
^ aMethod methodInvocationInfo |
|
173 |
||
174 |
" |
|
175 |
self methodInfoOf:aMethod |
|
176 |
" |
|
177 |
||
178 |
"Modified: / 27-04-2010 / 13:37:31 / cg" |
|
179 |
! |
|
180 |
||
181 |
methodInvocationInfoOf:aMethod |
|
182 |
self obsoleteMethodWarning:'please use method>>methodInvocationInfo'. |
|
183 |
^ aMethod methodInvocationInfo |
|
184 |
||
185 |
" |
|
186 |
self methodInfoOf:aMethod |
|
187 |
" |
|
188 |
||
189 |
"Created: / 27-04-2010 / 12:28:56 / cg" |
|
190 |
"Modified: / 27-04-2010 / 13:34:36 / cg" |
|
191 |
! ! |
|
192 |
||
193 |
!InstrumentingCompiler methodsFor:'code generation helpers'! |
|
194 |
||
195 |
addBlockCounterTo:aBlockNode |
|
2951 | 196 |
"called by the compiler to instrument a block node" |
197 |
||
2357 | 198 |
|countCode blockEntryInfo| |
199 |
||
200 |
blockInvocationInfo isNil ifTrue:[ |
|
201 |
blockInvocationInfo := OrderedCollection new. |
|
202 |
]. |
|
2632 | 203 |
blockEntryInfo := self blockExecutionInfoInstance. |
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
204 |
blockEntryInfo startPosition:aBlockNode startPosition endPosition:aBlockNode endPosition. |
2675
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
205 |
"/ Transcript show:aBlockNode startPosition; |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
206 |
"/ show:' -> '; |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
207 |
"/ showCR: aBlockNode endPosition. |
2357 | 208 |
blockInvocationInfo add:blockEntryInfo. |
209 |
||
210 |
countCode := |
|
211 |
StatementNode |
|
212 |
expression:(MessageNode |
|
213 |
receiver:(ConstantNode value:blockEntryInfo) |
|
214 |
selector:#entry: |
|
215 |
arg:(VariableNode type:#ThisContext context:contextToEvaluateIn)). |
|
216 |
||
217 |
aBlockNode isEmptyBlock ifTrue:[ |
|
218 |
"/ q: are we interested in empty blocks ? |
|
2665
2071b01a050f
changed: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2635
diff
changeset
|
219 |
countCode nextStatement:(StatementNode expression:(ConstantNode value:nil)). |
2357 | 220 |
aBlockNode statements:countCode. |
221 |
] ifFalse:[ |
|
222 |
countCode nextStatement:aBlockNode statements. |
|
223 |
aBlockNode statements:countCode. |
|
224 |
]. |
|
225 |
||
2675
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
226 |
"Modified: / 21-08-2011 / 16:02:52 / cg" |
2357 | 227 |
! |
228 |
||
229 |
addBlockCountersToEachBlockIn:aCollection |
|
2951 | 230 |
"called by the compiler to instrument a collection of block nodes" |
231 |
||
2357 | 232 |
aCollection do:[:eachNode | |
233 |
eachNode isBlockNode ifTrue:[ |
|
234 |
self addBlockCounterTo:eachNode |
|
235 |
] |
|
236 |
]. |
|
237 |
||
238 |
"Created: / 27-04-2010 / 11:47:56 / cg" |
|
239 |
! |
|
240 |
||
241 |
createMethod |
|
2951 | 242 |
"called by the compiler to instatiate a new method instance" |
243 |
||
2357 | 244 |
method := super createMethod. |
245 |
||
246 |
methodEntryInfo notNil ifTrue:[ |
|
247 |
methodEntryInfo owningMethod:method |
|
248 |
]. |
|
249 |
blockInvocationInfo notNil ifTrue:[ |
|
250 |
blockInvocationInfo do:[:eachInfo | eachInfo owningMethod:method] |
|
251 |
]. |
|
252 |
||
253 |
^ method |
|
254 |
||
255 |
"Modified: / 27-04-2010 / 14:04:50 / cg" |
|
256 |
! |
|
257 |
||
258 |
methodClass |
|
2951 | 259 |
"called by the compiler to ask for the method instance's class" |
260 |
||
2357 | 261 |
^ InstrumentedMethod |
262 |
||
263 |
"Created: / 27-04-2010 / 12:17:22 / cg" |
|
2390 | 264 |
! |
265 |
||
266 |
statementCounterBefore:aStatementNode |
|
2951 | 267 |
"called by the compiler to instrument a statement node (head of a basic block)" |
268 |
||
2390 | 269 |
|countCode statementEntryInfo| |
270 |
||
271 |
blockInvocationInfo isNil ifTrue:[ |
|
272 |
blockInvocationInfo := OrderedCollection new. |
|
273 |
]. |
|
2632 | 274 |
statementEntryInfo := self statementExecutionInfoInstance. |
2390 | 275 |
statementEntryInfo startPosition:aStatementNode startPosition. |
276 |
blockInvocationInfo add:statementEntryInfo. |
|
277 |
||
278 |
countCode := |
|
279 |
StatementNode |
|
280 |
expression:(MessageNode |
|
281 |
receiver:(ConstantNode value:statementEntryInfo) |
|
282 |
selector:#entry: |
|
283 |
arg:(VariableNode type:#ThisContext context:contextToEvaluateIn)). |
|
284 |
||
285 |
countCode nextStatement:aStatementNode. |
|
286 |
^ countCode |
|
2571 | 287 |
|
2632 | 288 |
"Modified: / 07-08-2011 / 15:32:45 / cg" |
2357 | 289 |
! ! |
290 |
||
2715 | 291 |
!InstrumentingCompiler methodsFor:'code generation hooks'! |
292 |
||
293 |
assignmentRewriteHookFor:anAssignmentNode |
|
294 |
"invoked whenever an assignment node has been generated" |
|
295 |
||
296 |
^ anAssignmentNode |
|
297 |
||
298 |
"Created: / 30-09-2011 / 12:28:09 / cg" |
|
299 |
! |
|
2357 | 300 |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
301 |
blockNodeRewriteHookFor:aBlockNode |
2715 | 302 |
"invoked whenever a block node has been generated" |
303 |
||
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
304 |
"/ add a counter for the block |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
305 |
self addBlockCounterTo:aBlockNode. |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
306 |
^ aBlockNode |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
307 |
|
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
308 |
"Created: / 28-04-2010 / 14:21:27 / cg" |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
309 |
! |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
310 |
|
2357 | 311 |
messageNodeRewriteHookFor:aMessageNode |
2715 | 312 |
"invoked whenever a message send node has been generated" |
313 |
||
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
314 |
"/ see blockNodeRewriter... |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
315 |
|
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
316 |
"/ "/ argument could be a constantNode (due to contant-folding optimization) |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
317 |
"/ aMessageNode isConstant ifTrue:[^ aMessageNode]. |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
318 |
"/ ( |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
319 |
"/ #( |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
320 |
"/ ifTrue: |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
321 |
"/ ifFalse: |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
322 |
"/ ifTrue:ifFalse: |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
323 |
"/ ifFalse:ifTrue: |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
324 |
"/ ) |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
325 |
"/ includes:aMessageNode selector |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
326 |
"/ ) ifTrue:[ |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
327 |
"/ "/ add a counter for the block |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
328 |
"/ self addBlockCountersToEachBlockIn:(aMessageNode arguments) |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
329 |
"/ ]. |
2357 | 330 |
^ aMessageNode |
331 |
||
332 |
"Created: / 27-04-2010 / 11:43:22 / cg" |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
333 |
"Modified: / 28-04-2010 / 14:22:05 / cg" |
2715 | 334 |
"Modified (comment): / 30-09-2011 / 12:16:56 / cg" |
2357 | 335 |
! |
336 |
||
337 |
startCodeGenerationHookOn:codeStream |
|
2715 | 338 |
"invoked before code is generated" |
339 |
||
2632 | 340 |
methodEntryInfo := self methodInvocationInfoInstance. |
2357 | 341 |
|
342 |
(StatementNode |
|
343 |
expression:(MessageNode |
|
344 |
receiver:(ConstantNode value:methodEntryInfo) |
|
345 |
selector:#entry: |
|
346 |
arg:(VariableNode type:#ThisContext context:contextToEvaluateIn))) |
|
347 |
codeForSideEffectOn:codeStream inBlock:nil for:self. |
|
348 |
||
2632 | 349 |
"Modified: / 07-08-2011 / 15:34:09 / cg" |
2715 | 350 |
"Modified (comment): / 30-09-2011 / 12:16:05 / cg" |
2390 | 351 |
! |
352 |
||
353 |
statementListRewriteHookFor:firstStatement |
|
2715 | 354 |
"invoked whenever a statement list node has been generated" |
355 |
||
2390 | 356 |
"/ care for blocks which return... |
357 |
|thisStatement prevStatement countStatement mustInsertExecutionInfo| |
|
358 |
||
359 |
mustInsertExecutionInfo := false. |
|
360 |
prevStatement := nil. |
|
361 |
||
362 |
thisStatement := firstStatement. |
|
363 |
thisStatement isNil ifTrue:[^ firstStatement]. |
|
364 |
||
365 |
[true] whileTrue:[ |
|
366 |
mustInsertExecutionInfo ifTrue:[ |
|
367 |
"/ prev-stat had a return in it (a block with a return); |
|
368 |
"/ insert a statement-entry here. |
|
369 |
thisStatement notNil ifTrue:[ |
|
370 |
countStatement := self statementCounterBefore:thisStatement. |
|
371 |
prevStatement nextStatement:countStatement. |
|
372 |
mustInsertExecutionInfo := false. |
|
373 |
prevStatement := countStatement. |
|
374 |
] |
|
375 |
]. |
|
376 |
thisStatement isNil ifTrue:[^ firstStatement]. |
|
377 |
||
378 |
thisStatement isReturnNode ifFalse:[ |
|
379 |
thisStatement containsReturn ifTrue:[ |
|
380 |
mustInsertExecutionInfo := true |
|
381 |
] |
|
382 |
]. |
|
383 |
prevStatement := thisStatement. |
|
384 |
thisStatement := thisStatement nextStatement. |
|
385 |
]. |
|
2715 | 386 |
|
387 |
"Modified (comment): / 30-09-2011 / 12:15:52 / cg" |
|
388 |
! |
|
389 |
||
390 |
variableReadRewriteHookFor:aVariableNode |
|
391 |
"invoked whenever a variable access node has been generated" |
|
392 |
||
393 |
^ aVariableNode |
|
394 |
||
395 |
"Created: / 30-09-2011 / 12:27:47 / cg" |
|
2357 | 396 |
! ! |
397 |
||
2632 | 398 |
!InstrumentingCompiler methodsFor:'redefinable'! |
2357 | 399 |
|
2632 | 400 |
blockExecutionInfoInstance |
401 |
"one instance is generated for every block, |
|
402 |
and called at execution time with entry:" |
|
2357 | 403 |
|
2632 | 404 |
^ BlockExecutionInfo new cleanInfoWithChange:false. |
405 |
||
406 |
"Created: / 07-08-2011 / 15:13:42 / cg" |
|
2357 | 407 |
! |
408 |
||
2632 | 409 |
methodInvocationInfoInstance |
410 |
"one instance is generated for every method, |
|
411 |
and called at execution time with entry:" |
|
2357 | 412 |
|
2632 | 413 |
^ MethodInvocationInfo new. |
2357 | 414 |
|
2632 | 415 |
"Created: / 07-08-2011 / 15:33:57 / cg" |
416 |
! |
|
2357 | 417 |
|
2632 | 418 |
statementExecutionInfoInstance |
419 |
"one instance is generated for every statement, |
|
420 |
and called at execution time with entry:" |
|
2357 | 421 |
|
2632 | 422 |
^ StatementExecutionInfo new cleanInfoWithChange:false. |
2357 | 423 |
|
2632 | 424 |
"Created: / 07-08-2011 / 15:32:36 / cg" |
2357 | 425 |
! ! |
426 |
||
2715 | 427 |
!InstrumentingCompiler::StatementExecutionInfo class methodsFor:'documentation'! |
428 |
||
429 |
documentation |
|
430 |
" |
|
431 |
(sub)instances of me are updated by instrumented code when statements are executed. |
|
432 |
" |
|
433 |
! ! |
|
434 |
||
2390 | 435 |
!InstrumentingCompiler::StatementExecutionInfo methodsFor:'accessing'! |
2359 | 436 |
|
437 |
callCount |
|
438 |
^ count |
|
439 |
||
440 |
"Created: / 27-04-2010 / 13:45:15 / cg" |
|
441 |
! |
|
442 |
||
443 |
characterPosition |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
444 |
^ startPosition |
2359 | 445 |
|
446 |
"Created: / 23-06-2006 / 13:31:19 / cg" |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
447 |
"Modified: / 28-04-2010 / 15:54:24 / cg" |
2359 | 448 |
! |
449 |
||
450 |
characterPosition:something |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
451 |
startPosition := something. |
2359 | 452 |
|
453 |
"Created: / 23-06-2006 / 13:31:19 / cg" |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
454 |
"Modified: / 28-04-2010 / 15:54:30 / cg" |
2359 | 455 |
! |
456 |
||
457 |
count |
|
458 |
^ count |
|
459 |
||
460 |
"Created: / 23-06-2006 / 13:31:28 / cg" |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
461 |
! |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
462 |
|
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
463 |
startPosition |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
464 |
^ startPosition |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
465 |
|
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
466 |
"Created: / 28-04-2010 / 15:54:26 / cg" |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
467 |
! |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
468 |
|
2390 | 469 |
startPosition:something |
470 |
startPosition := something. |
|
2359 | 471 |
! ! |
472 |
||
2390 | 473 |
!InstrumentingCompiler::StatementExecutionInfo methodsFor:'cleanup'! |
2359 | 474 |
|
2571 | 475 |
cleanInfoWithChange:withChange |
2569 | 476 |
count := 0. |
2571 | 477 |
withChange ifTrue:[ |
478 |
Smalltalk changed:#methodCoverageInfo with:owningMethod. |
|
479 |
]. |
|
2569 | 480 |
|
2570 | 481 |
"Modified: / 20-07-2011 / 17:55:49 / cg" |
2571 | 482 |
"Created: / 20-07-2011 / 18:59:01 / cg" |
2359 | 483 |
! ! |
484 |
||
2390 | 485 |
!InstrumentingCompiler::StatementExecutionInfo methodsFor:'instrumentation calls'! |
2359 | 486 |
|
487 |
entry:callingContext |
|
2528
e57cc8caf6f9
dont instrument the instrumentation code
Claus Gittinger <cg@exept.de>
parents:
2391
diff
changeset
|
488 |
"invoked by instrumented code; |
2632 | 489 |
called whenever the block/statment is entered" |
490 |
||
491 |
|context| |
|
2359 | 492 |
|
2632 | 493 |
context := InstrumentationContext current. |
494 |
context isNil ifTrue:[^ self]. |
|
2711 | 495 |
context coverageOnly ifTrue:[ |
496 |
self hasBeenExecuted ifTrue:[^ self]. |
|
497 |
]. |
|
2632 | 498 |
context enabledAndNotInInstrumentedCode ifFalse:[^ self]. |
2528
e57cc8caf6f9
dont instrument the instrumentation code
Claus Gittinger <cg@exept.de>
parents:
2391
diff
changeset
|
499 |
|
2359 | 500 |
count := count + 1. |
501 |
count == 1 ifTrue:[ |
|
2632 | 502 |
"/ the very first time, send a change notification, so the browsers update |
503 |
||
2944 | 504 |
[ |
505 |
context inInstrumentedCode:true. |
|
506 |
Smalltalk changed:#methodCoverageInfo with:owningMethod. |
|
507 |
] ensure:[ |
|
508 |
context inInstrumentedCode:false. |
|
509 |
] |
|
2359 | 510 |
]. |
511 |
||
512 |
"Created: / 23-06-2006 / 13:31:16 / cg" |
|
2711 | 513 |
"Modified: / 23-08-2011 / 21:29:39 / cg" |
2359 | 514 |
! ! |
515 |
||
2390 | 516 |
!InstrumentingCompiler::StatementExecutionInfo methodsFor:'queries'! |
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
517 |
|
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
518 |
hasBeenExecuted |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
519 |
^ count > 0 |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
520 |
|
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
521 |
"Created: / 28-04-2010 / 14:39:46 / cg" |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
522 |
! ! |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
523 |
|
2632 | 524 |
!InstrumentingCompiler::StatementExecutionInfo methodsFor:'testing'! |
525 |
||
526 |
isStatementExecutionInfo |
|
527 |
^ true |
|
528 |
||
529 |
"Created: / 08-08-2011 / 14:40:51 / cg" |
|
530 |
! ! |
|
531 |
||
2357 | 532 |
!InstrumentingCompiler::MethodInvocationInfo methodsFor:'accessing'! |
533 |
||
534 |
callingMethodsDo:aBlock |
|
535 |
infoPerReceiverClass notNil ifTrue:[ |
|
2949 | 536 |
infoPerReceiverClass ~~ true ifTrue:[ |
537 |
infoPerReceiverClass do:[:each | |
|
538 |
each callingMethodsDo:aBlock |
|
539 |
] |
|
2357 | 540 |
] |
541 |
] |
|
542 |
! |
|
543 |
||
544 |
hasBeenCalled |
|
545 |
^ infoPerReceiverClass notEmptyOrNil |
|
546 |
||
547 |
"Created: / 27-04-2010 / 13:43:15 / cg" |
|
548 |
! |
|
549 |
||
2368 | 550 |
invokedViaPerform |
551 |
^ infoPerReceiverClass contains:[:someInfo | someInfo invokedViaPerform]. |
|
552 |
||
553 |
"Created: / 27-04-2010 / 18:21:56 / cg" |
|
554 |
! |
|
555 |
||
2357 | 556 |
invokingMethods |
557 |
|setOfMethods| |
|
558 |
||
559 |
setOfMethods := IdentitySet new. |
|
560 |
self invokingMethodsDo:[:m | setOfMethods add:m]. |
|
561 |
^ setOfMethods. |
|
562 |
! |
|
563 |
||
564 |
invokingMethodsDo:aBlock |
|
565 |
infoPerReceiverClass isNil ifTrue:[ ^ self]. |
|
566 |
^ infoPerReceiverClass do:[:eachInfo | eachInfo invokingMethodsDo:aBlock]. |
|
567 |
! |
|
568 |
||
569 |
numberOfInvocations |
|
570 |
infoPerReceiverClass isNil ifTrue:[ ^ 0]. |
|
2951 | 571 |
infoPerReceiverClass == true ifTrue:[ ^ 0]. |
2357 | 572 |
^ infoPerReceiverClass inject:0 into:[:sumSoFar :info | sumSoFar + info numberOfInvocations] |
573 |
! |
|
574 |
||
575 |
numberOfInvocationsFromExternalOf:aClass |
|
576 |
|sum| |
|
577 |
||
578 |
infoPerReceiverClass isNil ifTrue:[ ^ 0]. |
|
579 |
||
580 |
sum := 0. |
|
581 |
infoPerReceiverClass keysAndValuesDo:[:recClass :info | |
|
582 |
sum := sum + (info numberOfInvocationsFromExternalOf:aClass) |
|
583 |
]. |
|
584 |
^ sum |
|
585 |
! |
|
586 |
||
587 |
numberOfInvocationsFromInternalOf:aClass |
|
588 |
|sum| |
|
589 |
||
590 |
infoPerReceiverClass isNil ifTrue:[ ^ 0]. |
|
591 |
||
592 |
sum := 0. |
|
593 |
infoPerReceiverClass keysAndValuesDo:[:recClass :info | |
|
594 |
sum := sum + (info numberOfInvocationsFromInternalOf:aClass) |
|
595 |
]. |
|
596 |
^ sum |
|
597 |
! ! |
|
598 |
||
599 |
!InstrumentingCompiler::MethodInvocationInfo methodsFor:'cleanup'! |
|
600 |
||
2571 | 601 |
cleanInfoWithChange:withChange |
2357 | 602 |
infoPerReceiverClass := nil. |
2571 | 603 |
withChange ifTrue:[ |
604 |
Smalltalk changed:#methodCoverageInfo with:owningMethod. |
|
605 |
] |
|
2569 | 606 |
|
2570 | 607 |
"Modified: / 20-07-2011 / 17:55:35 / cg" |
2571 | 608 |
"Created: / 20-07-2011 / 18:59:22 / cg" |
2357 | 609 |
! ! |
610 |
||
611 |
!InstrumentingCompiler::MethodInvocationInfo methodsFor:'instrumentation probe calls'! |
|
612 |
||
613 |
entry:aContext |
|
614 |
"invoked by instrumented compiled code, upon method entry" |
|
615 |
||
2948 | 616 |
|context receiversClass infoPerReceiver firstEntry coverageOnly| |
2357 | 617 |
|
2632 | 618 |
context := InstrumentationContext current. |
619 |
context isNil ifTrue:[^ self]. |
|
620 |
context enabledAndNotInInstrumentedCode ifFalse:[^ self]. |
|
621 |
||
2944 | 622 |
[ |
623 |
context inInstrumentedCode:true. |
|
624 |
||
2875 | 625 |
firstEntry := false. |
626 |
||
2948 | 627 |
(coverageOnly := context coverageOnly) ifTrue:[ |
628 |
"/ only interested in entry, but not in a per-receiver statistics |
|
629 |
"/ that is the normal coverage usage |
|
630 |
infoPerReceiverClass isNil ifTrue:[ |
|
2949 | 631 |
infoPerReceiverClass := true. |
2948 | 632 |
firstEntry := true. |
633 |
]. |
|
634 |
] ifFalse:[ |
|
635 |
"/ interested in a per-receiver statistics (remembering with which receiver-class a method has been invoked). |
|
636 |
"/ that is used by the OOM package |
|
637 |
infoPerReceiverClass isNil ifTrue:[ |
|
638 |
infoPerReceiverClass := IdentityDictionary new. |
|
639 |
firstEntry := true. |
|
640 |
]. |
|
2944 | 641 |
receiversClass := aContext receiver class. |
642 |
infoPerReceiver := infoPerReceiverClass |
|
643 |
at:receiversClass |
|
644 |
ifAbsentPut:[MethodInvocationInfoPerReceiverClass new]. |
|
645 |
infoPerReceiver entry:aContext. |
|
646 |
]. |
|
2569 | 647 |
|
2944 | 648 |
"/ the very first time, send a change notification, so the browsers update |
649 |
firstEntry ifTrue:[ |
|
650 |
Smalltalk changed:#methodCoverageInfo with:owningMethod. |
|
651 |
]. |
|
2948 | 652 |
coverageOnly ifTrue:[ |
653 |
self changeClassTo:(InstrumentingCompiler::MethodInvocationInfoInAlreadyEnteredState). |
|
654 |
] ifFalse:[ |
|
655 |
self changeClassTo:(InstrumentingCompiler::MethodInvocationInfoForCoverageInAlreadyEnteredState). |
|
656 |
]. |
|
2944 | 657 |
] ensure:[ |
658 |
context inInstrumentedCode:false. |
|
2632 | 659 |
]. |
2528
e57cc8caf6f9
dont instrument the instrumentation code
Claus Gittinger <cg@exept.de>
parents:
2391
diff
changeset
|
660 |
|
2875 | 661 |
"Modified: / 05-06-2012 / 23:51:53 / cg" |
2632 | 662 |
! ! |
663 |
||
664 |
!InstrumentingCompiler::MethodInvocationInfo methodsFor:'testing'! |
|
665 |
||
666 |
isMethodInvocationInfo |
|
667 |
^ true |
|
668 |
||
669 |
"Created: / 08-08-2011 / 14:37:58 / cg" |
|
2357 | 670 |
! ! |
671 |
||
672 |
!InstrumentingCompiler::MethodInvocationInfo::MethodInvocationInfoPerReceiverClass methodsFor:'accessing'! |
|
673 |
||
674 |
callingMethodsDo:aBlock |
|
675 |
infoPerSendingMethod keysAndValuesDo:[:m :eachInfo | |
|
676 |
aBlock value:m |
|
677 |
] |
|
678 |
! |
|
679 |
||
2368 | 680 |
invokedViaPerform |
681 |
^ infoPerSendingMethod contains:[:someInfo | someInfo invokedViaPerform]. |
|
682 |
||
683 |
"Created: / 27-04-2010 / 18:21:36 / cg" |
|
684 |
! |
|
685 |
||
2357 | 686 |
invokingMethodsDo:aBlock |
687 |
infoPerSendingMethod isNil ifTrue:[ ^ self]. |
|
688 |
^ infoPerSendingMethod keysDo:aBlock. |
|
689 |
! |
|
690 |
||
691 |
numberOfInvocations |
|
692 |
infoPerSendingMethod isNil ifTrue:[ ^ 0]. |
|
693 |
^ infoPerSendingMethod inject:0 into:[:sumSoFar :info | sumSoFar + info numberOfInvocations] |
|
694 |
! |
|
695 |
||
696 |
numberOfInvocationsFromExternalOf:aClass |
|
697 |
|sum| |
|
698 |
||
699 |
infoPerSendingMethod isNil ifTrue:[ ^ 0]. |
|
700 |
||
701 |
sum := 0. |
|
702 |
infoPerSendingMethod keysAndValuesDo:[:sendingMethod :info | |
|
703 |
|sendingMethodsClass| |
|
704 |
||
705 |
sendingMethodsClass := sendingMethod mclass. |
|
706 |
sendingMethodsClass notNil ifTrue:[ |
|
707 |
((sendingMethodsClass isSubclassOf:aClass) |
|
708 |
or:[(aClass isSubclassOf:sendingMethodsClass )]) ifFalse:[ |
|
709 |
sum := sum + (info numberOfInvocations) |
|
710 |
] |
|
711 |
] |
|
712 |
]. |
|
713 |
^ sum |
|
714 |
! |
|
715 |
||
716 |
numberOfInvocationsFromInternalOf:aClass |
|
717 |
|sum| |
|
718 |
||
719 |
infoPerSendingMethod isNil ifTrue:[ ^ 0]. |
|
720 |
||
721 |
sum := 0. |
|
722 |
infoPerSendingMethod keysAndValuesDo:[:sendingMethod :info | |
|
723 |
|sendingMethodsClass| |
|
724 |
||
725 |
sendingMethodsClass := sendingMethod mclass. |
|
726 |
sendingMethodsClass notNil ifTrue:[ |
|
727 |
((sendingMethodsClass isSubclassOf:aClass) |
|
728 |
or:[(aClass isSubclassOf:sendingMethodsClass)]) ifTrue:[ |
|
729 |
sum := sum + (info numberOfInvocations) |
|
730 |
] |
|
731 |
] |
|
732 |
]. |
|
733 |
^ sum |
|
734 |
! ! |
|
735 |
||
736 |
!InstrumentingCompiler::MethodInvocationInfo::MethodInvocationInfoPerReceiverClass methodsFor:'instrumentation calls'! |
|
737 |
||
738 |
entry:aContext |
|
739 |
"invoked by instrumented compiled code, upon method entry" |
|
740 |
||
2368 | 741 |
|sender sendingMethod infoPerMethod viaPerform| |
2357 | 742 |
|
2391 | 743 |
aContext selector == #doesNotUnderstand: ifTrue:[ |
744 |
sender := aContext sender sender methodHome. |
|
745 |
] ifFalse:[ |
|
746 |
sender := aContext sender methodHome. |
|
747 |
]. |
|
2370
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
748 |
sender isNil ifTrue:[ |
a801cc4df234
added: #blockNodeRewriteHookFor:
Claus Gittinger <cg@exept.de>
parents:
2368
diff
changeset
|
749 |
^ self. |
2569 | 750 |
]. |
751 |
sendingMethod := sender method. |
|
752 |
sendingMethod isNil ifTrue:[^ self]. |
|
2391 | 753 |
|
2569 | 754 |
viaPerform := false. |
755 |
(sendingMethod mclass == Object |
|
756 |
and:[ sendingMethod selector startsWith:'perform:'] ) ifTrue:[ |
|
757 |
"/ Transcript showCR:('%1 [info]: skipping #perform' bindWith:self class nameWithoutPrefix). |
|
758 |
sender := sender sender methodHome. |
|
759 |
sendingMethod := sender method. |
|
760 |
viaPerform := true. |
|
2357 | 761 |
]. |
762 |
||
763 |
infoPerSendingMethod isNil ifTrue:[ |
|
764 |
infoPerSendingMethod := IdentityDictionary new. |
|
765 |
]. |
|
766 |
infoPerMethod := infoPerSendingMethod |
|
767 |
at:sendingMethod |
|
768 |
ifAbsentPut:[ MethodInvocationInfoPerSendingMethod new ]. |
|
769 |
||
2368 | 770 |
infoPerMethod entry:aContext viaPerform:viaPerform |
771 |
||
2569 | 772 |
"Modified: / 20-07-2011 / 17:26:31 / cg" |
2357 | 773 |
! ! |
774 |
||
775 |
!InstrumentingCompiler::MethodInvocationInfo::MethodInvocationInfoPerReceiverClass::MethodInvocationInfoPerSendingMethod methodsFor:'accessing'! |
|
776 |
||
2368 | 777 |
invokedViaPerform |
778 |
^ invokedViaPerform ? false |
|
779 |
||
780 |
"Created: / 27-04-2010 / 18:20:05 / cg" |
|
781 |
! |
|
782 |
||
2357 | 783 |
numberOfInvocations |
784 |
countPerSendersClass isNil ifTrue:[ ^ 0]. |
|
785 |
^ countPerSendersClass inject:0 into:[:sumSoFar :count | sumSoFar + count] |
|
786 |
! ! |
|
787 |
||
788 |
!InstrumentingCompiler::MethodInvocationInfo::MethodInvocationInfoPerReceiverClass::MethodInvocationInfoPerSendingMethod methodsFor:'instrumentation calls'! |
|
789 |
||
2368 | 790 |
entry:aContext viaPerform:viaPerformBoolean |
2357 | 791 |
"invoked by instrumented compiled code, upon method entry" |
792 |
||
793 |
|sendersClass count| |
|
794 |
||
795 |
sendersClass := aContext sender receiver class. |
|
796 |
||
797 |
countPerSendersClass isNil ifTrue:[ |
|
798 |
countPerSendersClass := IdentityDictionary new. |
|
799 |
]. |
|
800 |
count := countPerSendersClass at:sendersClass ifAbsentPut:0. |
|
2368 | 801 |
countPerSendersClass at:sendersClass put:(count + 1). |
802 |
viaPerformBoolean ifTrue:[ invokedViaPerform := true ]. |
|
803 |
||
804 |
"Created: / 27-04-2010 / 18:17:27 / cg" |
|
2357 | 805 |
! ! |
806 |
||
2948 | 807 |
!InstrumentingCompiler::MethodInvocationInfoForCoverageInAlreadyEnteredState methodsFor:'cleanup'! |
808 |
||
809 |
cleanInfoWithChange:withChange |
|
810 |
self changeClassTo:InstrumentingCompiler::MethodInvocationInfo. |
|
811 |
infoPerReceiverClass := nil. |
|
812 |
withChange ifTrue:[ |
|
813 |
Smalltalk changed:#methodCoverageInfo with:owningMethod. |
|
814 |
] |
|
815 |
||
816 |
"Modified: / 20-07-2011 / 17:55:35 / cg" |
|
817 |
"Created: / 24-08-2011 / 11:10:29 / cg" |
|
818 |
! ! |
|
819 |
||
820 |
!InstrumentingCompiler::MethodInvocationInfoForCoverageInAlreadyEnteredState methodsFor:'instrumentation probe calls'! |
|
821 |
||
822 |
entry:aContext |
|
823 |
"already been invoked - nothing to record" |
|
824 |
||
825 |
^ self |
|
826 |
! ! |
|
827 |
||
2711 | 828 |
!InstrumentingCompiler::MethodInvocationInfoInAlreadyEnteredState methodsFor:'cleanup'! |
829 |
||
830 |
cleanInfoWithChange:withChange |
|
831 |
self changeClassTo:InstrumentingCompiler::MethodInvocationInfo. |
|
832 |
infoPerReceiverClass := nil. |
|
833 |
withChange ifTrue:[ |
|
834 |
Smalltalk changed:#methodCoverageInfo with:owningMethod. |
|
835 |
] |
|
836 |
||
837 |
"Modified: / 20-07-2011 / 17:55:35 / cg" |
|
838 |
"Created: / 24-08-2011 / 11:10:29 / cg" |
|
839 |
! ! |
|
840 |
||
2715 | 841 |
!InstrumentingCompiler::VariableAccessExecutionInfo class methodsFor:'documentation'! |
842 |
||
843 |
documentation |
|
844 |
" |
|
845 |
(sub)instances of me are updated by instrumented code when a variable is accessed |
|
846 |
" |
|
847 |
! ! |
|
848 |
||
849 |
!InstrumentingCompiler::BlockExecutionInfo class methodsFor:'documentation'! |
|
850 |
||
851 |
documentation |
|
852 |
" |
|
853 |
(sub)instances of me are updated by instrumented code when a block is executed. |
|
854 |
" |
|
855 |
! ! |
|
856 |
||
2390 | 857 |
!InstrumentingCompiler::BlockExecutionInfo methodsFor:'accessing'! |
858 |
||
859 |
endPosition |
|
860 |
^ endPosition |
|
861 |
||
862 |
"Created: / 28-04-2010 / 15:57:14 / cg" |
|
863 |
! |
|
864 |
||
865 |
startPosition:startArg endPosition:endArg |
|
866 |
startPosition := startArg. |
|
867 |
endPosition := endArg. |
|
868 |
||
869 |
"Created: / 28-04-2010 / 15:54:47 / cg" |
|
870 |
! ! |
|
871 |
||
2675
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
872 |
!InstrumentingCompiler::BlockExecutionInfo methodsFor:'printing'! |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
873 |
|
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
874 |
printOn:aStream |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
875 |
aStream nextPutAll:'['. |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
876 |
startPosition printOn:aStream. |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
877 |
aStream nextPutAll:'...'. |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
878 |
endPosition printOn:aStream. |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
879 |
aStream nextPutAll:']'. |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
880 |
|
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
881 |
"Created: / 21-08-2011 / 14:02:01 / cg" |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
882 |
! ! |
3e8368ea406e
comment/format in: #addBlockCounterTo:
Claus Gittinger <cg@exept.de>
parents:
2665
diff
changeset
|
883 |
|
2632 | 884 |
!InstrumentingCompiler::BlockExecutionInfo methodsFor:'testing'! |
885 |
||
886 |
isBlockExecutionInfo |
|
887 |
^ true |
|
888 |
||
889 |
"Created: / 07-08-2011 / 17:06:39 / cg" |
|
890 |
! ! |
|
891 |
||
2715 | 892 |
!InstrumentingCompiler::ReadAccessExecutionInfo class methodsFor:'documentation'! |
893 |
||
894 |
documentation |
|
895 |
" |
|
896 |
(sub)instances of me are updated by instrumented code when a variable is read |
|
897 |
" |
|
898 |
! ! |
|
899 |
||
900 |
!InstrumentingCompiler::WriteAccessExecutionInfo class methodsFor:'documentation'! |
|
901 |
||
902 |
documentation |
|
903 |
" |
|
904 |
(sub)instances of me are updated by instrumented code when a variable is written |
|
905 |
" |
|
906 |
! ! |
|
907 |
||
2357 | 908 |
!InstrumentingCompiler class methodsFor:'documentation'! |
909 |
||
2570 | 910 |
version |
2958 | 911 |
^ '$Header: /cvs/stx/stx/libcomp/InstrumentingCompiler.st,v 1.24 2012-10-26 09:48:52 cg Exp $' |
2570 | 912 |
! |
913 |
||
2357 | 914 |
version_CVS |
2958 | 915 |
^ '$Header: /cvs/stx/stx/libcomp/InstrumentingCompiler.st,v 1.24 2012-10-26 09:48:52 cg Exp $' |
2357 | 916 |
! ! |