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