120
|
1 |
'From Smalltalk/X, Version:2.10.7 on 14-sep-1995 at 9:26:01 pm' !
|
114
|
2 |
|
|
3 |
Object subclass:#ObjectFileHandle
|
122
|
4 |
instanceVariableNames:'sysHandle1 sysHandle2 pathName moduleID handleType weakMethodRef weakClassRefs'
|
120
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'System-Compiler'
|
|
8 |
!
|
|
9 |
|
|
10 |
!ObjectFileHandle class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
version
|
|
13 |
"
|
125
|
14 |
$Header: /cvs/stx/stx/libcomp/ObjectFileHandle.st,v 1.5 1995-10-23 16:57:59 cg Exp $
|
120
|
15 |
"
|
114
|
16 |
!
|
|
17 |
|
120
|
18 |
documentation
|
|
19 |
"
|
123
|
20 |
not for public use - used by ObjectFileLoader to keep track of loaded modules,
|
|
21 |
associating objectFile names and moduleIDs to classes/methods.
|
120
|
22 |
"
|
114
|
23 |
|
120
|
24 |
"Created: 14.9.1995 / 21:10:55 / claus"
|
|
25 |
!
|
114
|
26 |
|
120
|
27 |
history
|
|
28 |
|
|
29 |
"Created: 14.9.1995 / 21:10:55 / claus"
|
|
30 |
"Modified: 14.9.1995 / 21:10:55 / claus"
|
|
31 |
!
|
114
|
32 |
|
|
33 |
copyright
|
|
34 |
"
|
|
35 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
36 |
All Rights Reserved
|
|
37 |
|
|
38 |
This software is furnished under a license and may be used
|
|
39 |
only in accordance with the terms of that license and with the
|
|
40 |
inclusion of the above copyright notice. This software may not
|
|
41 |
be provided or otherwise made available to, or used by, any
|
|
42 |
other person. No title to or ownership of the software is
|
|
43 |
hereby transferred.
|
|
44 |
"
|
120
|
45 |
! !
|
114
|
46 |
|
120
|
47 |
!ObjectFileHandle methodsFor:'queries'!
|
114
|
48 |
|
122
|
49 |
isClassLibHandle
|
123
|
50 |
"return true, if I am a handle for a class library"
|
|
51 |
|
122
|
52 |
^ handleType == #classLibraryObject
|
|
53 |
!
|
|
54 |
|
120
|
55 |
isMethodHandle
|
123
|
56 |
"return true, if I am a handle for a single compiled method"
|
|
57 |
|
122
|
58 |
^ handleType == #methodObject
|
123
|
59 |
!
|
|
60 |
|
|
61 |
isObsolete
|
|
62 |
"return true, if my clases/method has already been removed from
|
|
63 |
the image. I.e. if the object file can be unloaded without danger."
|
|
64 |
|
|
65 |
handleType == #classLibraryObject ifTrue:[
|
|
66 |
^ (weakClassRefs findFirst:[:x | x notNil]) == 0
|
|
67 |
].
|
|
68 |
handleType == #methodObject ifTrue:[
|
|
69 |
^ (weakMethodRef at:1) isNil
|
|
70 |
].
|
|
71 |
^ false
|
114
|
72 |
! !
|
|
73 |
|
|
74 |
!ObjectFileHandle methodsFor:'accessing'!
|
|
75 |
|
120
|
76 |
sysHandle1
|
|
77 |
"return sysHandle1"
|
|
78 |
|
|
79 |
^ sysHandle1
|
|
80 |
|
|
81 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
114
|
82 |
!
|
|
83 |
|
120
|
84 |
sysHandle1:something
|
|
85 |
"set sysHandle1"
|
|
86 |
|
|
87 |
sysHandle1 := something.
|
|
88 |
|
|
89 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
114
|
90 |
!
|
|
91 |
|
|
92 |
sysHandle2
|
120
|
93 |
"return sysHandle2"
|
|
94 |
|
114
|
95 |
^ sysHandle2
|
120
|
96 |
|
|
97 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
|
98 |
!
|
|
99 |
|
|
100 |
sysHandle2:something
|
|
101 |
"set sysHandle2"
|
|
102 |
|
|
103 |
sysHandle2 := something.
|
|
104 |
|
|
105 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
114
|
106 |
!
|
|
107 |
|
|
108 |
pathName
|
120
|
109 |
"return pathName"
|
|
110 |
|
114
|
111 |
^ pathName
|
120
|
112 |
|
|
113 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
|
114 |
!
|
|
115 |
|
|
116 |
pathName:something
|
|
117 |
"set pathName"
|
|
118 |
|
|
119 |
pathName := something.
|
|
120 |
|
|
121 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
|
122 |
!
|
|
123 |
|
|
124 |
moduleID
|
|
125 |
"return moduleID"
|
|
126 |
|
|
127 |
^ moduleID
|
|
128 |
|
|
129 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
114
|
130 |
!
|
|
131 |
|
120
|
132 |
moduleID:something
|
|
133 |
"set moduleID"
|
|
134 |
|
|
135 |
moduleID := something.
|
|
136 |
|
|
137 |
"Created: 14.9.1995 / 21:13:12 / claus"
|
|
138 |
!
|
|
139 |
|
122
|
140 |
classes
|
|
141 |
"return the classes"
|
|
142 |
|
125
|
143 |
weakClassRefs isNil ifTrue:[^nil].
|
122
|
144 |
^ weakClassRefs asArray
|
|
145 |
|
|
146 |
"Created: 14.9.1995 / 21:13:13 / claus"
|
|
147 |
!
|
|
148 |
|
|
149 |
classes:aCollectionOfClasses
|
|
150 |
"set the classes collection"
|
|
151 |
|
|
152 |
weakClassRefs := WeakArray withAll:aCollectionOfClasses.
|
|
153 |
handleType := #classLibraryObject
|
|
154 |
|
|
155 |
"Created: 14.9.1995 / 21:13:13 / claus"
|
|
156 |
!
|
|
157 |
|
120
|
158 |
method
|
|
159 |
"return method"
|
|
160 |
|
|
161 |
^ weakMethodRef at:1
|
|
162 |
|
|
163 |
"Created: 14.9.1995 / 21:13:13 / claus"
|
|
164 |
!
|
|
165 |
|
|
166 |
method:something
|
|
167 |
"set method"
|
|
168 |
|
|
169 |
weakMethodRef := WeakArray with:something.
|
122
|
170 |
handleType := #methodObject.
|
120
|
171 |
|
|
172 |
"Created: 14.9.1995 / 21:13:13 / claus"
|
114
|
173 |
! !
|