author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 04 Sep 2013 09:44:03 +0100 | |
branch | jv |
changeset 3397 | 2932425d1b5c |
parent 3373 | ef0f9ee70942 |
parent 3392 | 876dd4c1ab5a |
child 3409 | 2f35547d8d1e |
permissions | -rw-r--r-- |
9 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
14 | 3 |
All Rights Reserved |
9 | 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 |
" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
12 |
"{ Package: 'stx:libbasic3' }" |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
13 |
|
3158
f8c56a311307
Merged 87750af738dc and 72ca7e81fbbf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
14 |
Method subclass:#WrappedMethod |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
15 |
instanceVariableNames:'' |
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
16 |
classVariableNames:'AllWrappedMethods' |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
17 |
poolDictionaries:'' |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
18 |
category:'Kernel-Methods' |
8 | 19 |
! |
20 |
||
508 | 21 |
!WrappedMethod class methodsFor:'documentation'! |
9 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
14 | 26 |
All Rights Reserved |
9 | 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 |
support for MessageTracer |
|
234 | 40 |
|
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
41 |
notice: remembers wrappers in a weak classvar, because finding the wrapper for a |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
42 |
method is required for single stepping, and used to take a long time when using allInstances. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
43 |
Therefore, wrappers are remembered. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
44 |
|
234 | 45 |
[author:] |
46 |
Claus Gittinger |
|
47 |
||
48 |
[see also:] |
|
49 |
MessageTracer |
|
9 | 50 |
" |
51 |
! ! |
|
52 |
||
2869 | 53 |
!WrappedMethod class methodsFor:'others'! |
54 |
||
55 |
version_CVS |
|
3392 | 56 |
^ '$Header: /cvs/stx/stx/libbasic3/WrappedMethod.st,v 1.37 2013-08-29 09:52:14 cg Exp $' |
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
57 |
! |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
58 |
|
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
59 |
version_HG |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
60 |
|
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
61 |
^ '$Changeset: <not expanded> $' |
2869 | 62 |
! ! |
63 |
||
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
64 |
!WrappedMethod class methodsFor:'registration'! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
65 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
66 |
allInstancesDo:aBlock |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
67 |
AllWrappedMethods notNil ifTrue:[ |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
68 |
AllWrappedMethods copy do:aBlock |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
69 |
]. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
70 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
71 |
"Created: / 01-07-2011 / 09:45:29 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
72 |
! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
73 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
74 |
register:aWrappedMethod |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
75 |
AllWrappedMethods isNil ifTrue:[ |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
76 |
AllWrappedMethods := WeakIdentitySet new. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
77 |
]. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
78 |
AllWrappedMethods add:aWrappedMethod |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
79 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
80 |
"Created: / 01-07-2011 / 09:44:56 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
81 |
! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
82 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
83 |
unregister:aWrappedMethod |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
84 |
AllWrappedMethods notNil ifTrue:[ |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
85 |
AllWrappedMethods remove:aWrappedMethod ifAbsent:[] |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
86 |
]. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
87 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
88 |
"Created: / 01-07-2011 / 10:03:55 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
89 |
! ! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
90 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
91 |
!WrappedMethod methodsFor:'accessing'! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
92 |
|
2635 | 93 |
annotations |
2931 | 94 |
"return the wrapped method's annotations" |
2635 | 95 |
|
96 |
^ self originalMethod annotations |
|
97 |
||
98 |
"Created: / 04-12-2011 / 11:22:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
99 |
! |
|
100 |
||
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
101 |
basicLiterals |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
102 |
"return my literals" |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
103 |
|
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
104 |
^ super literals |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
105 |
|
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
106 |
"Modified: 24.6.1996 / 14:10:34 / stefan" |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
107 |
! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
108 |
|
1367
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
109 |
category:newCategory |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
110 |
super category:newCategory. |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
111 |
self originalMethod category:newCategory |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
112 |
! |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
113 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
114 |
literals |
2931 | 115 |
"return the wrapped method's literals" |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
116 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
117 |
^ self originalMethod literals |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
118 |
! |
8 | 119 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
120 |
literalsDetect:aBlock ifNone:exceptionBlock |
2931 | 121 |
"access the wrapped method's literals" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
122 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
123 |
^ self originalMethod literalsDetect:aBlock ifNone:exceptionBlock |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
124 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
125 |
"Created: / 23.1.1998 / 13:23:15 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
126 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
127 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
128 |
literalsDo:aBlock |
2931 | 129 |
"access the wrapped method's literals" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
130 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
131 |
^ self originalMethod literalsDo:aBlock |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
132 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
133 |
"Created: / 23.1.1998 / 13:09:36 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
134 |
"Modified: / 23.1.1998 / 13:22:38 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
135 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
136 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
137 |
methodArgAndVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
138 |
"return the names of the args and locals of the wrapped method." |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
139 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
140 |
^ self originalMethod methodArgAndVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
141 |
! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
142 |
|
3097
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
143 |
methodArgAndVarNamesInContext: context |
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
144 |
"return the names of the args and locals of the wrapped method. |
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
145 |
in given context (for Java, as in java local names differ by |
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
146 |
actual program counter)" |
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
147 |
|
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
148 |
^ self originalMethod methodArgAndVarNamesInContext: context |
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
149 |
|
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
150 |
"Created: / 18-12-2012 / 18:16:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
151 |
! |
5cd4ef31a4e1
Added WrappedMethod>>methodArgAndVarNamesInContenxt:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3095
diff
changeset
|
152 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
153 |
methodVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
154 |
"return the names of the locals of the wrapped method." |
14 | 155 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
156 |
^ self originalMethod methodVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
157 |
! |
8 | 158 |
|
508 | 159 |
numVars |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
160 |
"return the number of locals in the wrapped method." |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
161 |
|
508 | 162 |
^ self originalMethod numVars |
163 |
||
164 |
"Created: 4.11.1996 / 21:40:10 / cg" |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
165 |
! |
8 | 166 |
|
167 |
originalMethod |
|
14 | 168 |
"return the method the receiver is wrapping" |
8 | 169 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
170 |
"a kludge: it must be in my literal array somewhere" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
171 |
super literalsDo:[:aLiteral | |
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
172 |
aLiteral isMethod ifTrue:[ |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
173 |
^ aLiteral |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
174 |
] |
8 | 175 |
]. |
176 |
^ nil |
|
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
177 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
178 |
"Modified: / 23.1.1998 / 13:08:25 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
179 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
180 |
|
2293 | 181 |
originalMethodIfWrapped |
182 |
"return the method the receiver is wrapping" |
|
183 |
||
184 |
^ self originalMethod |
|
185 |
||
186 |
"Created: / 22-10-2010 / 11:45:42 / cg" |
|
187 |
! |
|
188 |
||
1367
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
189 |
package:aSymbol |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
190 |
super package:aSymbol. |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
191 |
self originalMethod package:aSymbol |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
192 |
! |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
193 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
194 |
privacy |
2931 | 195 |
"return the wrapped method's privacy" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
196 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
197 |
^ self originalMethod privacy |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
198 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
199 |
"Created: / 23.1.1998 / 13:09:17 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
200 |
"Modified: / 23.1.1998 / 13:20:59 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
201 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
202 |
|
1396 | 203 |
privacy:aSymbol |
2931 | 204 |
"set the wrapped method's privacy" |
1396 | 205 |
|
206 |
^ self originalMethod privacy:aSymbol |
|
207 |
! |
|
208 |
||
2182 | 209 |
programmingLanguage |
3392 | 210 |
^ (self originalMethod ? self mclass ? Smalltalk) programmingLanguage |
211 |
||
212 |
"Modified: / 29-08-2013 / 10:59:20 / cg" |
|
2182 | 213 |
! |
214 |
||
3306 | 215 |
replaceOriginalMethodWith:aNewMethod |
216 |
"change the original method which is going to be invoked by this wrapper. |
|
217 |
The only place where this makes sense is when the original method has to be |
|
218 |
replaced by a recompiled breakpointed method (in the debugger)." |
|
219 |
||
220 |
"a kludge: it is in my literal array somewhere" |
|
221 |
1 to:(super numLiterals) do:[:i | |
|
222 |
(super literalAt:i) isMethod ifTrue:[ |
|
223 |
super literalAt:i put:aNewMethod. |
|
224 |
^ self. |
|
225 |
] |
|
226 |
]. |
|
227 |
^ self |
|
228 |
! |
|
229 |
||
1396 | 230 |
restricted:aBoolean |
231 |
^ self originalMethod restricted:aBoolean |
|
232 |
! |
|
233 |
||
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
234 |
setPrivacy:aSymbol |
2931 | 235 |
"set the wrapped method's privacy" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
236 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
237 |
^ self originalMethod setPrivacy:aSymbol |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
238 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
239 |
"Modified: / 23.1.1998 / 13:21:26 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
240 |
"Created: / 23.1.1998 / 15:26:26 / stefan" |
2101
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
241 |
! |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
242 |
|
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
243 |
source |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
244 |
"return the source of the method" |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
245 |
|
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
246 |
^ self originalMethod source |
8 | 247 |
! ! |
248 |
||
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
249 |
!WrappedMethod methodsFor:'misc'! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
250 |
|
2869 | 251 |
makeLocalStringSource |
252 |
||
253 |
self originalMethod makeLocalStringSource |
|
254 |
||
255 |
"Created: / 11-02-2012 / 19:09:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
256 |
! |
|
257 |
||
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
258 |
register |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
259 |
self class register:self |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
260 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
261 |
"Created: / 01-07-2011 / 10:03:26 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
262 |
! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
263 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
264 |
unregister |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
265 |
self class unregister:self |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
266 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
267 |
"Created: / 01-07-2011 / 10:03:32 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
268 |
! ! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
269 |
|
3306 | 270 |
!WrappedMethod methodsFor:'printing and storing'! |
271 |
||
272 |
printOn:aStream |
|
273 |
"put a printed representation of the receiver onto aStream. |
|
274 |
Since methods do not store their class/selector, we have to search |
|
275 |
for it here." |
|
276 |
||
277 |
self basicPrintOn:aStream."/ aStream nextPutAll:(self classNameWithArticle). |
|
278 |
aStream nextPutAll:'(for '. |
|
279 |
aStream nextPutAll:self originalMethod whoString. |
|
280 |
aStream nextPutAll:')'. |
|
281 |
! ! |
|
282 |
||
2644 | 283 |
!WrappedMethod methodsFor:'private'! |
284 |
||
285 |
annotationAtIndex: index |
|
286 |
||
287 |
"return annotation at given index. |
|
288 |
any raw annotation array is lazily |
|
289 |
initialized" |
|
290 |
||
291 |
^self originalMethod annotationAtIndex: index |
|
292 |
||
293 |
"Created: / 16-12-2011 / 19:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
294 |
! |
|
295 |
||
296 |
annotationIndexOf: key |
|
297 |
||
298 |
"Returns index of annotation with given key |
|
299 |
or nil if there is no such annotation" |
|
300 |
||
301 |
^self originalMethod annotationIndexOf: key |
|
302 |
||
303 |
"Created: / 16-12-2011 / 19:53:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
304 |
! ! |
|
305 |
||
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
306 |
!WrappedMethod methodsFor:'queries'! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
307 |
|
733 | 308 |
argSignature |
309 |
^ self originalMethod argSignature |
|
310 |
||
311 |
"Created: / 27.1.1999 / 20:23:17 / cg" |
|
312 |
! |
|
313 |
||
3296 | 314 |
hasAnnotation |
315 |
"Return true iff the method has any annotation" |
|
316 |
||
317 |
^ self originalMethod hasAnnotation |
|
318 |
! |
|
319 |
||
2012 | 320 |
hasResource |
321 |
"return the wrapped methods hasResource" |
|
322 |
||
323 |
^ self originalMethod hasResource |
|
324 |
! |
|
325 |
||
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
326 |
isBreakpointed |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
327 |
"return true, if the receiver is a wrapped method for a breakpoint. |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
328 |
Ask the messageTracer, since I dont know if its a break or trace" |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
329 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
330 |
^ (MessageTracer isTrapped:self) |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
331 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
332 |
"Created: 7.4.1997 / 17:25:40 / cg" |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
333 |
! |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
334 |
|
580 | 335 |
isTimed |
336 |
"return true, if the receiver is a wrapped method for a time measurement. |
|
337 |
Ask the messageTracer, since I dont know if its a break or trace" |
|
338 |
||
339 |
^ (MessageTracer isTiming:self) |
|
340 |
||
341 |
"Created: 11.4.1997 / 17:06:14 / cg" |
|
342 |
! |
|
343 |
||
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
344 |
isTraced |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
345 |
"return true, if the receiver is a wrapped method for a trace point. |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
346 |
Ask the messageTracer, since I dont know if its a break or trace" |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
347 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
348 |
^ (MessageTracer isTrapped:self) not |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
349 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
350 |
"Created: 7.4.1997 / 17:25:54 / cg" |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
351 |
! |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
352 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
353 |
isWrapped |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
354 |
"return true, if the receiver is a wrapped method. |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
355 |
True is returned here, since the receiver is always a wrapped one" |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
356 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
357 |
^ true |
729 | 358 |
! |
359 |
||
971 | 360 |
messagesSent |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
361 |
"return a collection of message selectors sent by this method" |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
362 |
|
971 | 363 |
^ self originalMethod messagesSent |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
364 |
! |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
365 |
|
971 | 366 |
messagesSentToSelf |
367 |
"return a collection of message selectors sent to self by this method" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
368 |
|
971 | 369 |
^ self originalMethod messagesSentToSelf |
370 |
! |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
371 |
|
971 | 372 |
messagesSentToSuper |
373 |
"return a collection of message selectors sent to super by this method" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
374 |
|
971 | 375 |
^ self originalMethod messagesSentToSuper |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
376 |
! |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
377 |
|
3366 | 378 |
parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource |
3392 | 379 |
|m| |
380 |
||
381 |
(m := self originalMethod) notNil ifTrue:[ |
|
382 |
^ m parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource |
|
383 |
]. |
|
384 |
^ valueIfNoSource |
|
3366 | 385 |
|
386 |
"Created: / 02-08-2013 / 10:57:02 / cg" |
|
387 |
! |
|
388 |
||
3296 | 389 |
refersToLiteral: anObject |
390 |
^ self originalMethod refersToLiteral: anObject |
|
391 |
! |
|
392 |
||
2012 | 393 |
resources |
394 |
"return the wrapped methods resources" |
|
395 |
||
396 |
^ self originalMethod resources |
|
397 |
! |
|
398 |
||
729 | 399 |
signature |
400 |
^ self originalMethod signature |
|
401 |
||
402 |
"Created: / 14.11.1998 / 00:01:50 / cg" |
|
733 | 403 |
! |
404 |
||
405 |
signatureNameWithoutReturnType |
|
406 |
^ self originalMethod signatureNameWithoutReturnType |
|
407 |
||
408 |
"Created: / 27.1.1999 / 20:52:25 / cg" |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
409 |
! ! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
410 |
|
508 | 411 |
!WrappedMethod class methodsFor:'documentation'! |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
412 |
|
3069 | 413 |
version |
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
414 |
^ '$Header: WrappedMethod.st 1985 2013-01-16 11:55:57Z vranyj1 $' |
3012 | 415 |
! |
416 |
||
2869 | 417 |
version_SVN |
3392 | 418 |
^ '$Id: WrappedMethod.st,v 1.37 2013-08-29 09:52:14 cg Exp $' |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
419 |
! ! |
3296 | 420 |