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