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