author | Claus Gittinger <cg@exept.de> |
Tue, 12 Nov 1996 13:18:57 +0100 | |
changeset 441 | fa5637faa969 |
parent 388 | 067d7de615f5 |
child 474 | bf2345df4093 |
permissions | -rw-r--r-- |
141 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
114 | 12 |
|
13 |
Object subclass:#ObjectFileHandle |
|
259 | 14 |
instanceVariableNames:'sysHandle1 sysHandle2 pathName moduleID handleType weakMethodRef |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
15 |
weakClassRefs weakFunctionRefs' |
259 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'System-Compiler' |
|
120 | 19 |
! |
20 |
||
368 | 21 |
!ObjectFileHandle class methodsFor:'documentation'! |
120 | 22 |
|
141 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
114 | 35 |
! |
36 |
||
120 | 37 |
documentation |
38 |
" |
|
123 | 39 |
not for public use - used by ObjectFileLoader to keep track of loaded modules, |
40 |
associating objectFile names and moduleIDs to classes/methods. |
|
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
41 |
This is required to be able to fixup classes, methods and function references |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
42 |
when an image is restarted and the dynamic objects are reloaded. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
43 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
44 |
[see also:] |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
45 |
ExternalFunction |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
46 |
ObjectFileLoader |
263 | 47 |
|
48 |
[author:] |
|
49 |
Claus Gittinger |
|
120 | 50 |
" |
114 | 51 |
! ! |
52 |
||
53 |
!ObjectFileHandle methodsFor:'accessing'! |
|
54 |
||
122 | 55 |
classes |
56 |
"return the classes" |
|
57 |
||
125 | 58 |
weakClassRefs isNil ifTrue:[^nil]. |
122 | 59 |
^ weakClassRefs asArray |
60 |
||
61 |
"Created: 14.9.1995 / 21:13:13 / claus" |
|
62 |
! |
|
63 |
||
64 |
classes:aCollectionOfClasses |
|
65 |
"set the classes collection" |
|
66 |
||
67 |
weakClassRefs := WeakArray withAll:aCollectionOfClasses. |
|
151
7f46f760ba45
automatically unload modules for garbage collected methods/classes
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
68 |
weakClassRefs addDependent:self. |
122 | 69 |
handleType := #classLibraryObject |
70 |
||
71 |
"Created: 14.9.1995 / 21:13:13 / claus" |
|
72 |
! |
|
73 |
||
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
74 |
functions |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
75 |
"return the functions which were already extracted from the module." |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
76 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
77 |
weakFunctionRefs isNil ifTrue:[^nil]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
78 |
^ weakFunctionRefs asArray select:[:f | f notNil] |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
79 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
80 |
"Created: 12.7.1996 / 15:33:09 / cg" |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
81 |
"Modified: 12.7.1996 / 15:38:00 / cg" |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
82 |
! |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
83 |
|
120 | 84 |
method |
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
85 |
"return the method" |
120 | 86 |
|
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
87 |
weakMethodRef isNil ifTrue:[^ nil]. |
120 | 88 |
^ weakMethodRef at:1 |
89 |
||
90 |
"Created: 14.9.1995 / 21:13:13 / claus" |
|
91 |
! |
|
92 |
||
93 |
method:something |
|
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
94 |
"set the method" |
120 | 95 |
|
96 |
weakMethodRef := WeakArray with:something. |
|
151
7f46f760ba45
automatically unload modules for garbage collected methods/classes
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
97 |
weakMethodRef addDependent:self. |
122 | 98 |
handleType := #methodObject. |
120 | 99 |
|
100 |
"Created: 14.9.1995 / 21:13:13 / claus" |
|
141 | 101 |
! |
102 |
||
103 |
moduleID |
|
104 |
"return moduleID" |
|
105 |
||
106 |
^ moduleID |
|
107 |
||
108 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
109 |
! |
|
110 |
||
111 |
moduleID:something |
|
112 |
"set moduleID" |
|
113 |
||
114 |
moduleID := something. |
|
115 |
||
116 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
117 |
! |
|
118 |
||
119 |
pathName |
|
120 |
"return pathName" |
|
121 |
||
122 |
^ pathName |
|
123 |
||
124 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
125 |
! |
|
126 |
||
127 |
pathName:something |
|
128 |
"set pathName" |
|
129 |
||
130 |
pathName := something. |
|
131 |
||
132 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
133 |
! |
|
134 |
||
135 |
sysHandle1 |
|
136 |
"return sysHandle1" |
|
137 |
||
138 |
^ sysHandle1 |
|
139 |
||
140 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
141 |
! |
|
142 |
||
143 |
sysHandle1:something |
|
144 |
"set sysHandle1" |
|
145 |
||
146 |
sysHandle1 := something. |
|
147 |
||
148 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
149 |
! |
|
150 |
||
151 |
sysHandle2 |
|
152 |
"return sysHandle2" |
|
153 |
||
154 |
^ sysHandle2 |
|
155 |
||
156 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
157 |
! |
|
158 |
||
159 |
sysHandle2:something |
|
160 |
"set sysHandle2" |
|
161 |
||
162 |
sysHandle2 := something. |
|
163 |
||
164 |
"Created: 14.9.1995 / 21:13:12 / claus" |
|
114 | 165 |
! ! |
141 | 166 |
|
259 | 167 |
!ObjectFileHandle methodsFor:'change & update'! |
168 |
||
169 |
update:something with:aParameter from:changedObject |
|
170 |
"my method/class object was collected - unload the underlying objectfile" |
|
171 |
||
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
172 |
something == weakMethodRef ifTrue:[ |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
173 |
weakMethodRef nilAllCorpsesAndDo:[:idx |]. |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
174 |
]. |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
175 |
|
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
176 |
something == weakClassRefs ifTrue:[ |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
177 |
weakClassRefs nilAllCorpsesAndDo:[:idx |]. |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
178 |
]. |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
179 |
|
259 | 180 |
self isObsolete ifTrue:[ |
181 |
('OBJFLOADER: unloading ' , pathName , ' (method/classes were garbageCollected)') infoPrintNL. |
|
182 |
ObjectFileLoader unloadObjectFile:pathName |
|
183 |
]. |
|
184 |
||
185 |
"Created: 5.12.1995 / 18:05:08 / cg" |
|
186 |
! ! |
|
187 |
||
188 |
!ObjectFileHandle methodsFor:'copying'! |
|
189 |
||
190 |
postCopy |
|
191 |
"flush module handles of the copy" |
|
192 |
||
193 |
sysHandle1 := sysHandle2 := moduleID := nil |
|
194 |
||
195 |
"Created: 5.12.1995 / 21:10:49 / cg" |
|
196 |
"Modified: 25.4.1996 / 09:43:53 / cg" |
|
197 |
! ! |
|
198 |
||
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
199 |
!ObjectFileHandle methodsFor:'printing'! |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
200 |
|
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
201 |
printOn:aStream |
259 | 202 |
"append a printed representation of the receiver to aStream" |
203 |
||
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
204 |
aStream nextPutAll:self class name; nextPutAll:'(handle=<'. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
205 |
sysHandle1 printOn:aStream. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
206 |
aStream nextPutAll:' '. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
207 |
sysHandle2 printOn:aStream. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
208 |
aStream nextPutAll:'> path='''. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
209 |
pathName printOn:aStream. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
210 |
aStream nextPutAll:''' id='. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
211 |
moduleID printOn:aStream. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
212 |
aStream nextPutAll:' type='. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
213 |
handleType printOn:aStream. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
214 |
aStream nextPutAll:' method=<'. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
215 |
self method printOn:aStream. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
216 |
aStream nextPutAll:'> classes=<'. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
217 |
self classes printOn:aStream. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
218 |
aStream nextPutAll:'>'. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
219 |
|
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
220 |
aStream nextPutAll:')'. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
221 |
|
259 | 222 |
"Modified: 25.4.1996 / 09:44:08 / cg" |
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
223 |
! ! |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
224 |
|
141 | 225 |
!ObjectFileHandle methodsFor:'queries'! |
226 |
||
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
227 |
getFunction:aString |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
228 |
"return a function object for an entry in the module represented by |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
229 |
the receiver." |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
230 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
231 |
|address f slot sz nW| |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
232 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
233 |
address := ObjectFileLoader getFunction:aString from:self. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
234 |
address isNil ifTrue:[ |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
235 |
^ nil |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
236 |
]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
237 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
238 |
weakFunctionRefs isNil ifTrue:[ |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
239 |
handleType := #functionObject. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
240 |
f := ExternalFunction basicNew code:address. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
241 |
f setName:aString moduleHandle:self. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
242 |
weakFunctionRefs := WeakArray with:f. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
243 |
^ f. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
244 |
]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
245 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
246 |
weakFunctionRefs nonNilElementsDo:[:anExternalFunction | |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
247 |
anExternalFunction code = address ifTrue:[ |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
248 |
^ anExternalFunction |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
249 |
] |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
250 |
]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
251 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
252 |
f := ExternalFunction basicNew code:address. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
253 |
f setName:aString moduleHandle:self. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
254 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
255 |
slot := weakFunctionRefs identityIndexOf:nil. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
256 |
slot ~~ 0 ifTrue:[ |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
257 |
weakFunctionRefs at:slot put:f. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
258 |
^ f. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
259 |
]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
260 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
261 |
sz := weakFunctionRefs size. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
262 |
nW := WeakArray new:(sz + 2). |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
263 |
nW replaceFrom:1 to:sz with:weakFunctionRefs startingAt:1. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
264 |
nW at:sz+1 put:f. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
265 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
266 |
weakFunctionRefs := nW. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
267 |
^ f |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
268 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
269 |
"Created: 12.7.1996 / 14:59:09 / cg" |
368 | 270 |
"Modified: 18.10.1996 / 20:59:54 / cg" |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
271 |
! |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
272 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
273 |
hasUndefinedSymbols |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
274 |
"return true, if the module has any undefined symbols. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
275 |
The only system, which allows modules with undefined symbols to be |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
276 |
loaded is (currently) the linux a.out version." |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
277 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
278 |
^ ObjectFileLoader hasUndefinedSymbolsIn:self |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
279 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
280 |
"Created: 12.7.1996 / 14:59:09 / cg" |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
281 |
! |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
282 |
|
141 | 283 |
isClassLibHandle |
284 |
"return true, if I am a handle for a class library" |
|
285 |
||
286 |
^ handleType == #classLibraryObject |
|
287 |
! |
|
288 |
||
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
289 |
isForCollectedObject |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
290 |
"return true, if my clases/method has already been garbage collected" |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
291 |
|
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
292 |
|ref| |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
293 |
|
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
294 |
handleType == #classLibraryObject ifTrue:[ |
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
295 |
^ (weakClassRefs findFirst:[:x | x notNil and:[x ~~ 0]]) == 0 |
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
296 |
]. |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
297 |
handleType == #methodObject ifTrue:[ |
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
298 |
ref := weakMethodRef at:1. |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
299 |
^ ref isNil or:[ref == 0] |
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
300 |
]. |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
301 |
handleType == #functionObject ifTrue:[ |
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
302 |
^ (weakFunctionRefs findFirst:[:x | x notNil and:[x ~~ 0]]) == 0 |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
303 |
]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
304 |
|
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
305 |
^ false |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
306 |
|
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
307 |
"Created: 6.12.1995 / 17:46:58 / cg" |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
308 |
"Modified: 12.7.1996 / 15:42:38 / cg" |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
309 |
! |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
310 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
311 |
isFunctionObjectHandle |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
312 |
"return true, if I am a handle for a c-code (or other) function object file" |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
313 |
|
304 | 314 |
^ handleType == #functionObject |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
315 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
316 |
"Created: 12.7.1996 / 15:35:33 / cg" |
304 | 317 |
"Modified: 12.7.1996 / 17:25:31 / cg" |
157
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
318 |
! |
d7f68808a258
reload objects in the previous order
Claus Gittinger <cg@exept.de>
parents:
154
diff
changeset
|
319 |
|
259 | 320 |
isMethodHandle |
321 |
"return true, if I am a handle for a single compiled method" |
|
322 |
||
323 |
^ handleType == #methodObject |
|
324 |
! |
|
325 |
||
141 | 326 |
isObsolete |
327 |
"return true, if my clases/method has already been removed from |
|
328 |
the image. I.e. if the object file can be unloaded without danger." |
|
329 |
||
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
330 |
|ref| |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
331 |
|
154 | 332 |
moduleID notNil ifTrue:[ |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
333 |
handleType == #classLibraryObject ifTrue:[ |
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
334 |
^ (weakClassRefs findFirst:[:x | x notNil and:[x ~~ 0]]) == 0 |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
335 |
]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
336 |
handleType == #methodObject ifTrue:[ |
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
337 |
ref := weakMethodRef at:1. |
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
338 |
^ (ref isNil or:[ref == 0]) |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
339 |
]. |
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
340 |
handleType == #functionObject ifTrue:[ |
367
87d4673fbd06
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
304
diff
changeset
|
341 |
^ (weakFunctionRefs findFirst:[:x | x notNil and:[x ~~ 0]]) == 0 |
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
342 |
]. |
141 | 343 |
]. |
344 |
^ false |
|
299
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
345 |
|
33a154508328
additional support for non-ST object files (function modules)
Claus Gittinger <cg@exept.de>
parents:
263
diff
changeset
|
346 |
"Modified: 12.7.1996 / 15:42:21 / cg" |
141 | 347 |
! ! |
348 |
||
368 | 349 |
!ObjectFileHandle class methodsFor:'documentation'! |
148 | 350 |
|
351 |
version |
|
388 | 352 |
^ '$Header: /cvs/stx/stx/libcomp/Attic/ObjFHandle.st,v 1.20 1996-10-22 19:34:16 cg Exp $' |
148 | 353 |
! ! |