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