2355
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2010 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
"{ Package: 'stx:libcomp' }"
|
|
13 |
|
|
14 |
Method variableSubclass:#InstrumentedMethod
|
|
15 |
instanceVariableNames:''
|
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'System-Compiler-Instrumentation'
|
|
19 |
!
|
|
20 |
|
|
21 |
!InstrumentedMethod class methodsFor:'documentation'!
|
|
22 |
|
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 2010 by eXept Software AG
|
|
26 |
All Rights Reserved
|
|
27 |
|
|
28 |
This software is furnished under a license and may be used
|
|
29 |
only in accordance with the terms of that license and with the
|
|
30 |
inclusion of the above copyright notice. This software may not
|
|
31 |
be provided or otherwise made available to, or used by, any
|
|
32 |
other person. No title to or ownership of the software is
|
|
33 |
hereby transferred.
|
|
34 |
"
|
|
35 |
!
|
|
36 |
|
|
37 |
documentation
|
|
38 |
"
|
|
39 |
Instances of me are created by the instrumenting compiler.
|
|
40 |
|
|
41 |
[author:]
|
|
42 |
Claus Gittinger
|
|
43 |
"
|
|
44 |
! !
|
|
45 |
|
2367
|
46 |
!InstrumentedMethod class methodsFor:'cleanup'!
|
|
47 |
|
2572
|
48 |
cleanAllInfoWithChange:withChange
|
|
49 |
InstrumentingCompiler::InstrumentationInfo cleanAllInfoWithChange:withChange
|
2367
|
50 |
|
2572
|
51 |
"Created: / 20-07-2011 / 19:01:21 / cg"
|
2367
|
52 |
! !
|
|
53 |
|
2358
|
54 |
!InstrumentedMethod methodsFor:'accessing'!
|
|
55 |
|
|
56 |
blockInvocationInfo
|
2631
|
57 |
"return a collection of all block-info objects"
|
|
58 |
|
2358
|
59 |
|info|
|
|
60 |
|
|
61 |
info := OrderedCollection new.
|
2631
|
62 |
self literalsDo:[:lit |
|
|
63 |
lit isSpecialInstrumentationInfoLiteral ifTrue:[
|
|
64 |
(lit isMemberOf:InstrumentingCompiler::BlockExecutionInfo) ifTrue:[
|
|
65 |
info add:lit
|
|
66 |
]
|
2358
|
67 |
]
|
|
68 |
].
|
|
69 |
^ info
|
|
70 |
|
|
71 |
"Created: / 27-04-2010 / 13:47:21 / cg"
|
2631
|
72 |
"Modified: / 07-08-2011 / 17:05:02 / cg"
|
2358
|
73 |
!
|
|
74 |
|
2367
|
75 |
invokedViaPerform
|
|
76 |
"true if the method is ever invoked via perform"
|
|
77 |
|
|
78 |
|info|
|
|
79 |
|
|
80 |
info := self methodInvocationInfo.
|
|
81 |
^ info notNil and:[info invokedViaPerform]
|
|
82 |
|
|
83 |
"Created: / 27-04-2010 / 18:23:10 / cg"
|
|
84 |
!
|
|
85 |
|
2358
|
86 |
methodInvocationInfo
|
2631
|
87 |
"return the collected method-invocatin info"
|
|
88 |
|
|
89 |
^ self
|
|
90 |
literalsDetect:[:lit | lit isSpecialInstrumentationInfoLiteral
|
|
91 |
and:[ lit isMethodInvocationInfo]]
|
|
92 |
ifNone:nil
|
2358
|
93 |
|
|
94 |
"Created: / 27-04-2010 / 13:34:01 / cg"
|
2389
|
95 |
!
|
|
96 |
|
|
97 |
statementInvocationInfo
|
|
98 |
|info|
|
|
99 |
|
|
100 |
info := OrderedCollection new.
|
|
101 |
self literalsDo:[:lit |
|
|
102 |
(lit isMemberOf:InstrumentingCompiler::StatementExecutionInfo) ifTrue:[
|
|
103 |
info add:lit
|
|
104 |
]
|
|
105 |
].
|
|
106 |
^ info
|
2358
|
107 |
! !
|
|
108 |
|
2355
|
109 |
!InstrumentedMethod methodsFor:'queries'!
|
|
110 |
|
2358
|
111 |
hasBeenCalled
|
|
112 |
|info|
|
|
113 |
|
|
114 |
^ (info := self methodInvocationInfo) notNil
|
|
115 |
and:[ info hasBeenCalled ]
|
|
116 |
|
|
117 |
"Created: / 27-04-2010 / 13:03:33 / cg"
|
|
118 |
!
|
|
119 |
|
|
120 |
haveAllBlocksBeenExecuted
|
|
121 |
^ self blockInvocationInfo conform:[:eachBlockInfo | eachBlockInfo callCount > 0]
|
|
122 |
|
|
123 |
"Modified: / 27-04-2010 / 13:44:46 / cg"
|
|
124 |
!
|
|
125 |
|
2355
|
126 |
isInstrumented
|
|
127 |
^ true
|
|
128 |
|
|
129 |
"Created: / 27-04-2010 / 12:25:39 / cg"
|
|
130 |
! !
|
|
131 |
|
|
132 |
!InstrumentedMethod class methodsFor:'documentation'!
|
|
133 |
|
|
134 |
version_CVS
|
2631
|
135 |
^ '$Header: /cvs/stx/stx/libcomp/InstrumentedMethod.st,v 1.6 2011-08-08 18:09:07 cg Exp $'
|
2355
|
136 |
! !
|