author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 07 Sep 2012 17:24:32 +0100 | |
branch | jv |
changeset 17966 | 8b5df02e171f |
parent 17911 | a99f15c5efa5 |
child 18011 | deb0c3355881 |
permissions | -rw-r--r-- |
84 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
159 | 3 |
All Rights Reserved |
84 | 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 |
" |
|
5459 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
84 | 14 |
Object subclass:#ExecutableFunction |
1180
7f4a68385ac7
only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
15 |
instanceVariableNames:'code*' |
7602
d048f13cd50a
Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents:
7257
diff
changeset
|
16 |
classVariableNames:'' |
1180
7f4a68385ac7
only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
17 |
poolDictionaries:'' |
7f4a68385ac7
only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
18 |
category:'Kernel-Methods' |
84 | 19 |
! |
20 |
||
21 |
!ExecutableFunction class methodsFor:'documentation'! |
|
22 |
||
88 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
159 | 26 |
All Rights Reserved |
88 | 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 |
||
84 | 37 |
documentation |
38 |
" |
|
88 | 39 |
This is an abstract class, to merge common attributes of all kinds of |
357 | 40 |
executable code objects; i.e. non-ST functions, Blocks and Methods |
41 |
and whatever there might be in the future. |
|
84 | 42 |
|
2244 | 43 |
Instances of ExecutableCode are not meant to be created by user code - |
1254 | 44 |
the compilers create instances of Method & Block, while compiling. |
2244 | 45 |
(the VM would not even know what to do with such an instance, and triggered |
46 |
and exception, if ever encountered during block/method execution). |
|
47 |
||
1254 | 48 |
|
1669 | 49 |
NOTICE: layout known by runtime system and compiler - do not change |
50 |
||
1254 | 51 |
|
1293 | 52 |
[Instance variables:] |
225 | 53 |
code <not_an_object> the function pointer to the machine code. |
1254 | 54 |
Not accessable from smalltalk code. |
55 |
(notice the '*' in the instVarNames definition) |
|
225 | 56 |
|
57 |
||
1293 | 58 |
[Class variables:] |
225 | 59 |
ExecutionErrorSignal parent of all execution errors |
1254 | 60 |
(not raised itself) |
225 | 61 |
|
62 |
InvalidCodeSignal codeObject is not executable |
|
84 | 63 |
|
1293 | 64 |
|
65 |
[author:] |
|
66 |
Claus Gittinger |
|
84 | 67 |
" |
68 |
! ! |
|
69 |
||
623 | 70 |
!ExecutableFunction class methodsFor:'queries'! |
84 | 71 |
|
623 | 72 |
isBuiltInClass |
1264 | 73 |
"return true if this class is known by the run-time-system. |
74 |
Here, true is returned for myself, false for subclasses." |
|
84 | 75 |
|
2244 | 76 |
^ self == ExecutableFunction |
1180
7f4a68385ac7
only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
77 |
|
2244 | 78 |
"Modified: 23.1.1997 / 13:47:58 / cg" |
623 | 79 |
! ! |
84 | 80 |
|
623 | 81 |
!ExecutableFunction methodsFor:'accessing'! |
84 | 82 |
|
83 |
code |
|
84 |
"return the code field. This is not an object but the address of the machine instructions. |
|
85 |
Therefore an integer representing the code-address is returned" |
|
86 |
||
87 |
%{ /* NOCONTEXT */ |
|
2870 | 88 |
unsigned INT addr; |
84 | 89 |
|
1133 | 90 |
if (__INST(code_) != nil) { |
3421
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
91 |
|
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
92 |
RETURN (__MKEXTERNALADDRESS(__INST(code_))); |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
93 |
#ifdef OLD |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
94 |
addr = (unsigned INT)__INST(code_); |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
95 |
if (addr <= _MAX_INT) { |
8913 | 96 |
RETURN ( __mkSmallInteger(addr) ); |
3421
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
97 |
} |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
98 |
RETURN ( __MKUINT(addr)); |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
99 |
#endif |
84 | 100 |
} |
328 | 101 |
%}. |
84 | 102 |
^ nil |
623 | 103 |
! |
104 |
||
105 |
instVarAt:index |
|
106 |
"have to catch instVar access to code - since its no object" |
|
107 |
||
108 |
(index == 1) ifTrue:[^ self code]. |
|
109 |
^ super instVarAt:index |
|
110 |
! |
|
111 |
||
112 |
instVarAt:index put:value |
|
113 |
"have to catch instVar access to code - since its no object" |
|
114 |
||
115 |
(index == 1) ifTrue:[^ self code:value]. |
|
116 |
^ super instVarAt:index put:value |
|
84 | 117 |
! ! |
118 |
||
119 |
||
120 |
!ExecutableFunction methodsFor:'error handling'! |
|
121 |
||
122 |
invalidCode |
|
1871 | 123 |
"{ Pragma: +optSpace }" |
124 |
||
84 | 125 |
"this error is triggered by the interpreter when something is wrong |
107 | 126 |
with the code object (any error not handled by Method-signals). |
84 | 127 |
In this case, the VM sends this to the bad method/block (the receiver). |
128 |
Can only happen when the Compiler/runtime system is broken or |
|
129 |
someone played around." |
|
130 |
||
7602
d048f13cd50a
Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents:
7257
diff
changeset
|
131 |
^ InvalidCodeError raise. |
1871 | 132 |
|
133 |
"Modified: 4.11.1996 / 22:47:21 / cg" |
|
84 | 134 |
! ! |
135 |
||
357 | 136 |
!ExecutableFunction methodsFor:'printing & storing'! |
137 |
||
138 |
printOn:aStream |
|
1254 | 139 |
"append a printed representation of the receiver to aStream" |
140 |
||
357 | 141 |
|addr| |
142 |
||
143 |
addr := self code. |
|
144 |
addr isNil ifTrue:[^ super printOn:aStream]. |
|
145 |
||
3193 | 146 |
aStream nextPutAll:self class name; nextPutAll:'(address: 0x'. |
9260 | 147 |
addr address printOn:aStream base:16. |
3193 | 148 |
aStream nextPut:$) |
1254 | 149 |
|
3193 | 150 |
"Modified: / 22.4.1996 / 16:36:05 / cg" |
151 |
"Modified: / 20.1.1998 / 14:10:46 / stefan" |
|
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
152 |
! |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
153 |
|
5284 | 154 |
printStringForBrowserWithSelector:selector inClass:aClass |
155 |
"return a printString to represent myself to the user in a browser." |
|
156 |
||
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
157 |
^ selector |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
158 |
|
357 | 159 |
! ! |
160 |
||
7257 | 161 |
!ExecutableFunction methodsFor:'private-accessing'! |
623 | 162 |
|
163 |
code:anAddress |
|
164 |
"set the code field - DANGER ALERT. |
|
165 |
This is not an object but the address of the machine instructions. |
|
166 |
Therefore the argument must be an integer representing this address. |
|
167 |
You can crash Smalltalk very badly when playing around here ... |
|
168 |
This method is for compiler support and very special cases (debugging) only |
|
169 |
- do not use" |
|
84 | 170 |
|
623 | 171 |
%{ /* NOCONTEXT */ |
84 | 172 |
|
3421
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
173 |
if (__isExternalAddress(anAddress)) { |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
174 |
__INST(code_) = (OBJ)(__externalAddressVal(anAddress)); |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
175 |
} else { |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
176 |
if (__isSmallInteger(anAddress)) |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
177 |
__INST(code_) = (OBJ)(__intVal(anAddress)); |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
178 |
else { |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
179 |
if (anAddress == nil) { |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
180 |
__INST(code_) = nil; |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
181 |
} else { |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
182 |
__INST(code_) = (OBJ)(__longIntVal(anAddress)); |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
183 |
} |
78a276e71115
present code as an external function (for security & style)
Claus Gittinger <cg@exept.de>
parents:
3193
diff
changeset
|
184 |
} |
623 | 185 |
} |
186 |
%} |
|
9394 | 187 |
! |
188 |
||
189 |
invalidate |
|
190 |
self code:0 |
|
84 | 191 |
! ! |
623 | 192 |
|
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
193 |
!ExecutableFunction methodsFor:'queries'! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
194 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
195 |
category |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
196 |
"return the category of this codeObject. |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
197 |
Return nil here, to alow alien codeObjects to be handled by the |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
198 |
browsers." |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
199 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
200 |
^ nil |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
201 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
202 |
"Created: 16.4.1996 / 16:31:15 / cg" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
203 |
! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
204 |
|
3932 | 205 |
hasCode |
5459 | 206 |
"return true, if this codeObject has machinecode to execute." |
3932 | 207 |
%{ |
208 |
if (__INST(code_)) { |
|
209 |
RETURN (true); |
|
210 |
} |
|
5459 | 211 |
%}. |
212 |
^ false |
|
3932 | 213 |
|
214 |
"Created: / 13.11.1998 / 23:13:29 / cg" |
|
215 |
! |
|
216 |
||
5534 | 217 |
hasResource |
218 |
"return true, if this codeObject has a resource (false here - only real methods have)." |
|
219 |
||
220 |
^ false |
|
221 |
! |
|
222 |
||
2532
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
223 |
isBreakpointed |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
224 |
"return true, if this is a wrapper method for a breakpoint. |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
225 |
False is returned here - this method is redefined in WrappedMethod" |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
226 |
|
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
227 |
^ false |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
228 |
|
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
229 |
"Created: 7.4.1997 / 17:24:40 / cg" |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
230 |
! |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
231 |
|
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
232 |
isExecutable |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
233 |
"return true, if this codeObject is executable." |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
234 |
|
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
235 |
self isInvalid ifTrue:[^ false]. |
3932 | 236 |
^ self hasCode |
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
237 |
|
3932 | 238 |
"Created: / 16.4.1996 / 20:13:32 / cg" |
239 |
"Modified: / 13.11.1998 / 23:16:32 / cg" |
|
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
240 |
! |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
241 |
|
17763 | 242 |
isInstrumented |
243 |
"return true, if this is an instrumented method. |
|
244 |
False is returned here - this method is redefined in InstrumentedMethod" |
|
245 |
||
246 |
^ false |
|
247 |
||
248 |
"Created: / 27-04-2010 / 12:26:05 / cg" |
|
249 |
! |
|
250 |
||
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
251 |
isInvalid |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
252 |
"return true, if this codeObject is invalidated. |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
253 |
Return false here, to alow alien codeObjects to be handled by the |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
254 |
browsers." |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
255 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
256 |
^ false |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
257 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
258 |
"Created: 16.4.1996 / 16:31:42 / cg" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
259 |
! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
260 |
|
3924 | 261 |
isJavaMethod |
262 |
^ false |
|
263 |
||
264 |
"Created: / 10.11.1998 / 18:26:44 / cg" |
|
265 |
! |
|
266 |
||
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
267 |
isLazyMethod |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
268 |
"return true, if this is a lazy method. |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
269 |
False is returned here - this method is redefined in LazyMethod" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
270 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
271 |
^ false |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
272 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
273 |
"Created: 16.4.1996 / 16:32:11 / cg" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
274 |
"Modified: 16.4.1996 / 16:32:36 / cg" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
275 |
! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
276 |
|
5936 | 277 |
isObsolete |
278 |
^ false |
|
279 |
! |
|
280 |
||
2536 | 281 |
isTimed |
282 |
"return true, if this is a wrapper method for a time measurement. |
|
283 |
False is returned here - this method is redefined in WrappedMethod" |
|
284 |
||
285 |
^ false |
|
286 |
||
287 |
"Created: 11.4.1997 / 17:06:32 / cg" |
|
288 |
! |
|
289 |
||
2532
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
290 |
isTraced |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
291 |
"return true, if this is a wrapper method for a trace point. |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
292 |
False is returned here - this method is redefined in WrappedMethod" |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
293 |
|
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
294 |
^ false |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
295 |
|
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
296 |
"Created: 7.4.1997 / 17:24:50 / cg" |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
297 |
! |
e555281237f1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
2244
diff
changeset
|
298 |
|
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
299 |
isUnloaded |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
300 |
"return true, if the objects machine code has been unloaded |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
301 |
from the system (i.e. it is not executable)." |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
302 |
|
3932 | 303 |
^ self hasCode not |
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
304 |
|
3932 | 305 |
"Created: / 16.4.1996 / 20:15:52 / cg" |
306 |
"Modified: / 13.11.1998 / 23:19:52 / cg" |
|
1195
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
307 |
! |
618e2cf3fb56
moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
308 |
|
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
309 |
isWrapped |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
310 |
"return true, if this is a wrapper method. |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
311 |
False is returned here - this method is redefined in WrappedMethod" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
312 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
313 |
^ false |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
314 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
315 |
"Created: 16.4.1996 / 16:33:24 / cg" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
316 |
! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
317 |
|
5904 | 318 |
messagesSent |
319 |
^ #() "/ actually: unknown here in this abstract class |
|
320 |
! |
|
321 |
||
322 |
messagesSentToSelf |
|
323 |
^ #() "/ actually: unknown here in this abstract class |
|
324 |
! |
|
325 |
||
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
326 |
privacy |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
327 |
"return a symbol describing the methods access rights (privacy); |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
328 |
Currently, this is one of #private, #protected, #public or #ignored. |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
329 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
330 |
Here we unconditionally return #public, to allow alien code objects |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
331 |
to be handled by the browsers." |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
332 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
333 |
^ #public |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
334 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
335 |
"Created: 16.4.1996 / 16:35:18 / cg" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
336 |
! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
337 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
338 |
referencesGlobal:aGlobalSymbol |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
339 |
"return true, if this method references the global |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
340 |
bound to aGlobalSymbol. |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
341 |
Return false (we dont know) here, to allow alien code objects to be |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
342 |
handled by the browsers." |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
343 |
|
8464 | 344 |
^ false |
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
345 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
346 |
"Created: 16.4.1996 / 16:37:48 / cg" |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
347 |
! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
348 |
|
4977 | 349 |
referencesGlobalMatching:aMatchPattern |
350 |
"return true, if this method references a global |
|
351 |
whose name matches aMatchPattern. |
|
352 |
Return false (we dont know) here, to allow alien code objects to be |
|
353 |
handled by the browsers." |
|
354 |
||
8464 | 355 |
^ false |
4977 | 356 |
|
357 |
"Created: / 9.11.1999 / 16:58:48 / cg" |
|
358 |
! |
|
359 |
||
5533 | 360 |
referencesLiteral:aLiteral |
5537 | 361 |
"return true, if this executable references the literal directly (i.e. a flat search). |
5533 | 362 |
Return false (we dont know) here, to allow alien code objects to be |
363 |
handled by the browsers." |
|
364 |
||
8464 | 365 |
^ false |
5537 | 366 |
|
367 |
"Modified: / 18.8.2000 / 21:18:43 / cg" |
|
5533 | 368 |
! |
369 |
||
370 |
refersToLiteral:aLiteral |
|
5537 | 371 |
"return true, if this executable references the literal directly or indirectly (i.e. a deep search). |
5533 | 372 |
Return false (we dont know) here, to allow alien code objects to be |
373 |
handled by the browsers." |
|
374 |
||
8464 | 375 |
^ false |
5537 | 376 |
|
377 |
"Modified: / 18.8.2000 / 21:18:03 / cg" |
|
5533 | 378 |
! |
379 |
||
17966 | 380 |
refersToLiteralMatching:aMatchPattern |
381 |
"return true if the receiver or recursively any array element in the |
|
382 |
receiver is symbolic and matches aMatchPattern (i.e. a deep search). |
|
383 |
Return false (we dont know) here, to allow alien code objects to be |
|
384 |
handled by the browsers." |
|
385 |
||
386 |
^ false |
|
387 |
||
388 |
"Modified: / 18-08-2000 / 21:18:03 / cg" |
|
389 |
"Created: / 26-07-2012 / 15:38:26 / cg" |
|
390 |
! |
|
391 |
||
5533 | 392 |
resources |
393 |
^ nil |
|
394 |
||
395 |
"Created: / 3.11.1997 / 09:09:01 / cg" |
|
396 |
! |
|
397 |
||
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
398 |
sends:aSelectorSymbol |
5533 | 399 |
"return true, if this code object contains a message-send with aSelectorSymbol as selector. |
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
400 |
- due to the simple check in the literal array, also simple uses |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
401 |
of aSelectorSymbol as symbol will return true. |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
402 |
Should ask compiler, if there is really a send." |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
403 |
|
5533 | 404 |
^ self referencesLiteral:aSelectorSymbol |
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
405 |
|
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
406 |
"Created: 16.4.1996 / 16:35:53 / cg" |
5533 | 407 |
! |
408 |
||
409 |
usedGlobals |
|
410 |
"return a collection with the global names referred to by the receiver. |
|
411 |
Uses Parser to parse methods source and extract them." |
|
412 |
||
413 |
^ #() |
|
1190
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
414 |
! ! |
4ad1c8d6d94d
moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents:
1180
diff
changeset
|
415 |
|
1180
7f4a68385ac7
only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
416 |
!ExecutableFunction class methodsFor:'documentation'! |
7f4a68385ac7
only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
417 |
|
7f4a68385ac7
only ExecutableFunction is fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents:
1133
diff
changeset
|
418 |
version |
17966 | 419 |
^ '$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.57 2012/07/26 14:34:24 cg Exp $' |
17763 | 420 |
! |
421 |
||
422 |
version_CVS |
|
17966 | 423 |
^ '§Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.57 2012/07/26 14:34:24 cg Exp §' |
17865 | 424 |
! |
425 |
||
426 |
version_SVN |
|
17966 | 427 |
^ '$Id: ExecutableFunction.st 10844 2012-09-07 16:24:32Z vranyj1 $' |
17846 | 428 |
! ! |
17892 | 429 |
|
17910 | 430 |
|
17911 | 431 |