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