author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 25 Oct 2017 23:18:30 +0100 | |
changeset 3786 | 5955382113e0 |
parent 3605 | da57f13e6a23 |
child 3787 | 13b3e613b1e6 |
permissions | -rw-r--r-- |
454 | 1 |
" |
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3236
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
5 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3236
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
454 | 8 |
|
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. |
|
2151 | 15 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
19 |
as of 1.9.2010 |
2086 | 20 |
" |
678 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
3419
aa30aeb2ee07
Fixed (some) race conditions during class reload
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
23 |
"{ NameSpace: Smalltalk }" |
aa30aeb2ee07
Fixed (some) race conditions during class reload
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
24 |
|
2551 | 25 |
CompiledCode variableSubclass:#JavaMethod |
2160 | 26 |
instanceVariableNames:'accessFlags selector javaClass descriptor signature lookupObject |
2716
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
27 |
lineNumberTable localVariableTable source annotations' |
3555
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
28 |
classVariableNames:'SignatureTypeCodes ForceByteCodeDisplay ShowFullSource |
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
29 |
UnresolvedClassSignal A_PUBLIC A_PRIVATE A_PROTECTED A_STATIC |
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
30 |
A_FINAL A_SYNCHRONIZED A_ABSTRACT A_NATIVE A_BREAKPOINT |
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
31 |
A_HASHANDLER A_BRIDGE A_VARARGS A_STRICT A_SYNTHETIC A_RESOLVED |
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
32 |
A_HASFINALLY' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
33 |
poolDictionaries:'JavaConstants' |
2160 | 34 |
category:'Languages-Java-Classes' |
2 | 35 |
! |
36 |
||
454 | 37 |
!JavaMethod class methodsFor:'documentation'! |
38 |
||
39 |
copyright |
|
40 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3236
diff
changeset
|
41 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
42 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
43 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
44 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3236
diff
changeset
|
45 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
46 |
SWING Research Group, Czech Technical University in Prague |
454 | 47 |
|
48 |
This software is furnished under a license and may be used |
|
49 |
only in accordance with the terms of that license and with the |
|
50 |
inclusion of the above copyright notice. This software may not |
|
51 |
be provided or otherwise made available to, or used by, any |
|
52 |
other person. No title to or ownership of the software is |
|
53 |
hereby transferred. |
|
2151 | 54 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
55 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
56 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
57 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
58 |
as of 1.9.2010 |
2151 | 59 |
|
2086 | 60 |
" |
454 | 61 |
! ! |
2 | 62 |
|
129 | 63 |
!JavaMethod class methodsFor:'initialization'! |
8 | 64 |
|
65 |
initialize |
|
3555
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
66 |
UnresolvedClassSignal isNil ifTrue:[ |
2114
cbdc4c02a8e2
ExecutionErrorSignal -> ExecutionError
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
67 |
UnresolvedClassSignal := ExecutionError newSignalMayProceed:true. |
594 | 68 |
UnresolvedClassSignal nameClass:self message:#unresolvedClassSignal. |
69 |
UnresolvedClassSignal notifierString:'unresolved class'. |
|
277 | 70 |
]. |
71 |
||
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
72 |
ShowFullSource := true. |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
73 |
ForceByteCodeDisplay := false. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
74 |
|
252 | 75 |
A_PUBLIC := 16r0001. |
76 |
A_PRIVATE := 16r0002. |
|
77 |
A_PROTECTED := 16r0004. |
|
78 |
A_STATIC := 16r0008. |
|
79 |
A_FINAL := 16r0010. |
|
80 |
A_SYNCHRONIZED := 16r0020. |
|
2145 | 81 |
A_BRIDGE := 16r0040. |
82 |
A_VARARGS := 16r0080. |
|
252 | 83 |
A_NATIVE := 16r0100. |
84 |
A_ABSTRACT := 16r0400. |
|
2145 | 85 |
A_STRICT := 16r0800. |
86 |
A_SYNTHETIC := 16r1000. |
|
252 | 87 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
88 |
A_BREAKPOINT := 16r10000000. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
89 |
A_HASHANDLER := 16r20000000. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
90 |
A_HASFINALLY := 16r00004000. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
91 |
A_RESOLVED := 16r00000200. |
255 | 92 |
|
173 | 93 |
self flags:(self flags bitOr:Behavior flagJavaMethod). |
94 |
||
8 | 95 |
SignatureTypeCodes := IdentityDictionary new. |
96 |
SignatureTypeCodes at:$B put:#byte. |
|
97 |
SignatureTypeCodes at:$C put:#char. |
|
98 |
SignatureTypeCodes at:$D put:#double. |
|
99 |
SignatureTypeCodes at:$F put:#float. |
|
100 |
SignatureTypeCodes at:$I put:#int. |
|
101 |
SignatureTypeCodes at:$J put:#long. |
|
102 |
SignatureTypeCodes at:$S put:#'unsigned short'. |
|
103 |
SignatureTypeCodes at:$Z put:#boolean. |
|
104 |
SignatureTypeCodes at:$L put:#object. |
|
105 |
SignatureTypeCodes at:$[ put:#array. |
|
2151 | 106 |
SignatureTypeCodes at:$T put:#typevar. |
8 | 107 |
|
207 | 108 |
ForceByteCodeDisplay := false. |
109 |
||
8 | 110 |
" |
378 | 111 |
JavaMethod initialize. |
112 |
JavaMethodWithHandler initialize. |
|
209 | 113 |
ForceByteCodeDisplay := true. |
255 | 114 |
ForceByteCodeDisplay := false. |
8 | 115 |
" |
173 | 116 |
|
2151 | 117 |
"Modified: / 16-10-1998 / 01:29:48 / cg" |
3555
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
118 |
"Modified: / 29-03-2016 / 21:05:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 119 |
! |
120 |
||
121 |
reinitialize |
|
122 |
||
123 |
self flags:(self flags bitOr:Behavior flagJavaMethod). |
|
124 |
||
125 |
"Created: / 14-12-2010 / 20:58:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
378 | 126 |
! ! |
127 |
||
128 |
!JavaMethod class methodsFor:'instance creation'! |
|
129 |
||
130 |
fromMethod:aJavaMethod |
|
131 |
"create a new javaMethod, copying values from another javaMethod" |
|
132 |
||
133 |
^ self new fromMethod:aJavaMethod |
|
134 |
||
135 |
"Created: / 16.10.1998 / 01:25:12 / cg" |
|
136 |
! |
|
137 |
||
138 |
new |
|
139 |
"create a new javaMethod. |
|
140 |
Redefined, since constants are NOT stored in a literalArray, |
|
141 |
but my classes constantTable instead." |
|
142 |
||
143 |
^ self basicNew:0. |
|
144 |
||
145 |
"Created: / 16.10.1998 / 01:13:02 / cg" |
|
277 | 146 |
! ! |
147 |
||
148 |
!JavaMethod class methodsFor:'Signal constants'! |
|
149 |
||
594 | 150 |
unresolvedClassSignal |
151 |
"return the signal raised when an unresolved class is referenced" |
|
152 |
||
153 |
^ UnresolvedClassSignal |
|
154 |
||
155 |
"Created: / 27.1.1998 / 21:50:05 / cg" |
|
8 | 156 |
! ! |
157 |
||
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
158 |
!JavaMethod class methodsFor:'accessing'! |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
159 |
|
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
160 |
showFullSource |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
161 |
^ ShowFullSource |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
162 |
|
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
163 |
"Created: / 14-09-2013 / 11:56:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
164 |
! ! |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
165 |
|
169 | 166 |
!JavaMethod class methodsFor:'misc'! |
167 |
||
168 |
forceByteCodeDisplay |
|
169 |
^ ForceByteCodeDisplay |
|
170 |
||
171 |
"Created: 7.4.1997 / 20:11:39 / cg" |
|
309 | 172 |
! |
173 |
||
174 |
forceByteCodeDisplay:aBoolean |
|
175 |
ForceByteCodeDisplay := aBoolean |
|
176 |
||
177 |
" |
|
178 |
self forceByteCodeDisplay:true |
|
179 |
self forceByteCodeDisplay:false |
|
180 |
" |
|
181 |
||
182 |
"Created: / 4.2.1998 / 00:22:54 / cg" |
|
2151 | 183 |
! |
184 |
||
185 |
makeJavaMethod |
|
186 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
187 |
self flags:((self flags |
2151 | 188 |
bitOr:Behavior flagJavaMethod) |
189 |
bitClear:Behavior flagMetaMethod) |
|
190 |
||
191 |
" |
|
192 |
JavaMethod makeJavaMethod |
|
193 |
JavaMethod makeMetaMethod |
|
194 |
" |
|
195 |
||
196 |
"Created: / 23-02-2011 / 12:56:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
197 |
! |
|
198 |
||
199 |
makeMetaMethod |
|
200 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
201 |
self flags:((self flags |
2151 | 202 |
bitOr:Behavior flagMetaMethod) |
203 |
bitClear:Behavior flagJavaMethod) |
|
204 |
" |
|
205 |
JavaMethod makeJavaMethod |
|
206 |
JavaMethod makeMetaMethod |
|
207 |
" |
|
208 |
||
209 |
"Created: / 23-02-2011 / 12:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
169 | 210 |
! ! |
211 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
212 |
!JavaMethod class methodsFor:'others'! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
213 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
214 |
version_HG |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
215 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
216 |
^ '$Changeset: <not expanded> $' |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
217 |
! ! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
218 |
|
129 | 219 |
!JavaMethod class methodsFor:'signature parsing'! |
5 | 220 |
|
29 | 221 |
argSigArrayFromSignature:aSignature |
222 |
"given a signature, return a specArray for the arguments" |
|
223 |
||
238 | 224 |
|s| |
29 | 225 |
|
226 |
s := aSignature readStream. |
|
237 | 227 |
s next ~~ $( ifTrue:[self halt]. |
29 | 228 |
|
229 |
^ self argSigArrayFromStream:s. |
|
230 |
||
231 |
" |
|
232 |
JavaMethod argSigArrayFromSignature:'(LObject;)V' |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
233 |
JavaMethod argSigArrayFromSignature:'(BB)S' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
234 |
JavaMethod argSigArrayFromSignature:'(LObject;LObject;II)V' |
29 | 235 |
" |
236 |
! |
|
237 |
||
238 |
argSigArrayFromStream:s |
|
239 |
"parse an argSpec, return an array of specs - see java doc" |
|
240 |
||
241 |
|argSpec spec| |
|
242 |
||
243 |
spec := #(). |
|
244 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
245 |
"/ s peek == Character space ifTrue:[ |
|
246 |
"/ s next |
|
247 |
"/ ] ifFalse:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
248 |
argSpec := self fieldTypeFromStream:s in:nil. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
249 |
spec := spec copyWith:argSpec. |
29 | 250 |
"/ ] |
251 |
]. |
|
252 |
^ spec |
|
253 |
||
255 | 254 |
"Modified: / 8.1.1998 / 19:10:20 / cg" |
29 | 255 |
! |
256 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
257 |
argSignatureFromArgTypeArray:arr |
2151 | 258 |
| sig | |
321 | 259 |
|
260 |
sig := ''. |
|
2151 | 261 |
arr do: |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
262 |
[:el | |
2151 | 263 |
| jCLass | |
264 |
||
265 |
jCLass := el. |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
266 |
jCLass isJavaClass |
2151 | 267 |
ifFalse:[ jCLass := JavaVM reflection classForJavaClassObject:el ]. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
268 |
jCLass isJavaClass |
2151 | 269 |
ifTrue: |
270 |
[ sig := sig , jCLass typeName. |
|
271 |
] |
|
272 |
ifFalse:[ self halt. ] ]. |
|
322 | 273 |
^ sig |
321 | 274 |
|
275 |
" |
|
276 |
self argSignatureFromArgTypeArray: |
|
2151 | 277 |
(Array |
278 |
with:(JavaVM javaClassObjectForClass:(Java at:'com.sun.java.swing.JComponent')))" |
|
279 |
||
280 |
"Modified: / 13-02-1998 / 14:57:58 / cg" |
|
281 |
"Modified: / 02-03-2011 / 22:49:24 / Marcel Hlopko <hlopik@gmail.com>" |
|
321 | 282 |
! |
283 |
||
113 | 284 |
argSpecFromSignature:aSignature withName:name |
285 |
"given a signature, return a spec" |
|
286 |
||
238 | 287 |
|s argSpec| |
113 | 288 |
|
289 |
s := aSignature readStream. |
|
290 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
291 |
||
255 | 292 |
argSpec := self argSpecFromStream:s in:nil. |
113 | 293 |
|
294 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
295 |
||
296 |
^ name , ' (' , argSpec , ')' |
|
297 |
||
298 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
299 |
JavaMethod argSpecFromSignature:'(LObject;)V' withName:'foo' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
300 |
JavaMethod argSpecFromSignature:'(BB)S' withName:'foo' |
113 | 301 |
" |
302 |
||
255 | 303 |
"Modified: / 8.1.1998 / 19:05:36 / cg" |
5 | 304 |
! |
305 |
||
142 | 306 |
argSpecFromStream:s in:aPackage |
307 |
"parse an argSpec - see java doc" |
|
308 |
||
309 |
|argSpec spec| |
|
310 |
||
311 |
spec := ''. |
|
312 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
313 |
"/ s peek == Character space ifTrue:[ |
|
314 |
"/ s next |
|
315 |
"/ ] ifFalse:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
316 |
argSpec := self fieldTypeFromStream:s in:aPackage. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
317 |
spec size ~~ 0 ifTrue:[ |
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
318 |
spec := spec , ', ' |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
319 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
320 |
spec := spec , argSpec. |
142 | 321 |
"/ ] |
322 |
]. |
|
323 |
^ spec |
|
324 |
||
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
325 |
"Created: / 18-03-1997 / 11:06:44 / cg" |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
326 |
"Modified: / 04-10-2013 / 12:45:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
142 | 327 |
! |
328 |
||
154 | 329 |
argSpecWithArgsFromStream:s in:aPackage |
330 |
"parse an argSpec - see java doc" |
|
331 |
||
255 | 332 |
^ self argSpecWithArgsFromStream:s in:aPackage argNames:nil |
333 |
||
334 |
"Modified: / 8.1.1998 / 19:21:00 / cg" |
|
335 |
! |
|
336 |
||
337 |
argSpecWithArgsFromStream:s in:aPackage argNames:argNames |
|
338 |
"parse an argSpec - see java doc" |
|
339 |
||
340 |
|argSpec spec argNr nm| |
|
154 | 341 |
|
342 |
argNr := 1. |
|
343 |
spec := ''. |
|
344 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
345 |
argSpec := self fieldTypeFromStream:s in:aPackage. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
346 |
|
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
347 |
(argNames notNil |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
348 |
and:[argNames size >= argNr |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
349 |
and:[(nm := argNames at:argNr) notNil]]) ifFalse:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
350 |
nm := 'arg' , argNr printString. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
351 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
352 |
argSpec := argSpec , ' ' , nm. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
353 |
|
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
354 |
spec size ~~ 0 ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
355 |
spec := spec , ', ' |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
356 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
357 |
spec := spec , argSpec. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
358 |
|
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
359 |
argNr := argNr + 1. |
154 | 360 |
]. |
361 |
^ spec |
|
362 |
||
255 | 363 |
"Created: / 8.1.1998 / 19:20:36 / cg" |
364 |
"Modified: / 8.1.1998 / 21:14:33 / cg" |
|
8 | 365 |
! |
366 |
||
142 | 367 |
fieldTypeFromStream:s in:aPackage |
368 |
"parse a fieldTypeSpec - see java doc" |
|
369 |
||
2151 | 370 |
|typeChar typeSym elType size className nm out nangles | |
142 | 371 |
|
372 |
typeChar := s next. |
|
373 |
||
374 |
typeSym := SignatureTypeCodes at:typeChar ifAbsent:#unknown. |
|
375 |
||
376 |
typeSym == #unknown ifTrue:[ |
|
2151 | 377 |
^ typeSym |
142 | 378 |
]. |
2151 | 379 |
(typeSym == #object or: [typeSym == #typevar]) ifTrue:[ |
380 |
"Take care about type variables" |
|
381 |
out := String new writeStream. |
|
382 |
[ s peek ~~ $; and:[ s peek ~~ $< ] ] whileTrue:[ |
|
383 |
out nextPut: s next. |
|
384 |
]. |
|
385 |
className := out contents. |
|
386 |
"Eat possible type variables" |
|
387 |
(s peek == $<) ifTrue:[ |
|
388 |
nangles := 1. s next. |
|
389 |
[ nangles ~~ 0 ] whileTrue:[ |
|
390 |
s peek == $< ifTrue:[nangles := nangles + 1]. |
|
391 |
s peek == $> ifTrue:[nangles := nangles - 1]. |
|
392 |
s next. |
|
393 |
] |
|
394 |
]. |
|
395 |
s peek ~~ $; ifTrue:[self error: 'Signature corrupted?']. |
|
396 |
s next. "/eat ; |
|
397 |
||
398 |
||
399 |
typeSym == #typevar ifTrue:[^className]. |
|
400 |
"/ strip off default |
|
401 |
nm := className. |
|
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
402 |
"/ aPackage notNil ifTrue:[ |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
403 |
"/ (nm startsWith:aPackage) ifTrue:[ |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
404 |
"/ nm := nm copyFrom:(aPackage size + 2). |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
405 |
"/ ]. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
406 |
"/ ]. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
407 |
"/ Show only local name, otherwise names are way too long... |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
408 |
nm := nm copyFrom: (nm lastIndexOf: $/) + 1. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
409 |
|
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
410 |
"/ nm := nm copyReplaceAll:$/ with:$.. |
2151 | 411 |
^ nm |
142 | 412 |
]. |
189 | 413 |
|
142 | 414 |
typeSym == #array ifTrue:[ |
2151 | 415 |
s peek isDigit ifTrue:[ |
416 |
size := Integer readFrom:s. |
|
417 |
elType := self fieldTypeFromStream:s in:aPackage. |
|
418 |
^ elType , '[' , size printString , ']' |
|
419 |
]. |
|
420 |
elType := self fieldTypeFromStream:s in:aPackage. |
|
421 |
^ elType , '[]' |
|
142 | 422 |
]. |
189 | 423 |
|
142 | 424 |
^ typeSym |
425 |
||
2151 | 426 |
"Created: / 18-03-1997 / 11:07:56 / cg" |
427 |
"Modified: / 18-07-1998 / 22:57:06 / cg" |
|
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
428 |
"Modified: / 04-10-2013 / 12:42:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
142 | 429 |
! |
430 |
||
3197
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
431 |
numArgsFromDescriptor:descriptor |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
432 |
"Given a method descriptor, return the number physical of args (number of arg slots)" |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
433 |
|
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
434 |
| i c numArgs | |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
435 |
|
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
436 |
"/ The following code is king of ugly, but it is optimized for speed as |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
437 |
"/ profiling shown that some 10% time was spent in descriptor parsing. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
438 |
"/ Fillowing code is written upon assumption we get a proper method |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
439 |
"/ descriptor (i.e., descriptor, not signature with type parameters). |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
440 |
|
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
441 |
numArgs := 0. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
442 |
i := descriptor indexOf: $(. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
443 |
i ~~ 0 ifTrue:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
444 |
i := i + 1. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
445 |
[ (c := descriptor at: i) ~~ $) ] whileTrue:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
446 |
c == $D ifTrue:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
447 |
numArgs := numArgs + 2. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
448 |
] ifFalse:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
449 |
c == $J ifTrue:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
450 |
numArgs := numArgs + 2. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
451 |
] ifFalse:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
452 |
numArgs := numArgs + 1. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
453 |
c == $[ ifTrue:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
454 |
i := i + 1. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
455 |
[ (c := descriptor at: i) == $[ ] whileTrue:[ i := i + 1 ]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
456 |
]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
457 |
c == $L ifTrue:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
458 |
i := descriptor indexOf: $; startingAt: i + 1. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
459 |
i == 0 ifTrue:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
460 |
self error: 'Invalid descriptor' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
461 |
]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
462 |
]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
463 |
]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
464 |
]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
465 |
i := i + 1. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
466 |
]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
467 |
^ numArgs |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
468 |
]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
469 |
self error: 'Invalid descriptor' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
470 |
|
27 | 471 |
|
472 |
" |
|
3197
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
473 |
JavaMethod numArgsFromDescriptor:'(LObject;)V' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
474 |
JavaMethod numArgsFromDescriptor:'(BB)S' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
475 |
JavaMethod numArgsFromDescriptor:'()V' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
476 |
JavaMethod numArgsFromDescriptor:'(Ljava/util/ArrayList<*>;)V' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
477 |
JavaMethod numArgsFromDescriptor:'(LObject;J)V' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
478 |
JavaMethod numArgsFromDescriptor:'([[LObject;J)V' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
479 |
JavaMethod numArgsFromDescriptor:'([[J)V' |
27 | 480 |
" |
2151 | 481 |
|
3197
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
482 |
"/ Original (slow) code: |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
483 |
"/ | s | |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
484 |
"/ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
485 |
"/ s := descriptor readStream. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
486 |
"/ (descriptor includes:$() ifFalse:[ |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
487 |
"/ self error:'Invalid signature' |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
488 |
"/ ]. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
489 |
"/ [ s next ~~ $( ] whileTrue. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
490 |
"/ ^ self numArgsFromStream:s. |
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
491 |
|
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
492 |
"Modified: / 04-08-2014 / 16:39:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
27 | 493 |
! |
494 |
||
495 |
numArgsFromStream:s |
|
496 |
"parse an argSpec - see java doc" |
|
497 |
||
238 | 498 |
|n t| |
27 | 499 |
|
500 |
n := 0. |
|
501 |
[s atEnd or:[s peek == $)]] whileFalse:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
502 |
t := self fieldTypeFromStream:s in:nil. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
503 |
"/ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
504 |
"/ some args count as 2 |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
505 |
"/ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
506 |
t == #long ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
507 |
n := n + 2. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
508 |
] ifFalse:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
509 |
t == #double ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
510 |
n := n + 2 |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
511 |
] ifFalse:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
512 |
n := n + 1. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
513 |
] |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
514 |
] |
27 | 515 |
]. |
516 |
^ n |
|
517 |
||
255 | 518 |
"Modified: / 8.1.1998 / 19:10:25 / cg" |
29 | 519 |
! |
520 |
||
142 | 521 |
retValSpecFromSignature:aSignature in:aPackage |
522 |
"given a signature, return a spec" |
|
523 |
||
524 |
|s argSpec retvalSpec| |
|
525 |
||
526 |
s := aSignature readStream. |
|
237 | 527 |
s next ~~ $( ifTrue:[self halt]. |
142 | 528 |
|
529 |
argSpec := self argSpecFromStream:s in:aPackage. |
|
530 |
||
237 | 531 |
s next ~~ $) ifTrue:[self halt]. |
142 | 532 |
|
533 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
534 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
535 |
^ retvalSpec |
142 | 536 |
|
537 |
" |
|
538 |
JavaMethod retValSpecFromSignature:'(LObject;)V' |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
539 |
JavaMethod retValSpecFromSignature:'(BB)S' |
142 | 540 |
" |
541 |
||
542 |
"Created: 18.3.1997 / 11:11:50 / cg" |
|
543 |
! |
|
544 |
||
189 | 545 |
returnTypeFromSignature:aSignature in:aPackage |
546 |
"given a signature, return its type as a string" |
|
547 |
||
238 | 548 |
|s c| |
189 | 549 |
|
550 |
s := aSignature readStream. |
|
551 |
(c := s peek) ~~ $( ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
552 |
c == $' ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
553 |
[s peek ~= $'] whileTrue:[s next]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
554 |
s next. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
555 |
^ (self retvalSpecFromStream:s in:aPackage) |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
556 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
557 |
^ (self retvalSpecFromStream:s in:aPackage) |
189 | 558 |
]. |
559 |
||
560 |
s next. |
|
255 | 561 |
self argSpecFromStream:s in:aPackage. |
189 | 562 |
s next ~~ $) ifTrue:[self halt. ^ nil]. |
563 |
||
564 |
^ (self retvalSpecFromStream:s in:aPackage) |
|
565 |
||
566 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
567 |
JavaMethod returnTypeFromSignature:'(LObject;)V' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
568 |
JavaMethod returnTypeFromSignature:'(BB)S' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
569 |
JavaMethod returnTypeFromSignature:'()J' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
570 |
JavaMethod returnTypeFromSignature:'''first''J' |
189 | 571 |
" |
572 |
||
255 | 573 |
"Created: / 1.8.1997 / 10:54:31 / cg" |
574 |
"Modified: / 8.1.1998 / 19:09:06 / cg" |
|
72 | 575 |
! |
576 |
||
577 |
returnsVoidFromSignature:aSignature |
|
578 |
"given a signature, return true if it returns void, false if not" |
|
579 |
||
255 | 580 |
^ (self typeFromSignature:aSignature in:nil) = 'void' |
27 | 581 |
|
582 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
583 |
JavaMethod returnsVoidFromSignature:'(LObject;)V' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
584 |
JavaMethod returnsVoidFromSignature:'(BB)S' |
27 | 585 |
" |
586 |
||
255 | 587 |
"Modified: / 8.1.1998 / 19:13:53 / cg" |
10 | 588 |
! |
589 |
||
142 | 590 |
retvalSpecFromStream:s in:aPackage |
591 |
"parse a retvalSpec - see java doc" |
|
592 |
||
332 | 593 |
|spec| |
594 |
||
142 | 595 |
s atEnd ifTrue:[self halt. ^ #void]. |
596 |
s peek == $V ifTrue:[^ #void]. |
|
332 | 597 |
spec := self fieldTypeFromStream:s in:aPackage. |
598 |
spec knownAsSymbol ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
599 |
^ spec asSymbol |
332 | 600 |
]. |
601 |
^ spec |
|
142 | 602 |
|
332 | 603 |
"Created: / 18.3.1997 / 11:12:19 / cg" |
604 |
"Modified: / 7.4.1998 / 22:28:27 / cg" |
|
142 | 605 |
! |
606 |
||
189 | 607 |
specComponentsWithArgsFromSignature:aSignature withName:name in:aPackage |
608 |
"given a signature, return a spec" |
|
609 |
||
610 |
|s argSpec retvalSpec| |
|
611 |
||
612 |
s := aSignature readStream. |
|
613 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
614 |
||
615 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
616 |
||
617 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
618 |
||
619 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
620 |
||
621 |
^ Array with:retvalSpec with:name with:argSpec |
|
622 |
||
623 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
624 |
JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
625 |
JavaMethod specComponentsWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
189 | 626 |
" |
627 |
||
628 |
"Created: 18.3.1997 / 11:06:22 / cg" |
|
629 |
"Modified: 1.8.1997 / 11:03:50 / cg" |
|
630 |
! |
|
631 |
||
255 | 632 |
specFromSignature:aSignature withName:name argNames:argNames in:aPackage |
10 | 633 |
"given a signature, return a spec" |
634 |
||
635 |
|s argSpec retvalSpec| |
|
636 |
||
637 |
s := aSignature readStream. |
|
638 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
639 |
||
255 | 640 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage argNames:argNames. |
10 | 641 |
|
642 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
643 |
||
255 | 644 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
10 | 645 |
|
646 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
647 |
||
648 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
649 |
JavaMethod specFromSignature:'(LObject;)V' withName:'foo' argNames:#('a') in:nil |
255 | 650 |
JavaMethod specFromSignature:'(BB)S' withName:'foo' argNames:#('a' 'b') in:nil |
10 | 651 |
" |
255 | 652 |
|
653 |
"Created: / 18.3.1997 / 11:06:22 / cg" |
|
654 |
"Modified: / 8.1.1998 / 21:14:43 / cg" |
|
83 | 655 |
! |
656 |
||
142 | 657 |
specFromSignature:aSignature withName:name in:aPackage |
658 |
"given a signature, return a spec" |
|
659 |
||
660 |
|s argSpec retvalSpec| |
|
661 |
||
662 |
s := aSignature readStream. |
|
663 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
664 |
||
665 |
argSpec := self argSpecFromStream:s in:aPackage. |
|
666 |
||
667 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
668 |
||
669 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
670 |
||
671 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
672 |
||
673 |
" |
|
255 | 674 |
JavaMethod specFromSignature:'(LObject;)V' withName:'foo' in:nil |
675 |
JavaMethod specFromSignature:'(BB)S' withName:'foo' in:nil |
|
142 | 676 |
" |
677 |
||
255 | 678 |
"Created: / 18.3.1997 / 11:06:22 / cg" |
679 |
"Modified: / 8.1.1998 / 21:06:32 / cg" |
|
142 | 680 |
! |
681 |
||
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
682 |
specTextFromSignature:aSignature in:aPackage withName:name isConstructor: isCtor |
678 | 683 |
"given a signature, return a spec as boldified text" |
684 |
||
685 |
|s argSpec retvalSpec| |
|
686 |
||
687 |
s := aSignature readStream. |
|
688 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
689 |
||
690 |
argSpec := self argSpecFromStream:s in:aPackage. |
|
691 |
||
692 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
693 |
||
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
694 |
^ isCtor ifTrue:[ |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
695 |
name , ' (' , argSpec , ')' |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
696 |
] ifFalse:[ |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
697 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
698 |
name , ' (' , argSpec , ') : ' , retvalSpec |
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
699 |
] |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
700 |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
701 |
"/ ^ |
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
702 |
|
678 | 703 |
|
704 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
705 |
JavaMethod specTextFromSignature:'(LObject;)V' withName:'foo' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
706 |
JavaMethod specTextFromSignature:'(BB)S' withName:'foo' |
678 | 707 |
" |
708 |
||
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
709 |
"Created: / 04-10-2013 / 12:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
678 | 710 |
! |
711 |
||
175 | 712 |
specTextFromSignature:aSignature withName:name |
713 |
"given a signature, return a spec as boldified text" |
|
714 |
||
715 |
|s argSpec retvalSpec| |
|
716 |
||
717 |
s := aSignature readStream. |
|
718 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
719 |
||
255 | 720 |
argSpec := self argSpecFromStream:s in:nil. |
175 | 721 |
|
722 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
723 |
||
255 | 724 |
retvalSpec := self retvalSpecFromStream:s in:nil. |
175 | 725 |
|
2110
6188ec8713ea
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
2107
diff
changeset
|
726 |
^ retvalSpec , ' ' , (name allBold) , ' (' , argSpec , ')' |
175 | 727 |
|
728 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
729 |
JavaMethod specTextFromSignature:'(LObject;)V' withName:'foo' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
730 |
JavaMethod specTextFromSignature:'(BB)S' withName:'foo' |
175 | 731 |
" |
732 |
||
255 | 733 |
"Modified: / 8.1.1998 / 19:11:20 / cg" |
175 | 734 |
! |
735 |
||
189 | 736 |
specTextWithArgsFromSignature:aSignature withName:name in:aPackage |
737 |
"given a signature, return a spec" |
|
738 |
||
739 |
|s argSpec retvalSpec| |
|
740 |
||
741 |
s := aSignature readStream. |
|
742 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
743 |
||
744 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
745 |
||
746 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
747 |
||
748 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
749 |
||
2110
6188ec8713ea
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
2107
diff
changeset
|
750 |
^ retvalSpec , ' ' , (name allBold) , ' (' , argSpec , ')' |
189 | 751 |
|
752 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
753 |
JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
754 |
JavaMethod specWithArgsFromSignature:'(BB)S' withName:'foo' in:nil |
189 | 755 |
" |
756 |
||
757 |
"Modified: 20.3.1997 / 12:50:10 / cg" |
|
758 |
"Created: 1.8.1997 / 10:43:57 / cg" |
|
759 |
! |
|
760 |
||
154 | 761 |
specWithArgsFromSignature:aSignature withName:name in:aPackage |
762 |
"given a signature, return a spec" |
|
763 |
||
764 |
|s argSpec retvalSpec| |
|
765 |
||
766 |
s := aSignature readStream. |
|
767 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
768 |
||
769 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
770 |
||
771 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
772 |
||
773 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
774 |
||
775 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
776 |
||
777 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
778 |
JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
779 |
JavaMethod specWithArgsFromSignature:'(BB)S' withName:'foo' in:nil |
154 | 780 |
" |
781 |
||
782 |
"Created: 18.3.1997 / 11:06:22 / cg" |
|
783 |
"Modified: 20.3.1997 / 12:50:10 / cg" |
|
784 |
! |
|
785 |
||
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
786 |
specWithArgsFromSignature:aSignature withName:name in:aPackage isConstructor: isCtor |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
787 |
"given a signature, return a spec" |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
788 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
789 |
|s argSpec retvalSpec| |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
790 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
791 |
s := aSignature readStream. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
792 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
793 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
794 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
795 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
796 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
797 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
798 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
799 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
800 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
801 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
802 |
" |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
803 |
JavaMethod specWithArgsFromSignature:'(LObject;)V' withName:'foo' in:nil |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
804 |
JavaMethod specWithArgsFromSignature:'(BB)S' withName:'foo' in:nil |
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
805 |
" |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
806 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
807 |
"Created: / 04-10-2013 / 12:33:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
808 |
! |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
809 |
|
189 | 810 |
typeFromSignature:aSignature in:package |
811 |
"given a signature, return its type as a string" |
|
812 |
||
238 | 813 |
|s c| |
189 | 814 |
|
815 |
s := aSignature readStream. |
|
816 |
(c := s peek) ~~ $( ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
817 |
c == $' ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
818 |
s next. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
819 |
[s peek ~= $'] whileTrue:[s next]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
820 |
s next. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
821 |
^ (self retvalSpecFromStream:s in:package) |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
822 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
823 |
^ (self retvalSpecFromStream:s in:package) |
189 | 824 |
]. |
825 |
||
826 |
s next. |
|
255 | 827 |
self argSpecFromStream:s in:nil. |
189 | 828 |
s next ~~ $) ifTrue:[self halt. ^ nil]. |
829 |
||
830 |
^ (self retvalSpecFromStream:s in:package) |
|
831 |
||
832 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
833 |
JavaMethod typeFromSignature:'(LObject;)Ljava/lang/Object' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
834 |
JavaMethod typeFromSignature:'(LObject;)Ljava/lang/Object' in:'java.lang' |
189 | 835 |
" |
836 |
||
255 | 837 |
"Created: / 1.8.1997 / 10:50:38 / cg" |
838 |
"Modified: / 8.1.1998 / 19:09:31 / cg" |
|
10 | 839 |
! ! |
840 |
||
2151 | 841 |
!JavaMethod methodsFor:'* As yet uncategorized *'! |
842 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
843 |
annotationIndexOf:aSymbol |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
844 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
845 |
^nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
846 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
847 |
"Created: / 24-02-2012 / 16:06:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 848 |
! ! |
849 |
||
3236
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
850 |
!JavaMethod methodsFor:'* uncategorized *'! |
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
851 |
|
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
852 |
annotationAt:aSymbol |
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
853 |
^ nil "/ There are no annotation is Smalltalk sense... |
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
854 |
|
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
855 |
"Created: / 17-08-2014 / 08:34:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
856 |
! ! |
c8b42e8c2d6c
Fix in reloading of a method with method-level breakpoint.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3197
diff
changeset
|
857 |
|
10 | 858 |
!JavaMethod methodsFor:'accessing'! |
859 |
||
334 | 860 |
accessFlags |
861 |
"java calls this the modifiers" |
|
862 |
||
863 |
^ accessFlags |
|
864 |
||
865 |
"Created: / 9.4.1998 / 17:49:44 / cg" |
|
866 |
! |
|
867 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
868 |
analyzer |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
869 |
"Returns an analyzer for the method which can be used |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
870 |
to query some statistics like sent messages or modified classvars" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
871 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
872 |
^ JavaMethodAnalyzer analyze: self. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
873 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
874 |
"Created: / 30-08-2013 / 13:47:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
875 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
876 |
|
2151 | 877 |
annotations |
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
878 |
annotations isNil ifTrue:[ |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
879 |
^ JavaMethodAnnotationContainer empty |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
880 |
]. |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
881 |
^ annotations |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
882 |
|
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
883 |
"Modified: / 04-08-2014 / 16:01:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 884 |
! |
885 |
||
886 |
annotations:something |
|
887 |
annotations := something. |
|
888 |
! |
|
889 |
||
29 | 890 |
argSignature |
2151 | 891 |
^ self class argSigArrayFromSignature:descriptor |
892 |
! |
|
893 |
||
894 |
asByteCodeMethod |
|
895 |
||
896 |
"JavaMethods are always bytecode methods" |
|
897 |
||
898 |
^self |
|
899 |
||
900 |
"Created: / 18-07-2011 / 20:48:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
29 | 901 |
! |
902 |
||
678 | 903 |
comment |
904 |
"should access the source here, and parse any method comment" |
|
905 |
||
906 |
^ nil |
|
907 |
! |
|
908 |
||
10 | 909 |
constantPool |
910 |
^ javaClass constantPool |
|
911 |
||
912 |
"Modified: 16.4.1996 / 12:36:27 / cg" |
|
913 |
"Created: 16.4.1996 / 15:28:50 / cg" |
|
914 |
! |
|
915 |
||
129 | 916 |
containingClass |
917 |
^ javaClass |
|
918 |
||
919 |
! |
|
920 |
||
169 | 921 |
decompiledBytecode |
922 |
|s| |
|
923 |
||
924 |
s := '' writeStream. |
|
925 |
JavaDecompiler decompile:self to:s. |
|
926 |
^ s contents |
|
927 |
||
928 |
"Created: 7.4.1997 / 20:10:37 / cg" |
|
929 |
! |
|
930 |
||
75 | 931 |
decompiledSource |
932 |
|s| |
|
933 |
||
934 |
s := '' writeStream. |
|
175 | 935 |
self decompileSourceTo:s. |
75 | 936 |
^ s contents |
175 | 937 |
|
938 |
"Modified: 30.7.1997 / 16:27:55 / cg" |
|
75 | 939 |
! |
940 |
||
2151 | 941 |
descriptor |
942 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
943 |
^ (JavaDescriptor fromString: descriptor) name: self name |
2151 | 944 |
|
945 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
946 |
"Modified: / 06-12-2011 / 21:53:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
947 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
948 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
949 |
descriptorSymbol |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
950 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
951 |
^descriptor |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
952 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
953 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
954 |
"Created: / 06-12-2011 / 23:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 955 |
! |
956 |
||
957 |
ensureHasAnnotations |
|
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
958 |
annotations isNil ifTrue:[ |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
959 |
annotations := JavaMethodAnnotationContainer for:self |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
960 |
]. |
2151 | 961 |
^ annotations |
962 |
||
963 |
"Created: / 25-02-2011 / 16:02:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
964 |
"Modified: / 28-02-2011 / 16:33:00 / Marcel Hlopko <hlopik@gmail.com>" |
|
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3111
diff
changeset
|
965 |
"Modified: / 04-08-2014 / 15:55:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 966 |
! |
967 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
968 |
exceptionClasses |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
969 |
"Return a collection of declared exception classes that this method |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
970 |
throws" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
971 |
^#() |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
972 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
973 |
"Created: / 01-08-2012 / 10:06:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
974 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
975 |
|
135 | 976 |
exceptionHandlerTable |
378 | 977 |
^ nil |
135 | 978 |
|
378 | 979 |
"Created: / 16.10.1998 / 01:50:51 / cg" |
135 | 980 |
! |
981 |
||
83 | 982 |
exceptionTable |
378 | 983 |
^ nil |
83 | 984 |
|
378 | 985 |
"Created: / 16.10.1998 / 01:51:04 / cg" |
83 | 986 |
! |
987 |
||
2151 | 988 |
firstInstructionLineNumber |
989 |
ForceByteCodeDisplay == true ifTrue:[ ^ 1]. |
|
990 |
lineNumberTable notNil ifTrue:[ ^ lineNumberTable at:2]. |
|
991 |
^ 0. |
|
992 |
||
993 |
"Created: / 17-12-2010 / 17:02:46 / Jan Kurs <kurs.jan@post.cz>" |
|
994 |
"Modified: / 08-01-2011 / 16:30:16 / Jan Kurs <kurs.jan@post.cz>" |
|
995 |
! |
|
996 |
||
997 |
getExceptionTable |
|
998 |
||
999 |
^ nil |
|
1000 |
||
1001 |
"Created: / 04-02-2011 / 23:07:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1002 |
! |
|
1003 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1004 |
getMclass |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1005 |
^javaClass |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1006 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1007 |
"Created: / 15-04-2013 / 17:57:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1008 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1009 |
|
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1010 |
getSource |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1011 |
^ source |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1012 |
|
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1013 |
"Created: / 13-09-2013 / 01:41:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1014 |
! |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1015 |
|
2090 | 1016 |
getSourcePosition |
1017 |
^ 1 |
|
1018 |
! |
|
1019 |
||
90 | 1020 |
hasLineNumberInformation |
1021 |
^ lineNumberTable notNil |
|
1022 |
||
1023 |
"Created: 16.4.1996 / 12:34:04 / cg" |
|
1024 |
"Modified: 16.4.1996 / 12:49:06 / cg" |
|
1025 |
! |
|
1026 |
||
10 | 1027 |
javaByteCode |
184 | 1028 |
"/ ^ javaByteCode |
1029 |
^ byteCode |
|
10 | 1030 |
|
1031 |
"Created: 16.4.1996 / 14:55:44 / cg" |
|
184 | 1032 |
"Modified: 1.8.1997 / 00:08:45 / cg" |
8 | 1033 |
! |
1034 |
||
27 | 1035 |
javaClass |
1036 |
^ javaClass |
|
1037 |
||
1038 |
"Modified: 16.4.1996 / 12:36:27 / cg" |
|
1039 |
"Created: 16.4.1996 / 14:55:44 / cg" |
|
1040 |
! |
|
1041 |
||
2151 | 1042 |
javaExceptionTable |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1043 |
<resource: #obsolete> |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1044 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1045 |
self obsoleteMethodWarning: 'Use #exceptionClasses instead'. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1046 |
^ self exceptionClasses |
2151 | 1047 |
|
1048 |
"Created: / 04-06-2011 / 18:16:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1049 |
"Modified: / 01-08-2012 / 10:08:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 1050 |
! |
1051 |
||
1052 |
javaNumArgs |
|
3532
a12a5c66a9e5
JavaByteCodeInterpreter: Few fixes to make most tests pass
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3508
diff
changeset
|
1053 |
^ self argSignature size. |
2151 | 1054 |
|
1055 |
"Created: / 14-03-2011 / 15:50:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
3532
a12a5c66a9e5
JavaByteCodeInterpreter: Few fixes to make most tests pass
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3508
diff
changeset
|
1056 |
"Modified (format): / 02-03-2016 / 00:20:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 1057 |
! |
1058 |
||
90 | 1059 |
lineNumber |
2888
5b492b74975f
Bugfix in JavaMethod>>lineNumber (missing return)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2870
diff
changeset
|
1060 |
^ self sourceLineNumber. |
2717
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1061 |
|
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1062 |
"Created: / 16-04-1996 / 12:34:04 / cg" |
2888
5b492b74975f
Bugfix in JavaMethod>>lineNumber (missing return)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2870
diff
changeset
|
1063 |
"Modified: / 23-10-2013 / 10:48:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
90 | 1064 |
! |
1065 |
||
50 | 1066 |
lineNumberTable |
2151 | 1067 |
"/ lineNumberTable ifNil:[ lineNumberTable := Dictionary new.]. |
50 | 1068 |
^ lineNumberTable |
1069 |
||
2151 | 1070 |
"Created: / 16-04-1996 / 12:34:04 / cg" |
1071 |
"Modified: / 13-12-2010 / 11:06:40 / Jan Kurs <kurs.jan@post.cz>" |
|
50 | 1072 |
! |
1073 |
||
3605
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1074 |
literalAt:index ifAbsent:exceptionalValue |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1075 |
"return a literal element" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1076 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1077 |
"/ JVM does not use per-method literal frame like Smalltalk. |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1078 |
"/ Therefore, #literalAt:ifAbsent: has now meaning and is not supported |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1079 |
self shouldNotImplement |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1080 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1081 |
"Created: / 29-07-2016 / 09:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1082 |
! |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1083 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1084 |
literalAt:index put:newValue |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1085 |
"change a literal slots value. |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1086 |
WARNING: dangerous internal interface; only for knowledgable users" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1087 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1088 |
"/ JVM does not use per-method literal frame like Smalltalk. |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1089 |
"/ Therefore, #literalAt:put: has now meaning and is not supported |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1090 |
self shouldNotImplement |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1091 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1092 |
"Created: / 29-07-2016 / 09:46:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1093 |
! |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1094 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1095 |
literals |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1096 |
"return the literals as an array" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1097 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1098 |
^ Array streamContents: [ :s | self literalsDo:[:e | s nextPut: e] ] |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1099 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1100 |
"Created: / 29-07-2016 / 09:46:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1101 |
! |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1102 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1103 |
literalsDo:aBlock |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1104 |
"execute a one arg block for each of our literals" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1105 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1106 |
self analyzer literalsDo: aBlock |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1107 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
1108 |
"Created: / 29-07-2016 / 09:41:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
618 | 1109 |
! |
1110 |
||
85 | 1111 |
localVariableTable |
1112 |
^ localVariableTable |
|
1113 |
||
1114 |
" |
|
1115 |
JavaMethod allInstancesDo:[:m| m localVariableTable notNil ifTrue:[self halt]] |
|
1116 |
" |
|
1117 |
! |
|
1118 |
||
2151 | 1119 |
mclass |
1120 |
^ self javaClass |
|
1121 |
! |
|
1122 |
||
1123 |
mclass: anObject |
|
1124 |
||
1125 |
javaClass := anObject |
|
1126 |
||
1127 |
"Created: / 18-10-2010 / 19:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1128 |
! |
|
1129 |
||
2086 | 1130 |
methodArgAndVarNames |
2151 | 1131 |
^ "((1 to:self numArgs) collect:[:i | 'arg' , i printString])" |
1132 |
self methodArgNames |
|
2086 | 1133 |
, |
2151 | 1134 |
"((1 to:self numVars) collect:[:i | 'local' , i printString])" |
1135 |
self methodVarNames |
|
1136 |
||
1137 |
"Modified: / 23-11-2010 / 19:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
31 | 1138 |
! |
1139 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1140 |
methodArgAndVarNamesInContext: context |
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1141 |
| pc stop | |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1142 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1143 |
self isNative ifTrue:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1144 |
^ self methodArgNames |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1145 |
]. |
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1146 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1147 |
context isJavaContext ifTrue:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1148 |
pc := context pc. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1149 |
] ifFalse:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1150 |
"/ It may happen that the context for Java method is not |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1151 |
"/ a JavaContext. This is true for some code-saver functions |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1152 |
"/ such as __retInst1(), __retSelf1() and so on. In that case, |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1153 |
"/ method sould be simple enough to have no nested scopes |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1154 |
"/ or local variables. Forcing pc := 0 therefore works fine |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1155 |
pc := 0. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1156 |
]. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1157 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1158 |
localVariableTable isNil ifTrue:[^self methodArgNames , self methodVarNames ]. |
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1159 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1160 |
stop := context arg1Index - 1 + self numArgs + self numVars. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1161 |
stop := stop min: context size. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1162 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1163 |
^(1 to: stop) collect:[:i| |
2814
342fbc21cc23
Small fix in JavaMethod>>argAndVarNamesInContext:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2791
diff
changeset
|
1164 |
(localVariableTable nameForSlot: i - 1 atPC: pc) ? '<inaccessible>'. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1165 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1166 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1167 |
"Created: / 18-12-2012 / 18:17:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1168 |
"Modified: / 05-11-2013 / 17:28:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1169 |
! |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1170 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1171 |
methodArgAndVarValuesInContext: context |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1172 |
| pc stop | |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1173 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1174 |
localVariableTable isNil ifTrue:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1175 |
| values | |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1176 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1177 |
values := Array new: context size. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1178 |
values replaceFrom: 1 count: context size with: context startingAt: 1. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1179 |
^ values. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1180 |
]. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1181 |
context isJavaContext ifTrue:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1182 |
pc := context pc. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1183 |
] ifFalse:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1184 |
"/ It may happen that the context for Java method is not |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1185 |
"/ a JavaContext. This is true for some code-saver functions |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1186 |
"/ such as __retInst1(), __retSelf1() and so on. In that case, |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1187 |
"/ method sould be simple enough to have no nested scopes |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1188 |
"/ or local variables. Forcing pc := 0 therefore works fine |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1189 |
pc := 0. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1190 |
]. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1191 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1192 |
stop := context arg1Index - 1 + self numArgs + self numVars. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1193 |
stop := stop min: context size. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1194 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1195 |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1196 |
^(1 to: stop) collect:[:i| |
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1197 |
(localVariableTable nameForSlot: i - 1 atPC: pc) notNil ifTrue:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1198 |
context at: i |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1199 |
] ifFalse:[ |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1200 |
nil |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1201 |
]. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1202 |
]. |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1203 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1204 |
"Created: / 04-11-2013 / 18:53:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
1205 |
"Modified: / 05-11-2013 / 17:28:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1206 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1207 |
|
31 | 1208 |
methodArgNames |
3083 | 1209 |
|nA "{ Class: SmallInteger }" isStatic| |
1210 |
||
1211 |
isStatic := self isStatic. |
|
252 | 1212 |
nA := self numArgs. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1213 |
^ 1 to:nA collect: [:argIndex | |
3083 | 1214 |
|slot name| |
1215 |
||
1216 |
"/ search for an entry with that index (slot), |
|
1217 |
"/ which has is valid at PC 0 |
|
1218 |
||
1219 |
localVariableTable notNil ifTrue:[ |
|
1220 |
isStatic ifTrue:[ |
|
2151 | 1221 |
slot := argIndex - 1 |
1222 |
] ifFalse:[ |
|
1223 |
slot := argIndex "/+ 1 |
|
1224 |
]. |
|
1225 |
name := localVariableTable nameForSlot:slot atPC:0. |
|
3083 | 1226 |
]. |
1227 |
name isNil ifTrue:[ |
|
1228 |
name := 'arg' , argIndex printString |
|
1229 |
]. |
|
1230 |
name |
|
102 | 1231 |
]. |
2151 | 1232 |
|
1233 |
"Modified: / 23-11-2010 / 19:47:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1234 |
! |
|
1235 |
||
1236 |
methodVarNames |
|
1237 |
|nV| |
|
1238 |
||
1239 |
nV := self numVars. |
|
1240 |
localVariableTable notNil ifTrue:[ |
|
1241 |
^ (self numArgs + 1 to: self numArgs + nV) collect: |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1242 |
[:argIndex | |
2151 | 1243 |
|slot name| |
1244 |
"/ search for an entry with that index (slot), |
|
1245 |
"/ which has is valid at PC 0 |
|
1246 |
||
1247 |
self isStatic ifTrue:[ |
|
1248 |
slot := argIndex - 1 |
|
1249 |
] ifFalse:[ |
|
1250 |
slot := argIndex"/ + 1 |
|
1251 |
]. |
|
1252 |
name := localVariableTable nameForSlot:slot atPC:0. |
|
1253 |
name isNil ifTrue:[ |
|
1254 |
'local' , argIndex printString |
|
1255 |
] ifFalse:[ |
|
1256 |
name |
|
1257 |
]. |
|
1258 |
] |
|
1259 |
]. |
|
1260 |
^ (1 to:nV) collect:[:i | 'local' , i printString] |
|
1261 |
||
1262 |
"Created: / 23-11-2010 / 19:28:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
31 | 1263 |
! |
1264 |
||
29 | 1265 |
name |
2555
655f39b36a10
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
2551
diff
changeset
|
1266 |
^ (selector copyButLast:descriptor size) asSymbol |
29 | 1267 |
|
1268 |
"Created: 16.4.1996 / 11:34:22 / cg" |
|
1269 |
! |
|
1270 |
||
2151 | 1271 |
nameSpaceName |
1272 |
||
1273 |
^'' |
|
1274 |
||
1275 |
"Created: / 18-10-2010 / 19:10:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1276 |
! |
|
1277 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1278 |
numJArgs |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1279 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1280 |
^self numberOfJavaArgs |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1281 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1282 |
"Created: / 25-10-2011 / 10:50:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1283 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1284 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1285 |
numJavaArgs |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1286 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1287 |
^self numberOfJavaArgs |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1288 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1289 |
"Created: / 25-10-2011 / 10:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
118 | 1290 |
! |
1291 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1292 |
numberOfJavaArgs |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1293 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1294 |
^(accessFlags bitAnd: 16r00FF0000) rightShift: 16. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1295 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1296 |
"Created: / 25-10-2011 / 10:45:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1297 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1298 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1299 |
numberOfJavaArgs: nArgs |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1300 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1301 |
( nArgs > 16rFF ) ifTrue:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1302 |
ArgumentError raiseRequestWith:self errorString:'too many args method - ', nArgs printString. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1303 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1304 |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1305 |
accessFlags := accessFlags bitOr: |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1306 |
((nArgs bitAnd: 16rFF) bitShift: 16) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1307 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1308 |
"Created: / 25-10-2011 / 10:43:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
27 | 1309 |
! |
1310 |
||
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1311 |
originalMethodIfWrapped |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1312 |
"return the method the receiver is wrapping - none here" |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1313 |
|
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1314 |
^ self |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1315 |
|
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1316 |
"Created: / 22-10-2010 / 11:46:07 / cg" |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1317 |
! |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1318 |
|
175 | 1319 |
previousVersion |
1320 |
^ nil |
|
1321 |
||
1322 |
"Created: 30.7.1997 / 15:56:18 / cg" |
|
1323 |
! |
|
1324 |
||
2151 | 1325 |
previousVersionCode |
1326 |
||
1327 |
^nil |
|
1328 |
||
1329 |
"Created: / 18-10-2010 / 20:15:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1330 |
! |
|
1331 |
||
29 | 1332 |
retValSignature |
2151 | 1333 |
^ self class retValSpecFromSignature:descriptor in:nil |
29 | 1334 |
|
255 | 1335 |
"Modified: / 8.1.1998 / 19:06:40 / cg" |
29 | 1336 |
! |
1337 |
||
123 | 1338 |
returnType |
378 | 1339 |
"/ ^ returnType |
2151 | 1340 |
^ self class typeFromSignature:descriptor in:nil. |
378 | 1341 |
|
1342 |
"Modified: / 16.10.1998 / 00:17:43 / cg" |
|
123 | 1343 |
! |
1344 |
||
322 | 1345 |
returnTypeClass |
378 | 1346 |
|cls returnType| |
322 | 1347 |
|
378 | 1348 |
(returnType := self returnType) isNil ifTrue:[ |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1349 |
self halt. |
322 | 1350 |
]. |
1351 |
cls := Java at:returnType. |
|
1352 |
cls notNil ifTrue:[^ cls]. |
|
1353 |
||
1354 |
returnType == #void ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1355 |
^ nil |
322 | 1356 |
]. |
1357 |
returnType == #double ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1358 |
'warning: no returnTypeClass for double' printCR. |
334 | 1359 |
"/ self halt:'no returnTypeClass for double'. |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1360 |
^ nil |
322 | 1361 |
]. |
1362 |
returnType == #float ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1363 |
'warning: no returnTypeClass for float' printCR. |
334 | 1364 |
"/ self halt:'no returnTypeClass for float'. |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1365 |
^ nil |
322 | 1366 |
]. |
1367 |
returnType == #long ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1368 |
'warning: no returnTypeClass for long' printCR. |
334 | 1369 |
"/ self halt:'no returnTypeClass for long'. |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1370 |
^ nil |
334 | 1371 |
]. |
1372 |
returnType == #int ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1373 |
'warning: no returnTypeClass for int' printCR. |
334 | 1374 |
"/ self halt:'no returnTypeClass for int'. |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1375 |
^ nil |
334 | 1376 |
]. |
1377 |
returnType == #boolean ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1378 |
'warning: no returnTypeClass for boolean' printCR. |
334 | 1379 |
"/ self halt:'no returnTypeClass for boolean'. |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1380 |
^ nil |
322 | 1381 |
]. |
1382 |
self halt. |
|
1383 |
^ nil |
|
1384 |
||
1385 |
"Created: / 13.2.1998 / 15:08:26 / cg" |
|
378 | 1386 |
"Modified: / 16.10.1998 / 00:16:07 / cg" |
322 | 1387 |
! |
1388 |
||
116 | 1389 |
returnsDouble |
378 | 1390 |
^ self returnType == #double |
1391 |
||
1392 |
"Modified: / 16.10.1998 / 00:18:24 / cg" |
|
116 | 1393 |
! |
1394 |
||
72 | 1395 |
returnsLong |
378 | 1396 |
^ self returnType == #long |
1397 |
||
1398 |
"Modified: / 16.10.1998 / 00:18:41 / cg" |
|
72 | 1399 |
! |
1400 |
||
27 | 1401 |
returnsVoid |
378 | 1402 |
^ self returnType == #void |
1403 |
||
2151 | 1404 |
"Modified: / 16-10-1998 / 00:18:53 / cg" |
1405 |
"Modified: / 22-03-2011 / 12:27:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
27 | 1406 |
! |
1407 |
||
255 | 1408 |
selector |
378 | 1409 |
"/ could theoretically be extracted from my classes |
1410 |
"/ methodDictionary via: |
|
1411 |
"/ ^ javaClass methodDictionary keyAtValue:self ifAbsent:nil. |
|
1412 |
||
255 | 1413 |
^ selector |
1414 |
||
1415 |
"Created: / 7.1.1998 / 14:05:11 / cg" |
|
378 | 1416 |
"Modified: / 16.10.1998 / 13:41:06 / cg" |
255 | 1417 |
! |
1418 |
||
27 | 1419 |
signature |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1420 |
^ signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1421 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1422 |
"Modified: / 04-12-2011 / 19:39:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
31 | 1423 |
! |
1424 |
||
1425 |
source |
|
2716
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1426 |
| sourceString | |
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1427 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1428 |
(self isSynthetic or:[ForceByteCodeDisplay == true]) ifTrue:[ |
2151 | 1429 |
^ self decompiledBytecode |
169 | 1430 |
]. |
2716
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1431 |
|
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1432 |
sourceString := javaClass source. |
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1433 |
sourceString isNil ifTrue:[ |
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1434 |
^ self decompiledSource. |
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1435 |
]. |
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1436 |
ShowFullSource ifTrue:[ ^ sourceString ]. |
2725
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1437 |
source notNil ifTrue:[ |
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1438 |
^ source readFrom: sourceString. |
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1439 |
]. |
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1440 |
|
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1441 |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1442 |
"/ stx:libjava/tools may not be loaded... |
2725
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1443 |
JavaSourceDocument notNil ifTrue:[ |
2716
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1444 |
"/ As a side effect, this fills in source references for all methods. |
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1445 |
"/ see JavaSourceDocument |
2720
d55ab9c66bb3
Bugfix in JavaMethod>>source - wait until the source file is scanned for source positions...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2717
diff
changeset
|
1446 |
| document | |
d55ab9c66bb3
Bugfix in JavaMethod>>source - wait until the source file is scanned for source positions...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2717
diff
changeset
|
1447 |
|
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1448 |
((document := self sourceDocument) notNil and:[document sourceTreeOrNilIfParsing notNil]) ifTrue:[ |
2725
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1449 |
^ source readFrom: sourceString. |
2716
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1450 |
] |
2725
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1451 |
]. |
258b8c6de530
STC bug workaround in JavaMethod>>source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2722
diff
changeset
|
1452 |
^ sourceString |
169 | 1453 |
|
2151 | 1454 |
"Modified: / 04-01-1998 / 13:48:35 / cg" |
1455 |
"Modified: / 13-12-2010 / 11:06:51 / Jan Kurs <kurs.jan@post.cz>" |
|
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1456 |
"Modified: / 14-09-2013 / 12:01:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2717
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1457 |
! |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1458 |
|
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1459 |
sourceDocument |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1460 |
| doc | |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1461 |
"/ stx:libjava/tools may not be loaded... |
2717
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1462 |
JavaSourceDocument notNil ifTrue:[ |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1463 |
doc := JavaSourceDocument cachedDocumentFor: javaClass. |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1464 |
doc isNil ifTrue:[ |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1465 |
doc := JavaSourceDocument for: javaClass. |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1466 |
JavaSourceDocument cachedDocumentFor: javaClass put: doc. |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1467 |
]. |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1468 |
^ doc |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1469 |
] |
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1470 |
|
16564a7101b8
Initial support for displaying only selected method's source in browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2716
diff
changeset
|
1471 |
"Created: / 07-09-2013 / 02:29:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
31 | 1472 |
! |
1473 |
||
1474 |
sourceFilename |
|
1475 |
^ javaClass sourceFile |
|
175 | 1476 |
! |
1477 |
||
1478 |
sourceLineNumber |
|
2722
1527fdb0c92f
Return line number withing method source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2720
diff
changeset
|
1479 |
"Return the line number of method declaration |
1527fdb0c92f
Return line number withing method source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2720
diff
changeset
|
1480 |
withing method's source" |
1527fdb0c92f
Return line number withing method source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2720
diff
changeset
|
1481 |
|
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1482 |
^ ShowFullSource ifFalse:[ |
2722
1527fdb0c92f
Return line number withing method source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2720
diff
changeset
|
1483 |
"Showing only method's source..." |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1484 |
source notNil |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1485 |
ifTrue:[source line0 - source lineH + 1] |
2722
1527fdb0c92f
Return line number withing method source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2720
diff
changeset
|
1486 |
ifFalse:[1]. |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1487 |
] ifTrue:[ |
2722
1527fdb0c92f
Return line number withing method source.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2720
diff
changeset
|
1488 |
"Showing full source..." |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1489 |
source notNil ifTrue:[ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1490 |
source lineH |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1491 |
] ifFalse:[ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1492 |
self firstInstructionLineNumber - 2. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1493 |
] |
2151 | 1494 |
]. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1495 |
|
2151 | 1496 |
"Created: / 30-07-1997 / 15:40:45 / cg" |
1497 |
"Modified: / 13-12-2010 / 23:46:30 / Marcel Hlopko <hlopik@gmail.com>" |
|
1498 |
"Modified: / 08-01-2011 / 16:20:40 / Jan Kurs <kurs.jan@post.cz>" |
|
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
1499 |
"Modified: / 11-09-2013 / 03:24:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 1500 |
! |
1501 |
||
1502 |
wrapper |
|
1503 |
||
1504 |
^nil |
|
1505 |
||
1506 |
"Created: / 18-10-2010 / 19:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1507 |
! ! |
|
1508 |
||
1509 |
!JavaMethod methodsFor:'compiler interface'! |
|
1510 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1511 |
flushCode |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1512 |
"Flushes jitted code, effectively cause a recompile" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1513 |
self code: nil. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1514 |
ObjectMemory flushCachesForSelector: selector. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1515 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1516 |
"Created: / 15-10-2012 / 21:03:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1517 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1518 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1519 |
mcompile |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1520 |
"__mcompile(OBJ aMethod, unsigned char *bytecode, int nBytes, int nArgs, OBJ receiver, OBJ selector, OBJ srchClass, OBJ *pArgsOrNull)" |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1521 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1522 |
| bytecode nBytes nArgs receiver mySelector srchClass pArgsOrNull retVal | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1523 |
bytecode := self byteCode. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1524 |
nBytes := self byteCode size. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1525 |
nArgs := self numArgs. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1526 |
receiver := nil. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1527 |
mySelector := self selector. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1528 |
srchClass := self mclass. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1529 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1530 |
%{ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1531 |
retVal = __mcompile(self, __ByteArrayInstPtr(bytecode), __intVal(nBytes), __intVal(nArgs), receiver, mySelector, srchClass, pArgsOrNull); |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1532 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1533 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1534 |
%}. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1535 |
self halt. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1536 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1537 |
"Created: / 24-02-2012 / 11:39:13 / m" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1538 |
"Modified: / 24-02-2012 / 14:00:04 / Marcel Hlopko <hlopik@gmail.com>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1539 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1540 |
|
2151 | 1541 |
programmingLanguage |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1542 |
"Returns a programming language of the method" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1543 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1544 |
"Do not return JavaLanguage unconditionally here. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1545 |
Consider another JVM-based languages (such as Groovy)" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1546 |
^javaClass programmingLanguage |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1547 |
|
2151 | 1548 |
"Created: / 26-10-2010 / 23:42:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1549 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1550 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1551 |
updateFrom: anotherMethod |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1552 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1553 |
self class allInstVarNames keysAndValuesDo:[:index :name| |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1554 |
(#(#'code*' #'javaClass') includes: name) ifFalse:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1555 |
self instVarAt: index put: (anotherMethod instVarAt: index) |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1556 |
] |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1557 |
] |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1558 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
1559 |
"Created: / 19-04-2013 / 00:08:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8 | 1560 |
! ! |
1561 |
||
255 | 1562 |
!JavaMethod methodsFor:'debugging'! |
1563 |
||
1564 |
breakPoint |
|
3466
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1565 |
|
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1566 |
<resource: #skipInDebuggersWalkBack> |
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1567 |
|
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1568 |
BreakPointInterrupt |
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1569 |
raiseRequestWith: self |
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1570 |
errorString:('Breakpoint encountered') |
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1571 |
|
255 | 1572 |
|
1573 |
"Modified: / 9.1.1998 / 23:01:17 / cg" |
|
3466
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1574 |
"Modified: / 29-06-2015 / 16:00:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5c317b796c61
Fix in JavaMethod>>breakPoint - signal BreakPointInterrupt rather than open debugger directly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3419
diff
changeset
|
1575 |
|
255 | 1576 |
! |
1577 |
||
1578 |
clearBreakPoint |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1579 |
| clsInEvent | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1580 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1581 |
accessFlags := (accessFlags bitClear:A_BREAKPOINT). |
449 | 1582 |
self hasCode ifTrue:[ |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1583 |
MessageTracer unwrapMethod:self |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1584 |
] ifFalse:[ |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1585 |
clsInEvent := self isStatic |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1586 |
ifTrue:[ javaClass theMetaclass ] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1587 |
ifFalse:[ javaClass ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1588 |
Smalltalk changed:#methodTrap with:{ clsInEvent . selector } |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1589 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1590 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1591 |
"Modified: / 13-11-1998 / 23:31:00 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1592 |
"Modified: / 30-05-2012 / 19:31:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
255 | 1593 |
! |
1594 |
||
257 | 1595 |
isCounting |
1596 |
^ false. |
|
1597 |
||
1598 |
"Created: / 12.1.1998 / 20:02:23 / cg" |
|
1599 |
! |
|
1600 |
||
1601 |
isCountingMemoryUsage |
|
1602 |
^ false. |
|
1603 |
||
1604 |
"Created: / 12.1.1998 / 20:03:22 / cg" |
|
1605 |
! |
|
1606 |
||
255 | 1607 |
setBreakPoint |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1608 |
| clsInEvent | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1609 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1610 |
accessFlags := (accessFlags bitOr:A_BREAKPOINT). |
449 | 1611 |
self hasCode ifTrue:[ |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1612 |
MessageTracer trapMethod:self |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1613 |
] ifFalse:[ |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1614 |
clsInEvent := self isStatic |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1615 |
ifTrue:[ javaClass theMetaclass ] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1616 |
ifFalse:[ javaClass ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1617 |
Smalltalk changed:#methodTrap with:{ clsInEvent . selector } |
449 | 1618 |
]. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1619 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1620 |
"Modified: / 13-11-1998 / 23:30:45 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1621 |
"Modified: / 30-05-2012 / 19:30:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
255 | 1622 |
! ! |
1623 |
||
18 | 1624 |
!JavaMethod methodsFor:'decompiling'! |
1625 |
||
175 | 1626 |
decompileSourceTo:aStream |
637 | 1627 |
|argNames| |
1628 |
||
1629 |
byteCode isNil ifTrue:[ |
|
1630 |
self isPublic ifTrue:[ |
|
1631 |
aStream nextPutAll:'public '. |
|
1632 |
]. |
|
1633 |
self isProtected ifTrue:[ |
|
1634 |
aStream nextPutAll:'protected '. |
|
1635 |
]. |
|
1636 |
self isPrivate ifTrue:[ |
|
1637 |
aStream nextPutAll:'private '. |
|
1638 |
]. |
|
1639 |
self isStatic ifTrue:[ |
|
1640 |
aStream nextPutAll:'static '. |
|
1641 |
]. |
|
1642 |
||
1643 |
self isNative ifTrue:[ |
|
1644 |
aStream nextPutAll:'native '. |
|
1645 |
]. |
|
1646 |
self isAbstract ifTrue:[ |
|
1647 |
aStream nextPutAll:'abstract '. |
|
1648 |
]. |
|
1649 |
argNames := #('arg1' 'arg2' 'arg3' 'arg4' 'arg5' 'arg6' 'arg7' 'arg8' 'arg9'). |
|
1650 |
aStream nextPutAll:(self signatureNameWithArgNames:argNames). |
|
1651 |
aStream nextPutAll:';'; cr. |
|
1652 |
^ self |
|
1653 |
]. |
|
1654 |
||
2151 | 1655 |
" |
637 | 1656 |
JavaDeparser isNil ifTrue:[ |
1657 |
aStream nextPutAll:'// Sorry - no decompiler'. |
|
1658 |
^ self |
|
1659 |
]. |
|
2151 | 1660 |
" |
637 | 1661 |
|
1662 |
||
252 | 1663 |
"/ self isNative ifFalse:[ |
1664 |
"/ self isAbstract ifFalse:[ |
|
2151 | 1665 |
aStream nextPutAll:'// source not available...'; cr. |
637 | 1666 |
SignalSet anySignal handle:[:ex | |
2551 | 1667 |
ex creator == Object haltSignal ifTrue:[ex reject]. |
1668 |
ex creator == MessageTracer breakpointSignal ifTrue:[ex reject]. |
|
1669 |
ex creator == Signal noHandlerSignal ifTrue:[ex reject]. |
|
506 | 1670 |
|
637 | 1671 |
aStream nextPutAll:'error while decompiling:'. |
1672 |
aStream cr; cr; spaces:4. |
|
1673 |
aStream nextPutAll:ex errorString. |
|
1674 |
aStream cr. |
|
1675 |
aStream nextPutAll:ex suspendedContext printString. |
|
1676 |
aStream cr. |
|
1677 |
aStream nextPutAll:ex suspendedContext sender printString. |
|
1678 |
aStream cr. |
|
1679 |
aStream nextPutAll:ex suspendedContext sender sender printString. |
|
1680 |
aStream cr. |
|
1681 |
aStream nextPutAll:ex suspendedContext sender sender sender printString. |
|
1682 |
aStream cr. |
|
1683 |
aStream nextPutAll:ex suspendedContext sender sender sender sender printString. |
|
1684 |
aStream cr. |
|
1685 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender printString. |
|
1686 |
aStream cr. |
|
2095 | 1687 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender sender printString. |
1688 |
aStream cr. |
|
1689 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender sender sender printString. |
|
1690 |
aStream cr. |
|
1691 |
aStream nextPutAll:ex suspendedContext sender sender sender sender sender sender sender sender printString. |
|
1692 |
aStream cr. |
|
506 | 1693 |
|
2151 | 1694 |
" |
1695 |
JavaByteCodeDisassembler isNil ifTrue:[ |
|
637 | 1696 |
aStream nextPutAll:'// Sorry - no decompiler' |
1697 |
] ifFalse:[ |
|
2151 | 1698 |
JavaByteCodeDisassembler diassemble:self to:aStream. |
637 | 1699 |
]. |
2151 | 1700 |
" |
637 | 1701 |
ex return |
1702 |
] do:[ |
|
2151 | 1703 |
"aStream nextPutAll:(JavaDeparser decompile:self)." |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1704 |
JavaByteCodeDisassembler diassemble:self to:aStream. |
637 | 1705 |
]. |
252 | 1706 |
"/ ]. |
1707 |
"/ ]. |
|
18 | 1708 |
|
2151 | 1709 |
"Created: / 30-07-1997 / 16:28:09 / cg" |
1710 |
"Modified: / 21-12-1999 / 14:31:54 / cg" |
|
1711 |
"Modified: / 22-03-2011 / 21:34:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
175 | 1712 |
! |
1713 |
||
1714 |
decompiler |
|
1715 |
^ JavaDecompiler |
|
1716 |
||
1717 |
"Created: 30.7.1997 / 16:36:48 / cg" |
|
261 | 1718 |
! |
1719 |
||
449 | 1720 |
isMethod |
1721 |
"return true, if the receiver is some kind of method; |
|
1722 |
true returned here - the method is redefined from Object." |
|
1723 |
||
1724 |
^ true |
|
1725 |
||
1726 |
"Created: / 13.11.1998 / 23:57:40 / cg" |
|
1727 |
! |
|
1728 |
||
261 | 1729 |
originalMethod |
1730 |
^ self |
|
1731 |
||
1732 |
"Created: / 13.1.1998 / 15:03:05 / cg" |
|
18 | 1733 |
! ! |
1734 |
||
277 | 1735 |
!JavaMethod methodsFor:'error handling'! |
1736 |
||
1737 |
invalidByteCode |
|
3786
5955382113e0
Cleanup: removed bunch of unused error handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3605
diff
changeset
|
1738 |
"This error is triggered when the interpreter tries to execute a |
5955382113e0
Cleanup: removed bunch of unused error handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3605
diff
changeset
|
1739 |
code object, where the byteCode is nonNil, but not a ByteArray. |
5955382113e0
Cleanup: removed bunch of unused error handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3605
diff
changeset
|
1740 |
Can only happen when Compiler/runtime system is broken or |
5955382113e0
Cleanup: removed bunch of unused error handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3605
diff
changeset
|
1741 |
someone played around with a blocks/methods code." |
5955382113e0
Cleanup: removed bunch of unused error handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3605
diff
changeset
|
1742 |
|
277 | 1743 |
self isAbstract ifTrue:[ |
3555
47da2d42a016
JavaLookup: Fixed JVM lookup to search interfaces as defined in JVM Spec
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3537
diff
changeset
|
1744 |
JavaVM throwExceptionClassName: 'java.lang.AbstractMethodError' withMessage: ('trying to execute abstract method %1#%2' bindWith: javaClass javaName with: selector). |
277 | 1745 |
]. |
1746 |
^ super invalidByteCode |
|
1747 |
||
2151 | 1748 |
"Created: / 27-01-1998 / 21:48:01 / cg" |
3786
5955382113e0
Cleanup: removed bunch of unused error handling methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3605
diff
changeset
|
1749 |
"Modified: / 25-10-2017 / 23:12:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1750 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1751 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1752 |
wrongNumberOfArguments:numArgsGiven |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1753 |
"{ Pragma: +optSpace }" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1754 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1755 |
"this error is triggered by the VM, if a method is called with a wrong number |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1756 |
of arguments. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1757 |
This only applies to #valueWithReceiverXXX and #perform:withArguments: - sends. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1758 |
With a normal send, this error cannot happen." |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1759 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1760 |
^ JavaVM |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1761 |
throwIllegalArgumentException:(' - %1 got %2 arg(s) where %3 expected' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1762 |
bindWith:self class name |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1763 |
with:numArgsGiven |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1764 |
with:self numArgs) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1765 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1766 |
" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1767 |
2 perform:#+ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1768 |
" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1769 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1770 |
"Modified: / 01-08-1997 / 00:23:10 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1771 |
"Created: / 07-09-2011 / 14:17:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1772 |
! ! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1773 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1774 |
!JavaMethod methodsFor:'executing'! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1775 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1776 |
valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass sender:virtualSender |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1777 |
self isStatic ifTrue:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1778 |
anObject == javaClass ifFalse:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1779 |
self error: 'Invalid receiver - only owning class can be a receiver of static method invocation!!' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1780 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1781 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1782 |
^super valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass sender:virtualSender |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1783 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1784 |
"Created: / 31-10-2012 / 23:09:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
277 | 1785 |
! ! |
1786 |
||
2151 | 1787 |
!JavaMethod methodsFor:'initialization'! |
1788 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1789 |
resolve |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1790 |
"Called by VM to resolve all references used by this method. When |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1791 |
successful (i.e., all references has been successfully resolved, a |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1792 |
A_RESOLVED flag is set (to prevent VM from subsequent calls |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1793 |
to this method) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1794 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1795 |
Returns 1 if successfull, 0 if not (at least one reference |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1796 |
could not been resolved) or -1 when some (unspecified) erorr |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1797 |
occurs." |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1798 |
"Marcel, continue here!! And ALWAYS commit ALL the code!! Sigh" |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1799 |
|
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1800 |
[ |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1801 |
JavaByteCodePreresolver preresolve: self. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1802 |
accessFlags := accessFlags | A_RESOLVED. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1803 |
^1. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1804 |
] on: Error do:[:ex| |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1805 |
self breakPoint: #mh. "Marcel, please fix it" |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1806 |
^0. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1807 |
]. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1808 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1809 |
"/RETURN 1...OK, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1810 |
"/ 0...Something could not be resolved |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1811 |
"/ -1...Some error |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1812 |
self breakPoint:#mh. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1813 |
^ 1. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1814 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1815 |
"Created: / 09-02-2012 / 20:59:22 / mh <hlopik@gmail.com>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1816 |
"Modified: / 11-02-2012 / 13:46:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1817 |
"Modified (format): / 23-02-2012 / 17:49:09 / Marcel Hlopko <hlopik@gmail.com>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1818 |
"Modified: / 24-02-2012 / 14:46:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1819 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1820 |
|
2151 | 1821 |
setAccessFlags:flags |
1822 |
accessFlags := flags. |
|
1823 |
||
1824 |
"Created: 16.4.1996 / 11:34:14 / cg" |
|
1825 |
! |
|
1826 |
||
1827 |
setCode:codeBytes maxStack:max_stack maxLocals:max_locals u1:unknown1 u2:unknown2 |
|
1828 |
"/ javaByteCode := codeBytes. |
|
1829 |
byteCode := codeBytes. |
|
1830 |
"/ numStack := max_stack. |
|
1831 |
"/ numLocals := max_locals. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1832 |
super numberOfVars:max_locals - self numArgs - (self isStatic ifTrue:[0] ifFalse:[1]). |
2151 | 1833 |
super stackSize:max_stack. |
1834 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1835 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1836 |
|
2151 | 1837 |
"/ self displayString printNL. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1838 |
"/ ' nStack: ' print. numStack print. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1839 |
"/ ' nLocal: ' print. numLocals print. |
2151 | 1840 |
"/ ' u1: ' print. unknown1 print. |
1841 |
"/ ' u2: ' print. unknown2 printNL. |
|
1842 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1843 |
"Modified: / 01-08-1997 / 00:08:32 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1844 |
"Modified: / 12-10-2012 / 11:46:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 1845 |
! |
1846 |
||
1847 |
setDescriptor:aString |
|
1848 |
||
1849 |
descriptor := aString asSymbol. |
|
1850 |
||
1851 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
|
1852 |
"Modified: / 16-10-1998 / 00:17:12 / cg" |
|
1853 |
"Modified: / 13-08-2011 / 01:21:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1854 |
"Created: / 14-08-2011 / 19:41:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1855 |
! |
|
1856 |
||
1857 |
setJavaClass:aJavaClass |
|
1858 |
javaClass := aJavaClass |
|
1859 |
||
1860 |
"Modified: 16.4.1996 / 12:36:27 / cg" |
|
1861 |
"Created: 16.4.1996 / 15:28:15 / cg" |
|
1862 |
! |
|
1863 |
||
1864 |
setLineNumberTable:anArrayOfPCtoLineAssociations |
|
1865 |
"since this uses up lots of memory, compress it" |
|
1866 |
||
1867 |
|allBytes allWords idx| |
|
1868 |
||
1869 |
allBytes := allWords := true. |
|
1870 |
||
1871 |
anArrayOfPCtoLineAssociations do:[:assoc | |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1872 |
assoc key > 255 ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1873 |
allBytes := false. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1874 |
assoc key > 16rFFFF ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1875 |
allWords := false. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1876 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1877 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1878 |
assoc value > 255 ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1879 |
allBytes := false. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1880 |
assoc value > 16rFFFF ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1881 |
allWords := false |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1882 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1883 |
]. |
2151 | 1884 |
]. |
1885 |
allBytes ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1886 |
lineNumberTable := ByteArray new:(anArrayOfPCtoLineAssociations size * 2). |
2151 | 1887 |
] ifFalse:[ |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1888 |
allWords ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1889 |
lineNumberTable := WordArray new:(anArrayOfPCtoLineAssociations size * 2). |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1890 |
] ifFalse:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1891 |
lineNumberTable := Array new:(anArrayOfPCtoLineAssociations size * 2). |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1892 |
] |
2151 | 1893 |
]. |
1894 |
||
1895 |
idx := 1. |
|
1896 |
anArrayOfPCtoLineAssociations do:[:assoc | |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1897 |
lineNumberTable at:idx put:assoc key. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1898 |
lineNumberTable at:idx+1 put:assoc value. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
1899 |
idx := idx + 2. |
2151 | 1900 |
]. |
1901 |
||
1902 |
"Created: 16.4.1996 / 12:34:04 / cg" |
|
1903 |
"Modified: 16.4.1996 / 12:49:06 / cg" |
|
1904 |
! |
|
1905 |
||
1906 |
setLocalVariableTable:anArray |
|
1907 |
localVariableTable := anArray. |
|
1908 |
! |
|
1909 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1910 |
setName:name descriptor:desc |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1911 |
| numArgs numJArgs returnTypeSignatureChar returnTypeIsPrimitiveArray | |
2151 | 1912 |
|
2791
6a57107d168a
Improvement in interop/java extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2790
diff
changeset
|
1913 |
"/ Force Symbol creation so Smalltalk syntax highlighter will not |
6a57107d168a
Improvement in interop/java extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2790
diff
changeset
|
1914 |
"/ mark them as unknown message (it detects this solely by existence |
6a57107d168a
Improvement in interop/java extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2790
diff
changeset
|
1915 |
"/ of the symbol. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1916 |
name asSymbol. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1917 |
|
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1918 |
selector := (name , desc) asSymbol. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1919 |
self setDescriptor:desc. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1920 |
|
3197
d44f099dcff0
Classr reading optimization [3/4]: Optimize JavaMethod class>>numArgsFromDescriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3196
diff
changeset
|
1921 |
numJArgs := self class numArgsFromDescriptor:desc. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1922 |
(numJArgs > self class maxNumberOfArguments) ifTrue:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1923 |
numArgs := 1. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1924 |
] ifFalse:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1925 |
numArgs := numJArgs. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1926 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1927 |
self numberOfArgs:numArgs. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
1928 |
self numberOfJavaArgs:numJArgs. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1929 |
returnTypeSignatureChar := descriptor last. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1930 |
|
2151 | 1931 |
|
1932 |
"/ for the convenience of the VM, also mirror the return type in |
|
1933 |
"/ the flags ... |
|
1934 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1935 |
|
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1936 |
returnTypeSignatureChar == $V ifTrue:[ |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1937 |
accessFlags := accessFlags bitOr:ACX_R_VOID |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1938 |
] ifFalse:[ |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1939 |
returnTypeIsPrimitiveArray := (descriptor at: (descriptor size - 1)) == $[. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1940 |
returnTypeIsPrimitiveArray ifFalse:[ |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1941 |
returnTypeSignatureChar == $J ifTrue:[ |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1942 |
accessFlags := accessFlags bitOr:ACX_R_LONG |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1943 |
] ifFalse:[ |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1944 |
returnTypeSignatureChar == $D ifTrue:[ |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1945 |
accessFlags := accessFlags bitOr:ACX_R_DOUBLE |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1946 |
]. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1947 |
]. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1948 |
]. |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1949 |
]. |
2151 | 1950 |
|
1951 |
"Created: / 14-08-2011 / 19:41:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1952 |
"Modified: / 21-05-2014 / 20:47:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 1953 |
! |
1954 |
||
1955 |
setSignature:aString |
|
1956 |
||
1957 |
signature := aString asSymbol. |
|
1958 |
||
1959 |
"Created: / 16-04-1996 / 11:34:29 / cg" |
|
1960 |
"Modified: / 16-10-1998 / 00:17:12 / cg" |
|
1961 |
"Modified (format): / 14-08-2011 / 19:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2716
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1962 |
! |
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1963 |
|
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1964 |
setSource:aJavaMethodSourceRef |
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1965 |
self assert: aJavaMethodSourceRef class == JavaSourceRef. |
2716
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1966 |
source := aJavaMethodSourceRef |
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1967 |
|
1cca77810e04
Initial support for source file partitioning using eclipse parser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2708
diff
changeset
|
1968 |
"Created: / 07-09-2013 / 01:44:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
1969 |
"Modified: / 13-09-2013 / 02:19:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 1970 |
! ! |
1971 |
||
1972 |
!JavaMethod methodsFor:'inspecting'! |
|
1973 |
||
1974 |
inspectorExtraAttributes |
|
1975 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
1976 |
||
1977 |
^ Dictionary new |
|
1978 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
1979 |
"/add:'-code' -> [ String streamContents:[:s | JavaDecompiler decompile: self to: s] ]; |
|
1980 |
add:'-code' -> [ String streamContents:[:s | JavaByteCodeDisassembler diassemble: self to: s] ]; |
|
1981 |
"/add:'-source' -> [ self source ]; |
|
1982 |
yourself |
|
1983 |
||
1984 |
"Modified: / 22-03-2011 / 21:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1985 |
! ! |
|
1986 |
||
1987 |
!JavaMethod methodsFor:'interpretation'! |
|
1988 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1989 |
interpretWithReceiver: receiver |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1990 |
|
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1991 |
^self |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
1992 |
interpretWithReceiver: receiver |
2151 | 1993 |
arguments: #() |
1994 |
||
1995 |
"Created: / 24-02-2011 / 22:05:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1996 |
! |
|
1997 |
||
1998 |
interpretWithReceiver: receiver arg: a1 |
|
1999 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2000 |
^self |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2001 |
interpretWithReceiver: receiver |
2151 | 2002 |
arguments: (Array with: a1) |
2003 |
||
2004 |
"Created: / 24-02-2011 / 22:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2005 |
! |
|
2006 |
||
2007 |
interpretWithReceiver: receiver arg: a1 arg: a2 |
|
2008 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2009 |
^self |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2010 |
interpretWithReceiver: receiver |
2151 | 2011 |
arguments: (Array with: a1 with: a2) |
2012 |
||
2013 |
"Created: / 24-02-2011 / 22:05:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2014 |
! |
|
2015 |
||
2016 |
interpretWithReceiver: receiver arg: a1 arg: a2 arg: a3 |
|
2017 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2018 |
^self |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2019 |
interpretWithReceiver: receiver |
2151 | 2020 |
arguments: (Array with: a1 with: a2 with: a3) |
2021 |
||
2022 |
"Created: / 24-02-2011 / 22:06:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2870
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2023 |
! |
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2024 |
|
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2025 |
interpretWithReceiver:aReceiver arguments:argVector |
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2026 |
"invoked by VM for non-Smalltalk-methods (MetaMethods)" |
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2027 |
|
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2028 |
^ JavaByteCodeInterpreter interpret: self receiver: aReceiver arguments: argVector |
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2029 |
|
b8187695c8cd
Added JavaMethod>>#interpretWithReceiver:arguments:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2864
diff
changeset
|
2030 |
"Created: / 17-10-2013 / 01:56:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 2031 |
! ! |
2032 |
||
118 | 2033 |
!JavaMethod methodsFor:'methodref interchangability'! |
2034 |
||
673 | 2035 |
homeMethod |
2036 |
^ self |
|
2037 |
! |
|
2038 |
||
118 | 2039 |
method |
2040 |
^ self |
|
692 | 2041 |
! |
2042 |
||
2043 |
setPackage:newPackage |
|
2044 |
newPackage ~= javaClass package ifTrue:[ |
|
2045 |
self halt:'java method cannot be in a package different from its class'. |
|
2046 |
] |
|
118 | 2047 |
! ! |
2048 |
||
148 | 2049 |
!JavaMethod methodsFor:'misc'! |
2050 |
||
378 | 2051 |
fromMethod:aJavaMethod |
2052 |
"copy values from another javaMethod" |
|
149 | 2053 |
|
378 | 2054 |
flags := aJavaMethod flags. |
2055 |
byteCode := aJavaMethod byteCode. |
|
2056 |
accessFlags := aJavaMethod accessFlags. |
|
2057 |
selector := aJavaMethod selector. |
|
2058 |
javaClass := aJavaMethod javaClass. |
|
2151 | 2059 |
descriptor := aJavaMethod instVarNamed:#descriptor. |
2060 |
signature := aJavaMethod instVarNamed:#signature. |
|
378 | 2061 |
lineNumberTable := aJavaMethod lineNumberTable. |
2062 |
localVariableTable := aJavaMethod localVariableTable. |
|
2151 | 2063 |
annotations := aJavaMethod annotations. |
2064 |
||
2065 |
"Modified: / 16-10-1998 / 01:27:19 / cg" |
|
2066 |
"Modified: / 14-08-2011 / 19:30:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
255 | 2067 |
! |
252 | 2068 |
|
255 | 2069 |
updateClassRefsFrom:oldClass to:newClass |
2070 |
javaClass == oldClass ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2071 |
"/ invalidate |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2072 |
byteCode := nil. |
255 | 2073 |
] |
252 | 2074 |
|
255 | 2075 |
"Created: / 6.1.1998 / 18:19:48 / cg" |
252 | 2076 |
! ! |
2077 |
||
8 | 2078 |
!JavaMethod methodsFor:'printing & storing'! |
2079 |
||
29 | 2080 |
displayString |
168 | 2081 |
javaClass isNil ifTrue:[ |
611 | 2082 |
^ self class name , '(???)' |
168 | 2083 |
]. |
611 | 2084 |
^ self class name , '(' , javaClass displayString , '::' , self signatureName , ')' |
423 | 2085 |
|
611 | 2086 |
"Modified: / 25.9.1999 / 23:04:01 / cg" |
29 | 2087 |
! |
2088 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2089 |
printOn: aStream |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2090 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2091 |
super printOn: aStream. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2092 |
aStream nextPut: $(. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2093 |
javaClass name printOn: aStream. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2094 |
aStream nextPut: $.. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2095 |
selector printOn: aStream. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2096 |
aStream nextPut: $). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2097 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2098 |
"Created: / 05-12-2011 / 01:30:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2099 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2100 |
|
2864
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2101 |
printStringForBrowserWithSelector:dummySelector |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2102 |
"/ self isStatic ifTrue:[ |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2103 |
"/ ^ 'static ' , self signatureName |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2104 |
"/ ]. |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2105 |
"/ self isBreakpointed ifTrue:[ |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2106 |
"/ ^ (LabelAndIcon '!! ' , self signatureName |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2107 |
"/ ]. |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2108 |
|
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2109 |
self name = #'<clinit>' ifTrue:[ |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2110 |
^ 'static {}' |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2111 |
]. |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2112 |
|
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2113 |
^ self name = #'<init>' ifTrue:[ |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2114 |
self class specTextFromSignature:descriptor in:javaClass package withName:(javaClass lastName) isConstructor: true |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2115 |
] ifFalse:[ |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2116 |
self class specTextFromSignature:descriptor in:javaClass package withName:(self name) isConstructor: false |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2117 |
] |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2118 |
|
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2119 |
"Created: / 16-10-2013 / 00:52:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2120 |
! |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2121 |
|
670 | 2122 |
printStringForBrowserWithSelector:dummySelector inClass:dummyClass |
43 | 2123 |
"/ self isStatic ifTrue:[ |
2124 |
"/ ^ 'static ' , self signatureName |
|
2125 |
"/ ]. |
|
168 | 2126 |
"/ self isBreakpointed ifTrue:[ |
2127 |
"/ ^ (LabelAndIcon '!! ' , self signatureName |
|
2128 |
"/ ]. |
|
175 | 2129 |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2130 |
self name = #'<clinit>' ifTrue:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2131 |
^ 'static {}' |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2132 |
]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2133 |
|
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2134 |
^ self name = #'<init>' ifTrue:[ |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2135 |
self class specTextFromSignature:descriptor in:javaClass package withName:(javaClass lastName) isConstructor: true |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2136 |
] ifFalse:[ |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2137 |
self class specTextFromSignature:descriptor in:javaClass package withName:(self name) isConstructor: false |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2138 |
] |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2139 |
|
2864
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2140 |
"Created: / 16-10-2013 / 00:55:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2141 |
! |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2142 |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2143 |
selectorPrintStringInBrowserFor:dummySelector |
2864
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2144 |
^ self selectorPrintStringInBrowserFor:dummySelector class: javaClass |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2145 |
|
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2146 |
"Created: / 16-10-2013 / 01:02:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2147 |
! |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2148 |
|
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2149 |
selectorPrintStringInBrowserFor:dummySelector class: dummyClass |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2150 |
^ self printStringForBrowserWithSelector:dummySelector inClass:dummyClass |
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2151 |
|
50b4916dd8d2
Fixes for Java method tracing/counting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2814
diff
changeset
|
2152 |
"Created: / 16-10-2013 / 01:03:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10 | 2153 |
! |
2154 |
||
118 | 2155 |
shortDisplayString |
2156 |
^ javaClass name , '::' , self signatureNameWithoutReturnType |
|
2157 |
! |
|
2158 |
||
10 | 2159 |
signatureName |
2160 |
"return a string to be used when browsing" |
|
2161 |
||
2151 | 2162 |
^ self class specFromSignature:descriptor withName:(self name) in:nil |
255 | 2163 |
|
2164 |
"Modified: / 8.1.1998 / 19:15:33 / cg" |
|
113 | 2165 |
! |
2166 |
||
164 | 2167 |
signatureNameFor:name withArgsIn:aPackage |
2168 |
"return a string to be used when decompiling" |
|
2169 |
||
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2170 |
^ name = '<init>' ifTrue:[ |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2171 |
self class specWithArgsFromSignature:descriptor withName: javaClass lastName in:aPackage isConstructor: true. |
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2172 |
] ifFalse:[ |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2173 |
self class specWithArgsFromSignature:descriptor withName:(self name) in:aPackage isConstructor: false. |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2174 |
] |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2175 |
|
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2176 |
"Created: / 25-03-1997 / 18:49:45 / cg" |
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2177 |
"Modified: / 04-10-2013 / 12:33:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
164 | 2178 |
! |
2179 |
||
142 | 2180 |
signatureNameIn:aPackage |
2181 |
"return a string to be used when browsing" |
|
2182 |
||
2151 | 2183 |
^ self class specFromSignature:descriptor withName:(self name) in:aPackage |
142 | 2184 |
|
2185 |
"Created: 18.3.1997 / 11:11:01 / cg" |
|
2186 |
! |
|
2187 |
||
175 | 2188 |
signatureNameText |
2189 |
"return a text to be used when browsing" |
|
2190 |
||
2151 | 2191 |
^ self class specTextFromSignature:descriptor withName:(self name) |
175 | 2192 |
|
2193 |
"Created: 30.7.1997 / 14:40:29 / cg" |
|
2194 |
! |
|
2195 |
||
189 | 2196 |
signatureNameTextFor:name withArgsIn:aPackage |
2197 |
"return a text to be used when decompiling" |
|
2198 |
||
2151 | 2199 |
^ self class specTextWithArgsFromSignature:descriptor withName:name in:aPackage |
189 | 2200 |
|
2201 |
"Created: 25.3.1997 / 18:49:45 / cg" |
|
2202 |
"Modified: 1.8.1997 / 10:44:28 / cg" |
|
2203 |
! |
|
2204 |
||
255 | 2205 |
signatureNameWithArgNames:argNames |
2206 |
"return a string to be used when browsing" |
|
2207 |
||
2208 |
|myName| |
|
2209 |
||
2210 |
myName := self name. |
|
2211 |
myName = '<init>' ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2212 |
myName := javaClass name |
255 | 2213 |
]. |
2151 | 2214 |
^ self class specFromSignature:descriptor withName:myName argNames:argNames in:nil |
255 | 2215 |
|
2216 |
"Created: / 8.1.1998 / 21:04:03 / cg" |
|
2217 |
"Modified: / 8.1.1998 / 21:22:38 / cg" |
|
2218 |
! |
|
2219 |
||
2220 |
signatureNameWithArgNames:argNames in:package |
|
2221 |
"return a string to be used when browsing" |
|
2222 |
||
2223 |
|myName| |
|
2224 |
||
2225 |
myName := self name. |
|
2226 |
myName = '<init>' ifTrue:[ |
|
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2227 |
myName := javaClass name |
255 | 2228 |
]. |
2151 | 2229 |
^ self class specFromSignature:descriptor withName:myName argNames:argNames in:package |
255 | 2230 |
|
2231 |
"Modified: / 8.1.1998 / 21:05:52 / cg" |
|
2232 |
"Created: / 8.1.1998 / 21:23:03 / cg" |
|
2233 |
! |
|
2234 |
||
154 | 2235 |
signatureNameWithArgsIn:aPackage |
2236 |
"return a string to be used when browsing" |
|
2237 |
||
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2238 |
^ self signatureNameFor: self name withArgsIn: aPackage |
2151 | 2239 |
|
2240 |
"Created: / 20-03-1997 / 12:44:17 / cg" |
|
2790
b530c3f48cd3
Changed display string for Java methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
2241 |
"Modified: / 04-10-2013 / 12:34:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2151 | 2242 |
! |
2243 |
||
2244 |
signatureNameWithModifiers |
|
2245 |
"return a string to be used when deassembling" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2246 |
|
2151 | 2247 |
| result | |
2248 |
||
2249 |
result := self signatureName. |
|
2250 |
self isFinal ifTrue: [ result := 'final ' , result ]. |
|
2251 |
self isStatic ifTrue: [ result := 'static ' , result ]. |
|
2252 |
self isSynchronized ifTrue: [ result := 'synchronized ' , result ]. |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2253 |
self isPrivate |
2151 | 2254 |
ifTrue: [ result := 'private ' , result ] |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2255 |
ifFalse: |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2256 |
[ self isProtected |
2151 | 2257 |
ifTrue: [ result := 'protected ' , result ] |
2258 |
ifFalse: [ self isPublic ifTrue: [ result := 'public ' , result ] ] ]. |
|
2259 |
self isAbstract ifTrue: [ result := 'abstract ' , result ]. |
|
2260 |
^ result. |
|
2261 |
||
2262 |
"Modified: / 08-01-1998 / 19:15:33 / cg" |
|
2263 |
"Created: / 22-03-2011 / 16:25:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
154 | 2264 |
! |
2265 |
||
113 | 2266 |
signatureNameWithoutReturnType |
2267 |
"return a string to be used when browsing" |
|
2268 |
||
2151 | 2269 |
^ self class argSpecFromSignature:descriptor withName:(self name) |
113 | 2270 |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2271 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2272 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2273 |
whoString |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2274 |
^ javaClass name , '>>' , (self printStringForBrowserWithSelector:nil inClass:nil) |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2275 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2276 |
"Created: / 13-06-2013 / 08:52:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8 | 2277 |
! ! |
2278 |
||
2279 |
!JavaMethod methodsFor:'queries'! |
|
2280 |
||
111 | 2281 |
handlerFor:anException at:pc |
611 | 2282 |
"return an exceptionHandlers pc, for an exception of the given type, |
2283 |
occurring at pc. Returns nil, if there is none." |
|
2284 |
||
2285 |
|handlerTable| |
|
2286 |
||
2287 |
(handlerTable := self exceptionHandlerTable) isNil ifTrue:[^ nil]. |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2288 |
^handlerTable handlerPCFor:anException at:pc in:self. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2289 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2290 |
"Created: / 16-10-1998 / 01:18:40 / cg" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2291 |
"Modified: / 25-09-1999 / 23:07:01 / cg" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2292 |
"Modified: / 06-05-2013 / 21:49:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
31 | 2293 |
! |
2294 |
||
3537
dd610fcb5e07
Added JavaMethod>>hasEnabledBreakpoints, required by new stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3532
diff
changeset
|
2295 |
hasEnabledBreakpoints |
dd610fcb5e07
Added JavaMethod>>hasEnabledBreakpoints, required by new stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3532
diff
changeset
|
2296 |
^ self isBreakpointed |
dd610fcb5e07
Added JavaMethod>>hasEnabledBreakpoints, required by new stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3532
diff
changeset
|
2297 |
|
dd610fcb5e07
Added JavaMethod>>hasEnabledBreakpoints, required by new stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3532
diff
changeset
|
2298 |
"Created: / 15-03-2016 / 15:33:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dd610fcb5e07
Added JavaMethod>>hasEnabledBreakpoints, required by new stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3532
diff
changeset
|
2299 |
! |
dd610fcb5e07
Added JavaMethod>>hasEnabledBreakpoints, required by new stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3532
diff
changeset
|
2300 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2301 |
hasFinally |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2302 |
^ (accessFlags bitAnd:A_HASFINALLY) ~~ 0 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2303 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2304 |
"Created: / 28-03-2012 / 20:35:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2305 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2306 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2307 |
hasFinallyBasedOnExceptionTable |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2308 |
"Returns true if the exeption table has at least one |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2309 |
entry for finally block" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2310 |
^false |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2311 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2312 |
"Created: / 28-03-2012 / 23:18:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2313 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2314 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2315 |
hasHandler |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2316 |
^ (accessFlags bitAnd:A_HASHANDLER) ~~ 0 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2317 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2318 |
"Created: / 28-03-2012 / 20:35:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2319 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2320 |
|
2151 | 2321 |
hasPrimitiveCode |
2322 |
||
2323 |
^false |
|
2324 |
||
2325 |
"Created: / 18-07-2011 / 20:45:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2326 |
! |
|
2327 |
||
127 | 2328 |
hasResource |
2329 |
^ false |
|
2330 |
! |
|
2331 |
||
19 | 2332 |
isAbstract |
252 | 2333 |
^ (accessFlags bitAnd:A_ABSTRACT) ~~ 0 |
19 | 2334 |
! |
2335 |
||
80 | 2336 |
isBreakpointed |
256 | 2337 |
^ (accessFlags bitAnd:A_BREAKPOINT) ~~ 0 |
2338 |
||
2339 |
"Modified: / 11.1.1998 / 13:28:43 / cg" |
|
80 | 2340 |
! |
2341 |
||
19 | 2342 |
isFinal |
252 | 2343 |
^ (accessFlags bitAnd:A_FINAL) ~~ 0 |
19 | 2344 |
! |
2345 |
||
175 | 2346 |
isIgnored |
2347 |
"not really a java attribute; |
|
2348 |
added to allow browsing" |
|
2349 |
||
2350 |
^ false. |
|
2351 |
||
2352 |
"Created: 30.7.1997 / 15:34:33 / cg" |
|
2353 |
! |
|
2354 |
||
625 | 2355 |
isJavaClassRef |
2356 |
^ false |
|
2357 |
||
2358 |
"Created: / 9.11.1999 / 17:16:20 / cg" |
|
2359 |
! |
|
2360 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2361 |
isJavaConstructor |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2362 |
^((selector first) == $<) and:[selector startsWith:'<init>('] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2363 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2364 |
"Created: / 01-08-2012 / 00:21:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2365 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2366 |
|
431 | 2367 |
isJavaMethod |
2368 |
^ true |
|
2369 |
||
2370 |
"Created: / 10.11.1998 / 18:24:51 / cg" |
|
2371 |
! |
|
2372 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2373 |
isJavaStaticInitializer |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2374 |
^((selector first) == $<) and:[selector startsWith:'<clinit>('] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2375 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2376 |
"Created: / 19-09-2012 / 16:26:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2377 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2378 |
|
19 | 2379 |
isNative |
252 | 2380 |
^ (accessFlags bitAnd:A_NATIVE) ~~ 0 |
19 | 2381 |
! |
2382 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2383 |
isPackagePrivate |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2384 |
^ (accessFlags bitAnd:A_PRIVATE | A_PUBLIC | A_PROTECTED) = 0 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2385 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2386 |
"Created: / 05-07-2012 / 10:12:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2387 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2388 |
|
19 | 2389 |
isPrivate |
252 | 2390 |
^ (accessFlags bitAnd:A_PRIVATE) ~~ 0 |
19 | 2391 |
! |
2392 |
||
2393 |
isProtected |
|
252 | 2394 |
^ (accessFlags bitAnd:A_PROTECTED) ~~ 0 |
19 | 2395 |
! |
2396 |
||
2397 |
isPublic |
|
252 | 2398 |
^ (accessFlags bitAnd:A_PUBLIC) ~~ 0 |
19 | 2399 |
! |
2400 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2401 |
isResolved |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2402 |
"Return true, if the receiver is fully resolved, i.e., |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2403 |
if all references used by the method are resolved" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2404 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2405 |
^ (accessFlags bitAnd:A_RESOLVED) ~~ 0 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2406 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2407 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2408 |
|
19 | 2409 |
isStatic |
252 | 2410 |
^ (accessFlags bitAnd:A_STATIC) ~~ 0 |
19 | 2411 |
! |
2412 |
||
2413 |
isSynchronized |
|
252 | 2414 |
^ (accessFlags bitAnd:A_SYNCHRONIZED) ~~ 0 |
18 | 2415 |
! |
2416 |
||
256 | 2417 |
isTraced |
2418 |
^ false |
|
2419 |
||
2420 |
"Modified: / 11.1.1998 / 13:28:43 / cg" |
|
2421 |
"Created: / 11.1.1998 / 13:38:11 / cg" |
|
2422 |
! |
|
2423 |
||
8 | 2424 |
isUnloaded |
2425 |
^ false |
|
18 | 2426 |
! |
2427 |
||
2151 | 2428 |
isUnresolved |
2429 |
"return true, if the receiver is unresolved;" |
|
2430 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2431 |
^ self isResolved not |
2151 | 2432 |
|
2433 |
"Created: / 06-03-2011 / 22:57:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2434 |
! |
|
2435 |
||
256 | 2436 |
isWrapped |
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
2437 |
^ super isWrapped |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
2438 |
"/ ^ self isBreakpointed |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
2439 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
2440 |
"Created: / 11-01-1998 / 13:38:04 / cg" |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2888
diff
changeset
|
2441 |
"Modified: / 05-11-2013 / 16:19:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
256 | 2442 |
! |
2443 |
||
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2444 |
lineNumberForPC0: pc |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2445 |
| last | |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2446 |
|
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2447 |
lineNumberTable notNil ifTrue: [ |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2448 |
lineNumberTable |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2449 |
pairWiseDo: [:lPc :lNr | |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2450 |
lPc >= pc ifTrue: [ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2451 |
lPc == pc ifTrue: [ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2452 |
^ lNr |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2453 |
]. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2454 |
last isNil ifTrue: [ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2455 |
^ lNr |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2456 |
]. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2457 |
^ last. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2458 |
]. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2459 |
last := lNr. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2460 |
]. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2461 |
last notNil ifTrue: [ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2462 |
^ last |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2463 |
]. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2464 |
^ lineNumberTable at: 2 |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2465 |
]. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2466 |
^ nil |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2467 |
|
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2468 |
"Modified: / 14.1.1998 / 13:30:54 / cg" |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2469 |
"Created: / 10.11.1998 / 14:18:22 / cg" |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2470 |
! |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2471 |
|
31 | 2472 |
lineNumberForPC:pc |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2473 |
|num text| |
31 | 2474 |
|
2475 |
num := nil. |
|
2476 |
||
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2477 |
ForceByteCodeDisplay ifFalse:[ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2478 |
| line0 | |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2479 |
|
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2480 |
line0 := self lineNumberForPC0: pc. |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2481 |
ShowFullSource ifFalse:[ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2482 |
source isNil ifTrue:[ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2483 |
"/ Fetch the source ref... |
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
2484 |
self sourceDocument sourceTreeOrNilIfParsing. |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2485 |
source isNil ifTrue:[ |
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2486 |
^ line0 - self firstInstructionLineNumber - 2. |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2487 |
]. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2488 |
]. |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2489 |
^ line0 - source line0 + 1. |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2490 |
]. |
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2491 |
^ line0 |
46 | 2492 |
]. |
31 | 2493 |
|
46 | 2494 |
"/ decompile and look which line the pc falls into |
209 | 2495 |
|
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2496 |
ForceByteCodeDisplay ifTrue:[ |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2497 |
text := self decompiledBytecode asCollectionOfLines. |
209 | 2498 |
] ifFalse:[ |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2499 |
text := self decompiledSource asCollectionOfLines. |
209 | 2500 |
]. |
31 | 2501 |
|
46 | 2502 |
text keysAndValuesDo:[:lineNr :line | |
2158
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2503 |
|nr| |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2504 |
|
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2505 |
(line startsWith:' ') ifFalse:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2506 |
nr := Integer readFrom:line onError:0. |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2507 |
nr >= pc ifTrue:[ |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2508 |
^ lineNr |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2509 |
] |
cf16fc148fb8
added: #originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
2510 |
] |
31 | 2511 |
]. |
2512 |
^ num |
|
141 | 2513 |
|
2726
6971720de5a4
More support for method's source only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2725
diff
changeset
|
2514 |
"Modified: / 14-01-1998 / 13:30:54 / cg" |
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
2515 |
"Modified: / 13-09-2013 / 02:11:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
31 | 2516 |
! |
2517 |
||
2087 | 2518 |
messagesSent |
2519 |
"return a collection of messages sent by this method" |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2520 |
^ self analyzer messagesSent |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2521 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2522 |
"Modified: / 31-08-2013 / 10:43:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2087 | 2523 |
! |
2524 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2525 |
overrides: anotherMethod |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2526 |
"Returns true, if the receiver overwrites anotherMethod. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2527 |
This method implements algorithm described in JVM spec, sec. 5.4.2.1" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2528 |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2529 |
anotherMethod isJavaMethod ifFalse:[ |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2530 |
"It is questionable what to return here. Best seems to be |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2531 |
do following: if anotherMethod belongs to one of my superclasses |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2532 |
(either JavaObject or Object in current impl), then return true, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2533 |
false otherwise" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2534 |
^javaClass inheritsFrom: anotherMethod mclass. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2535 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2536 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2537 |
"An instance method m1 (self) declared in class C overrides another instance method m2 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2538 |
(anotherMethod) declared in class A iff all of the following are true:" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2539 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2540 |
" - m2 has the same name and descriptor as m1. " |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2541 |
selector == anotherMethod selector ifFalse:[ ^ false ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2542 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2543 |
" - C is a subclass of A." |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2544 |
(javaClass isSubclassOf: anotherMethod javaClass) ifFalse:[ ^ false ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2545 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2546 |
"- either: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2547 |
- m2 is marked ACC_PUBLIC; or is marked ACC_PROTECTED; or is marked nei- |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2548 |
ther ACC_PUBLIC nor ACC_PROTECTED nor ACC_PRIVATE and belongs to the |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2549 |
same runtime package as C, or" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2550 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2551 |
(anotherMethod isPublic or:[anotherMethod isProtected]) ifTrue:[ ^ true ]. |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2552 |
(anotherMethod isPackagePrivate |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2553 |
and:[javaClass package == anotherMethod javaClass package]) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2554 |
ifTrue:[ ^ true ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2555 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2556 |
^false. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2557 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2558 |
"Created: / 05-07-2012 / 11:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2559 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2560 |
|
156 | 2561 |
package |
685 | 2562 |
"in java, class extensions are not possible; |
2563 |
all methods MUST be in their classes package" |
|
156 | 2564 |
|
685 | 2565 |
^ javaClass package |
156 | 2566 |
! |
2567 |
||
3605
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2568 |
referencesLiteral:aLiteral |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2569 |
"return true, if this method directly references the given literal directly |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2570 |
(i.e. a flat search, which does not look deeper into literal arrays)." |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2571 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2572 |
| cp | |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2573 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2574 |
"/ JVM does not use per-method literal frame like Smalltalk but |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2575 |
"/ per-class constant pool. To avoid decompilation of bytecode to |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2576 |
"/ see what's actually referenced, do a quick-search through a constant |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2577 |
"/ pool to quickly rule out methods that cannot possibly refer to it. |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2578 |
cp := javaClass constantPool. |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2579 |
(cp includes: aLiteral) ifFalse:[ ^ false ]. |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2580 |
^super referencesLiteral:aLiteral. |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2581 |
" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2582 |
(CompiledCode compiledMethodAt:#referencesLiteral:) referencesGlobal:#literalsDetect:ifNone: |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2583 |
(CompiledCode compiledMethodAt:#referencesLiteral:) referencesGlobal:#bla |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2584 |
" |
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2585 |
|
da57f13e6a23
Fixed JavaMethod>>referencesLiteral: and other literal-access methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3555
diff
changeset
|
2586 |
"Created: / 29-07-2016 / 09:59:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
625 | 2587 |
! |
2588 |
||
618 | 2589 |
sends:aSelectorSymbol |
2590 |
"return true, if this method contains a message-send |
|
2591 |
with aSelectorSymbol as selector." |
|
2592 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2593 |
^ self analyzer sends: aSelectorSymbol |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2594 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2595 |
"Created: / 09-11-1999 / 15:38:14 / cg" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2596 |
"Modified: / 09-11-1999 / 17:06:03 / cg" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2597 |
"Modified: / 31-08-2013 / 11:37:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
618 | 2598 |
! |
2599 |
||
2151 | 2600 |
shouldBeSkippedInDebuggersWalkBack |
2601 |
||
2602 |
^false |
|
2603 |
||
2604 |
"Created: / 30-11-2010 / 15:35:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2605 |
! |
|
2606 |
||
18 | 2607 |
who |
2608 |
"return the class and selector of where I am defined in." |
|
2609 |
||
64 | 2610 |
|sel| |
18 | 2611 |
|
252 | 2612 |
javaClass isNil ifTrue:[^ nil]. |
378 | 2613 |
sel := selector. |
2614 |
"/ sel := javaClass methodDictionary keyAtValue:self ifAbsent:nil. |
|
64 | 2615 |
sel isNil ifTrue:[^ nil]. |
129 | 2616 |
^ Method::MethodWhoInfo class:javaClass selector:sel. |
378 | 2617 |
|
2618 |
"Modified: / 16.10.1998 / 13:42:10 / cg" |
|
5 | 2619 |
! ! |
2620 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2621 |
!JavaMethod methodsFor:'queries-statistic'! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2622 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2623 |
messagesPossiblySent |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2624 |
^ self analyzer messagesPossiblySent |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2625 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2626 |
"Created: / 30-08-2013 / 14:05:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2627 |
"Modified: / 30-08-2013 / 17:07:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2628 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2629 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2630 |
messagesSentToSelf |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2631 |
^ self analyzer messagesSentToSelf |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2632 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2633 |
"Created: / 31-08-2013 / 09:32:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2634 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2635 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2636 |
messagesSentToSuper |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2637 |
^ self analyzer messagesSentToSuper |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2638 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2639 |
"Created: / 30-03-2013 / 09:59:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2640 |
"Modified: / 30-08-2013 / 17:07:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2641 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2642 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2643 |
modifiedClassVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2644 |
^ #() |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2645 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2646 |
"Created: / 30-08-2013 / 13:16:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2647 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2648 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2649 |
modifiedGlobals |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2650 |
^ #() |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2651 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2652 |
"Created: / 05-09-2013 / 15:26:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2653 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2654 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2655 |
modifiedInstVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2656 |
^ self analyzer modifiedInstVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2657 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2658 |
"Created: / 30-08-2013 / 13:18:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2659 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2660 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2661 |
modifiedPoolVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2662 |
^ #() |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2663 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2664 |
"Created: / 05-09-2013 / 15:25:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2665 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2666 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2667 |
readClassVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2668 |
^ #() |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2669 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2670 |
"Created: / 05-09-2013 / 15:25:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2671 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2672 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2673 |
readGlobals |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2674 |
^ self analyzer readGlobals |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2675 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2676 |
"Created: / 05-09-2013 / 15:26:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2677 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2678 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2679 |
readInstVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2680 |
^ self analyzer readInstVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2681 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2682 |
"Created: / 05-09-2013 / 15:24:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2683 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2684 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2685 |
readPoolVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2686 |
^ #() |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2687 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2688 |
"Created: / 05-09-2013 / 15:25:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2689 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2690 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2691 |
sends:symbol1 or:symbol2 |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2692 |
^ self analyzer sends:symbol1 or:symbol2 |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2693 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2694 |
"Modified: / 30-08-2013 / 17:07:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2695 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2696 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2697 |
sendsAny: selectors |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2698 |
^ self analyzer sendsAny: selectors |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2699 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2700 |
"Created: / 02-12-2011 / 23:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2701 |
"Modified: / 30-08-2013 / 17:08:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2702 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2703 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2704 |
usedClassVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2705 |
^ #() "/ No class vars in Java |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2706 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2707 |
"Created: / 30-08-2013 / 13:18:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2708 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2709 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2710 |
usedGlobals |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2711 |
^ self analyzer usedGlobals |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2712 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2713 |
"Created: / 05-09-2013 / 15:26:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2714 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2715 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2716 |
usedInstVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2717 |
^ self analyzer usedInstVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2718 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2719 |
"Created: / 30-08-2013 / 13:18:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2720 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2721 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2722 |
usedPoolVars |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2723 |
^ #() |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2724 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2725 |
"Created: / 05-09-2013 / 15:25:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2726 |
! ! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2727 |
|
154 | 2728 |
!JavaMethod methodsFor:'signature parsing'! |
2729 |
||
255 | 2730 |
XXXspecWithArgsFromSignature:aSignature withName:name in:aPackage |
154 | 2731 |
"given a signature, return a spec with args" |
2732 |
||
2733 |
|s argSpec retvalSpec| |
|
2734 |
||
2735 |
s := aSignature readStream. |
|
2736 |
s next ~~ $( ifTrue:[self halt. ^ name]. |
|
2737 |
||
2738 |
argSpec := self argSpecWithArgsFromStream:s in:aPackage. |
|
2739 |
||
2740 |
s next ~~ $) ifTrue:[self halt. ^ name]. |
|
2741 |
||
2742 |
retvalSpec := self retvalSpecFromStream:s in:aPackage. |
|
2743 |
||
2744 |
^ retvalSpec , ' ' , name , ' (' , argSpec , ')' |
|
2745 |
||
2746 |
" |
|
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2747 |
JavaMethod specFromSignature:'(LObject;)V' withName:'foo' |
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2748 |
JavaMethod specFromSignature:'(BB)S' withName:'foo' |
154 | 2749 |
" |
2750 |
||
255 | 2751 |
"Created: / 8.1.1998 / 19:17:58 / cg" |
154 | 2752 |
! ! |
2753 |
||
2151 | 2754 |
!JavaMethod methodsFor:'testing'! |
2755 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2756 |
isMethodWithBreakpoints |
3111
3119ced5d03c
[JavaClassReader optimization 3/3]: optimize JavaMethod>>setName:descriptor:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3088
diff
changeset
|
2757 |
^self isBreakpointed |
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2758 |
or:[(ConfigurableFeatures includesFeature: #VMBreakpointSupport) |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2759 |
and:[self breakpointTable notEmptyOrNil]] |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2760 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2761 |
"Created: / 11-04-2013 / 14:50:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2762 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2555
diff
changeset
|
2763 |
|
2151 | 2764 |
isSynthetic |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2765 |
^ (accessFlags bitAnd:A_SYNTHETIC) ~~ 0 |
2151 | 2766 |
|
2767 |
"Created: / 18-10-2010 / 19:09:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2768 |
! ! |
|
2769 |
||
129 | 2770 |
!JavaMethod class methodsFor:'documentation'! |
2 | 2771 |
|
2772 |
version |
|
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
2773 |
^ '$Header: /cvs/stx/stx/libjava/JavaMethod.st,v 1.118 2015-03-20 12:08:00 vrany Exp $' |
2145 | 2774 |
! |
2775 |
||
2776 |
version_CVS |
|
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
2777 |
^ '$Header: /cvs/stx/stx/libjava/JavaMethod.st,v 1.118 2015-03-20 12:08:00 vrany Exp $' |
2151 | 2778 |
! |
2779 |
||
2780 |
version_SVN |
|
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
2781 |
^ 'Id' |
2 | 2782 |
! ! |
2107 | 2783 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2204
diff
changeset
|
2784 |
|
2086 | 2785 |
JavaMethod initialize! |