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