author | Marcel Hlopko <marcel.hlopko@fit.cvut.cz> |
Tue, 18 Dec 2012 18:42:43 +0100 | |
branch | development |
changeset 1908 | 923de168f3d6 |
parent 1864 | 60a8dc26c8c6 |
child 2069 | 75d40b7b986f |
permissions | -rw-r--r-- |
752 | 1 |
" |
877 | 2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
877 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
8 |
||
752 | 9 |
This software is furnished under a license and may be used |
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
877 | 15 |
|
1155 | 16 |
[1] Code written at SWING Research Group contains a signature |
17 |
of one of the above copright owners. For exact set of such code, |
|
18 |
see the differences between this version and version stx:libjava |
|
1152 | 19 |
as of 1.9.2010 |
752 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
23 |
Array variableSubclass:#JavaConstantPool |
|
24 |
instanceVariableNames:'owner' |
|
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
25 |
classVariableNames:'ConstantPools' |
752 | 26 |
poolDictionaries:'' |
27 |
category:'Languages-Java-Reader-Support' |
|
28 |
! |
|
29 |
||
30 |
!JavaConstantPool class methodsFor:'documentation'! |
|
31 |
||
32 |
copyright |
|
33 |
" |
|
877 | 34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
1152 | 35 |
|
1155 | 36 |
New code and modifications done at SWING Research Group [1]: |
1152 | 37 |
|
877 | 38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
39 |
SWING Research Group, Czech Technical University in Prague |
|
40 |
||
752 | 41 |
This software is furnished under a license and may be used |
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
877 | 47 |
|
1155 | 48 |
[1] Code written at SWING Research Group contains a signature |
49 |
of one of the above copright owners. For exact set of such code, |
|
50 |
see the differences between this version and version stx:libjava |
|
1152 | 51 |
as of 1.9.2010 |
877 | 52 |
|
53 |
" |
|
752 | 54 |
! ! |
55 |
||
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
56 |
!JavaConstantPool class methodsFor:'accessing'! |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
57 |
|
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
58 |
allConstantPools |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
59 |
"linked list of all constant pools in system" |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
60 |
^ ConstantPools. |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
61 |
|
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
62 |
"Created: / 08-04-2011 / 16:53:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
63 |
"Modified: / 09-04-2011 / 09:24:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
64 |
! |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
65 |
|
761 | 66 |
allConstantPools: anOorderedCollection |
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
67 |
"linked list of all constant pools in system" |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
68 |
|
761 | 69 |
ConstantPools := anOorderedCollection. |
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
70 |
|
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
71 |
"Created: / 08-04-2011 / 17:07:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
72 |
"Modified: / 09-04-2011 / 09:24:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
761 | 73 |
"Modified: / 11-04-2011 / 18:47:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
74 |
! ! |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
75 |
|
752 | 76 |
!JavaConstantPool class methodsFor:'special'! |
77 |
||
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
78 |
invalidateForClass: internalJavaClassName |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
79 |
"Only alias, everybody calls invalidateForClass so why not me :)" |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
80 |
|
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
81 |
^self invalidateReferencesToClass: internalJavaClassName. |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
82 |
|
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
83 |
"Created: / 08-04-2011 / 16:52:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
84 |
! |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
85 |
|
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
86 |
invalidateReferencesToClass: internalJavaClassName |
758 | 87 |
"Go over all constant pools and call invalidateForClass on all |
88 |
references. (usable when given class was unloaded etc)" |
|
89 |
ConstantPools do: [:each | each invalidateForClass: internalJavaClassName]. |
|
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
90 |
|
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
91 |
"Created: / 08-04-2011 / 16:09:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
752 | 92 |
! ! |
93 |
||
94 |
!JavaConstantPool methodsFor:'accessing'! |
|
95 |
||
96 |
owner |
|
97 |
"return owner" |
|
98 |
||
99 |
^ owner |
|
100 |
||
101 |
"Created: 28.6.1996 / 21:12:22 / cg" |
|
102 |
! |
|
103 |
||
104 |
owner:something |
|
105 |
"set owner" |
|
106 |
||
107 |
owner := something. |
|
108 |
||
109 |
"Created: 28.6.1996 / 21:12:22 / cg" |
|
110 |
! ! |
|
111 |
||
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
112 |
!JavaConstantPool methodsFor:'adding'! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
113 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
114 |
at: classRefIndex putClassRefWithNameAt: classNameIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
115 |
self at: classRefIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
116 |
put: (JavaClassRef2 in: self withNameAt: classNameIndex). |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
117 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
118 |
"Created: / 13-05-2011 / 09:48:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
119 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
120 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
121 |
at: fieldRefIndex putFieldRefWithClassAt: classRefIndex andNameAndTypeAt: nameAndTypeIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
122 |
self at: fieldRefIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
123 |
put: (JavaFieldRef2 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
124 |
in: self |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
125 |
withNameAndTypeAt: nameAndTypeIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
126 |
andClassAt: classRefIndex). |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
127 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
128 |
"Created: / 13-05-2011 / 09:08:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
129 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
130 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
131 |
at: interfaceMethodRefIndex putInterfaceMethodRefWithClassAt: classRefIndex andNameAndTypeAt: nameAndTypeIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
132 |
self at: interfaceMethodRefIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
133 |
put: (JavaInterfaceMethodRef2 |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
134 |
in: self |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
135 |
withNameAndTypeAt: nameAndTypeIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
136 |
andClassAt: classRefIndex). |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
137 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
138 |
"Created: / 13-05-2011 / 09:08:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
139 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
140 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
141 |
at: methodRefIndex putMethodRefWithClassAt: classRefIndex andNameAndTypeAt: nameAndTypeIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
142 |
self at: methodRefIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
143 |
put: (JavaMethodRef2 in: self withNameAndTypeAt: nameAndTypeIndex andClassAt:classRefIndex). |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
144 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
145 |
"Created: / 13-05-2011 / 09:07:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
146 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
147 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
148 |
at: nameAndTypeIndex putNameAndTypeWithNameAt: nameIndex andDescriptorAt: descriptorIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
149 |
self at: nameAndTypeIndex |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
150 |
put: (JavaNameAndType2 in: self withNameAt: nameIndex andDescriptorAt: descriptorIndex). |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
151 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
152 |
"Created: / 13-05-2011 / 09:05:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
153 |
! ! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
154 |
|
1372
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
155 |
!JavaConstantPool methodsFor:'invalidation'! |
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
156 |
|
1372
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
157 |
invalidateForClass: slashedJavaClassName |
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
158 |
"Invalidate all resolved references to given class. |
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
159 |
Returns true if at least one ref has been invalidated, |
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
160 |
false otherwise" |
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
161 |
|
1372
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
162 |
| anyInvalidated | |
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
163 |
anyInvalidated := false. |
1376 | 164 |
self do:[:ref| |
165 |
(ref notNil and:[ref isString not and:[ref isNumber not]]) ifTrue:[ |
|
166 |
anyInvalidated := anyInvalidated | (ref invalidateForClass: slashedJavaClassName)]. |
|
167 |
]. |
|
1372
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
168 |
^anyInvalidated |
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
169 |
|
1372
dea574a1b6b3
Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents:
1155
diff
changeset
|
170 |
"Created: / 08-04-2011 / 16:11:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1376 | 171 |
"Modified: / 22-02-2012 / 20:53:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
757
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
172 |
! ! |
b98b1cd769c0
JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents:
752
diff
changeset
|
173 |
|
752 | 174 |
!JavaConstantPool methodsFor:'printing & storing'! |
175 |
||
176 |
displayString |
|
177 |
owner isNil ifTrue:[ |
|
178 |
^ '*** unowned ConstantPool' |
|
179 |
]. |
|
180 |
^ 'ConstantPool of ' , owner fullName |
|
181 |
||
182 |
"Created: 28.6.1996 / 21:13:41 / cg" |
|
183 |
"Modified: 28.6.1996 / 21:20:26 / cg" |
|
184 |
! ! |
|
185 |
||
186 |
!JavaConstantPool methodsFor:'queries'! |
|
187 |
||
188 |
refersToMethod:aJavaMethod |
|
878
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
189 |
|
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
190 |
self error: 'JV@2011-07-26: Update to new resolving scheme!!'. |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
191 |
|
752 | 192 |
self do:[:constItem | |
193 |
(constItem == aJavaMethod) ifTrue:[^ true]. |
|
878
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
194 |
|
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
195 |
]. |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
196 |
^ false |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
197 |
|
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
198 |
"Created: / 29-07-1997 / 17:39:19 / cg" |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
199 |
"Modified: / 26-07-2011 / 18:00:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
200 |
! |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
201 |
|
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
202 |
refersToMethodNamed:aJavaMethodName |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
203 |
|
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
204 |
self error: 'JV@2011-07-26: Update to new resolving scheme!!'. |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
205 |
|
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
206 |
self do:[:constItem | |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
207 |
(constItem isKindOf:JavaMethod) ifTrue:[ |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
208 |
constItem name = aJavaMethodName ifTrue:[^ true]. |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
209 |
] ifFalse:[ |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
210 |
|
752 | 211 |
] |
212 |
]. |
|
213 |
^ false |
|
214 |
||
878
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
215 |
"Created: / 29-07-1997 / 17:39:24 / cg" |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
216 |
"Modified: / 16-10-1998 / 01:22:02 / cg" |
b972cc489a01
Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents:
877
diff
changeset
|
217 |
"Modified: / 26-07-2011 / 17:54:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 218 |
! ! |
219 |
||
220 |
!JavaConstantPool methodsFor:'special'! |
|
221 |
||
222 |
classReferencesDo:aBlock |
|
223 |
self do:[:constItem | |
|
224 |
constItem isJavaClass ifTrue:[ |
|
225 |
aBlock value:constItem |
|
226 |
] |
|
227 |
] |
|
228 |
||
229 |
"Modified: / 7.8.1997 / 19:17:38 / cg" |
|
230 |
"Created: / 4.1.1998 / 00:40:11 / cg" |
|
231 |
! |
|
232 |
||
778
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
233 |
invalidateAll |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
234 |
"go over all entries and call invalidate on all references" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
235 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
236 |
self do: |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
237 |
[:entry | |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
238 |
entry isJavaRef |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
239 |
ifTrue: [ entry invalidate] ]. |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
240 |
|
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
241 |
"Created: / 13-05-2011 / 09:37:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
242 |
! |
caa3a009f617
refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents:
772
diff
changeset
|
243 |
|
752 | 244 |
updateClassRefsFrom:oldClass to:newClass |
245 |
owner == oldClass ifTrue:[ |
|
246 |
self halt. |
|
247 |
^ self |
|
248 |
]. |
|
249 |
||
250 |
self keysAndValuesDo:[:index :constItem | |
|
251 |
|nameIndex| |
|
252 |
||
253 |
constItem == oldClass ifTrue:[ |
|
254 |
self at:index put:newClass |
|
255 |
] ifFalse:[ |
|
256 |
(constItem isNil |
|
257 |
or:[constItem isNumber]) ifFalse:[ |
|
258 |
constItem isString ifTrue:[ |
|
259 |
"/ nothing done ... |
|
260 |
] ifFalse:[ |
|
261 |
(constItem isMemberOf:(Java java_lang_String)) ifTrue:[ |
|
262 |
"/ nothing done ... |
|
263 |
] ifFalse:[ |
|
264 |
constItem isBehavior ifFalse:[ |
|
265 |
constItem updateClassRefsFrom:oldClass to:newClass |
|
266 |
] ifTrue:[ |
|
267 |
constItem isJavaClass ifTrue:[ |
|
268 |
constItem fullName = oldClass fullName ifTrue:[ |
|
269 |
'JAVA: class update by name [in pool].' infoPrintCR. |
|
270 |
newClass isNil ifTrue:[ |
|
271 |
"/ mhm - must find a slot for the classes name |
|
272 |
nameIndex := -1. |
|
273 |
self |
|
274 |
at:index |
|
275 |
put:(JavaUnresolvedClassConstant |
|
276 |
pool:self |
|
277 |
poolIndex:index |
|
278 |
nameIndex:nameIndex) |
|
279 |
] ifFalse:[ |
|
280 |
self at:index put:newClass |
|
281 |
] |
|
282 |
] |
|
283 |
] |
|
284 |
] |
|
285 |
] |
|
286 |
] |
|
287 |
] |
|
288 |
] |
|
289 |
] |
|
290 |
||
291 |
"Modified: / 4.2.1998 / 22:12:03 / cg" |
|
292 |
! ! |
|
293 |
||
294 |
!JavaConstantPool class methodsFor:'documentation'! |
|
295 |
||
296 |
version |
|
1864 | 297 |
^ '$Header$' |
298 |
! |
|
299 |
||
300 |
version_HG |
|
301 |
||
302 |
^ '$Changeset: <not expanded> $' |
|
752 | 303 |
! |
304 |
||
305 |
version_SVN |
|
1864 | 306 |
^ '§Id§' |
752 | 307 |
! ! |