author | Claus Gittinger <cg@exept.de> |
Sun, 23 Feb 2020 14:03:15 +0100 | |
branch | cvs_MAIN |
changeset 3997 | 5bb44f7e1d20 |
parent 3412 | df11bb428463 |
child 3535 | b07aa765287f |
permissions | -rw-r--r-- |
749 | 1 |
" |
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
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:
2152
diff
changeset
|
5 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
749 | 7 |
SWING Research Group, Czech Technical University in Prague |
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. |
|
15 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
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:
2152
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:
2152
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:
2152
diff
changeset
|
19 |
as of 1.9.2010 |
749 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
3330
b14c58b2876c
Oops, moved stray reloading-related methods from stx:libjava/experiments to stx:libjava.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
23 |
"{ NameSpace: Smalltalk }" |
b14c58b2876c
Oops, moved stray reloading-related methods from stx:libjava/experiments to stx:libjava.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3324
diff
changeset
|
24 |
|
749 | 25 |
JavaByteCodeProcessorTests subclass:#JavaByteCodeDisassemblerTests |
26 |
instanceVariableNames:'' |
|
27 |
classVariableNames:'' |
|
28 |
poolDictionaries:'' |
|
29 |
category:'Languages-Java-Tests' |
|
30 |
! |
|
31 |
||
32 |
!JavaByteCodeDisassemblerTests class methodsFor:'documentation'! |
|
33 |
||
34 |
copyright |
|
35 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
36 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
37 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
38 |
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:
2152
diff
changeset
|
39 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
40 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
749 | 41 |
SWING Research Group, Czech Technical University in Prague |
42 |
||
43 |
This software is furnished under a license and may be used |
|
44 |
only in accordance with the terms of that license and with the |
|
45 |
inclusion of the above copyright notice. This software may not |
|
46 |
be provided or otherwise made available to, or used by, any |
|
47 |
other person. No title to or ownership of the software is |
|
48 |
hereby transferred. |
|
49 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
50 |
[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:
2152
diff
changeset
|
51 |
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:
2152
diff
changeset
|
52 |
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:
2152
diff
changeset
|
53 |
as of 1.9.2010 |
749 | 54 |
|
55 |
" |
|
56 |
! ! |
|
57 |
||
58 |
!JavaByteCodeDisassemblerTests class methodsFor:'resources'! |
|
59 |
||
60 |
resources |
|
61 |
||
62 |
^ Array with: JavaInitializedResource with: JavaTestsResource. |
|
63 |
||
64 |
"Created: / 15-03-2011 / 17:29:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
65 |
"Modified: / 16-03-2011 / 14:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
66 |
! ! |
|
67 |
||
68 |
!JavaByteCodeDisassemblerTests methodsFor:'tests'! |
|
69 |
||
70 |
testAnd |
|
71 |
| result | |
|
72 |
self shouldnt: |
|
73 |
[ result := self |
|
74 |
invoke: #'and(II)I' |
|
75 |
class: self loadSimpleMathJavaClass |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
76 |
args: #( 255 149 ) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
77 |
] raise: Error. |
749 | 78 |
|
79 |
"static method |
|
80 |
||
81 |
0 iload_0 |
|
82 |
1 iload_1 |
|
83 |
2 iand |
|
84 |
3 ireturn" |
|
85 |
||
86 |
"Created: / 14-03-2011 / 17:02:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
87 |
"Modified: / 20-03-2011 / 21:49:36 / 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:
2152
diff
changeset
|
88 |
"Modified (format): / 21-12-2012 / 18:43:34 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>" |
749 | 89 |
! |
90 |
||
91 |
testBitShiftLeft |
|
92 |
| | |
|
93 |
||
94 |
self shouldnt: |
|
95 |
[ self |
|
96 |
invoke: #'bitShiftLeft(II)I' |
|
97 |
class: self loadSimpleMathJavaClass |
|
98 |
args: #( 21 4 )] |
|
99 |
raise: Error. |
|
100 |
"static method |
|
101 |
||
102 |
0 iload_0 |
|
103 |
1 iload_1 |
|
104 |
2 ishl |
|
105 |
3 ireturn" |
|
106 |
||
107 |
"Created: / 14-03-2011 / 16:56:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
108 |
"Modified: / 20-03-2011 / 21:50:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
109 |
! |
|
110 |
||
111 |
testBitShiftRight |
|
112 |
| | |
|
113 |
||
114 |
self shouldnt: |
|
115 |
[ self |
|
116 |
invoke: #'bitShiftRight(II)I' |
|
117 |
class: self loadSimpleMathJavaClass |
|
118 |
args: #( 439 4 )] |
|
119 |
raise: Error. |
|
120 |
||
121 |
"static method |
|
122 |
||
123 |
0 iload_0 |
|
124 |
1 iload_1 |
|
125 |
2 ishr |
|
126 |
3 ireturn" |
|
127 |
||
128 |
"Created: / 14-03-2011 / 16:57:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
129 |
"Modified: / 20-03-2011 / 21:50:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
130 |
! |
|
131 |
||
132 |
testDec2 |
|
133 |
self shouldnt: |
|
134 |
||
135 |
||
136 |
[ self |
|
137 |
invoke: #'dec2(I)I' |
|
138 |
class: self loadSimpleMathJavaClass |
|
139 |
args: #( 3 ). ] raise: Error. |
|
140 |
||
141 |
||
142 |
"static method |
|
143 |
||
144 |
0 iinc 0 -1 |
|
145 |
3 iinc 0 -1 |
|
146 |
6 iload_0 |
|
147 |
7 ireturn" |
|
148 |
||
149 |
"Created: / 14-03-2011 / 16:58:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
150 |
"Modified: / 20-03-2011 / 22:59:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
151 |
! |
|
152 |
||
153 |
testDiv |
|
154 |
| | |
|
155 |
||
156 |
self shouldnt: |
|
157 |
[ self |
|
158 |
invoke: #'div(II)I' |
|
159 |
class: self loadSimpleMathJavaClass |
|
160 |
args: #( 101 10 ) ] |
|
161 |
raise: Error. |
|
162 |
||
163 |
"static method |
|
164 |
||
165 |
0 iload_0 |
|
166 |
1 iload_1 |
|
167 |
2 irem |
|
168 |
3 ireturn" |
|
169 |
||
170 |
"Created: / 14-03-2011 / 16:54:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
171 |
"Modified: / 20-03-2011 / 21:51:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
172 |
! |
|
173 |
||
174 |
testDivision |
|
175 |
| | |
|
176 |
||
177 |
self shouldnt: |
|
178 |
[ self |
|
179 |
invoke: #'division(II)I' |
|
180 |
class: self loadSimpleMathJavaClass |
|
181 |
args: #( 101 10 ) ] |
|
182 |
raise: Error. |
|
183 |
"static method |
|
184 |
||
185 |
0 iload_0 |
|
186 |
1 iload_1 |
|
187 |
2 idiv |
|
188 |
3 ireturn" |
|
189 |
||
190 |
"Created: / 14-03-2011 / 16:57:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
191 |
"Modified: / 20-03-2011 / 21:51:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
192 |
! |
|
193 |
||
194 |
testInc2 |
|
195 |
| | |
|
196 |
||
197 |
self shouldnt: |
|
198 |
[ self |
|
199 |
invoke: #'inc2(I)I' |
|
200 |
class: self loadSimpleMathJavaClass |
|
201 |
args: #( 3 ) ] |
|
202 |
raise: Error. |
|
203 |
"static method |
|
204 |
||
205 |
0 iinc 0 1 |
|
206 |
3 iinc 0 1 |
|
207 |
6 iload_0 |
|
208 |
7 ireturn" |
|
209 |
||
210 |
"Created: / 14-03-2011 / 16:58:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
211 |
"Modified: / 20-03-2011 / 21:51:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
212 |
! |
|
213 |
||
214 |
testInheritedMethodCall |
|
215 |
self shouldnt: [ |
|
216 |
||
217 |
self |
|
218 |
invoke: #'foo()Ljava/lang/String;' |
|
219 |
class: self loadSimpleInheritingJavaClass |
|
220 |
args: nil. |
|
221 |
||
222 |
] raise: Error. |
|
223 |
"0 ldc1 2 ['foo'] |
|
224 |
2 areturn" |
|
225 |
||
226 |
"Created: / 14-03-2011 / 16:21:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
227 |
"Modified: / 20-03-2011 / 23:01:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
228 |
! |
|
229 |
||
230 |
testJustLoadConstants |
|
231 |
self shouldnt: [ |
|
232 |
||
233 |
self |
|
234 |
invoke: #'justUseConstants()V' |
|
235 |
class: self loadSimpleMathJavaClass |
|
236 |
args: #(). |
|
237 |
||
238 |
] raise: Error. |
|
239 |
"static method |
|
240 |
||
241 |
0 lconst_0 |
|
242 |
1 lstore_0 |
|
243 |
2 lconst_1 |
|
244 |
3 lstore_2 |
|
245 |
4 fconst_0 |
|
246 |
5 fstore 4 |
|
247 |
7 fconst_1 |
|
248 |
8 fstore 5 |
|
249 |
10 fconst_2 |
|
250 |
11 fstore 6 |
|
251 |
13 dconst_0 |
|
252 |
14 dstore 7 |
|
253 |
16 dconst_1 |
|
254 |
17 dstore 9 |
|
255 |
19 return" |
|
256 |
||
257 |
"Created: / 14-03-2011 / 17:05:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
258 |
"Modified: / 20-03-2011 / 23:02:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
259 |
! |
|
260 |
||
261 |
testLookupSwitch |
|
262 |
self shouldnt: [ |
|
263 |
||
264 |
self |
|
265 |
invoke: #'switchInt(I)I' |
|
266 |
class: self loadSwitchExamplesClass |
|
267 |
receiver: self loadSwitchExamplesClass new |
|
268 |
args: #( -1000 ) |
|
269 |
||
270 |
] raise: Error. |
|
271 |
||
272 |
"Created: / 21-03-2011 / 13:51:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
273 |
"Modified: / 21-03-2011 / 15:12:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
274 |
! |
|
275 |
||
276 |
testMultipy |
|
277 |
self shouldnt: |
|
278 |
[ self |
|
279 |
invoke: #'multiply(II)I' |
|
280 |
class: self loadSimpleMathJavaClass |
|
281 |
args: (Array with: 20 with: 10)] |
|
282 |
raise: Error. |
|
283 |
||
284 |
"static method |
|
285 |
||
286 |
0 iload_0 |
|
287 |
1 iload_1 |
|
288 |
2 imul |
|
289 |
3 ireturn" |
|
290 |
||
291 |
"Created: / 06-03-2011 / 14:17:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
292 |
"Modified: / 20-03-2011 / 21:53:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
293 |
! |
|
294 |
||
295 |
testNegateInt |
|
296 |
self shouldnt: |
|
297 |
[ self |
|
298 |
invoke: #'negateInt(I)I' |
|
299 |
class: self loadSimpleMathJavaClass |
|
300 |
args: #( 55 )] |
|
301 |
raise: Error. |
|
302 |
||
303 |
"0 iload_0 |
|
304 |
1 iconst_m1 |
|
305 |
2 ixor |
|
306 |
3 ireturn" |
|
307 |
||
308 |
"Created: / 14-03-2011 / 16:55:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
309 |
"Modified: / 20-03-2011 / 21:53:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
310 |
! |
|
311 |
||
312 |
testOr |
|
313 |
| | |
|
314 |
||
315 |
self shouldnt: |
|
316 |
[ self |
|
317 |
invoke: #'or(II)I' |
|
318 |
class: self loadSimpleMathJavaClass |
|
319 |
args: #( 55 66 )] |
|
320 |
raise: Error. |
|
321 |
||
322 |
"0 iload_0 |
|
323 |
1 iload_1 |
|
324 |
2 ior |
|
325 |
3 ireturn" |
|
326 |
||
327 |
"Created: / 14-03-2011 / 17:02:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
328 |
"Modified: / 20-03-2011 / 21:53:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
329 |
! |
|
330 |
||
331 |
testOverridenMethodCall |
|
332 |
self shouldnt: |
|
333 |
[ self |
|
334 |
invoke: #'bar()Ljava/lang/String;' |
|
335 |
class: self loadSimpleInheritingJavaClass |
|
336 |
args: nil.] |
|
337 |
raise: Error. |
|
338 |
||
339 |
"0 ldc1 2 ['bar'] |
|
340 |
2 areturn" |
|
341 |
||
342 |
"Modified: / 20-03-2011 / 21:53:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
343 |
! |
|
344 |
||
345 |
testPower |
|
346 |
self shouldnt: |
|
347 |
[ self |
|
348 |
invoke: #'power(II)I' |
|
349 |
class: self loadSimpleMathJavaClass |
|
350 |
args: (Array with: 2 with: 10)] |
|
351 |
raise: Error. |
|
352 |
||
353 |
"0 iload_0 |
|
354 |
1 iload_1 |
|
355 |
2 iconst_1 |
|
356 |
3 invokestatic 2 [JavaMethod(stx.libjava.tests.simpleClasses.SimpleMath::int powerAcc (int int int))] |
|
357 |
6 ireturn" |
|
358 |
||
359 |
"Created: / 06-03-2011 / 14:18:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
360 |
"Modified: / 20-03-2011 / 21:54:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
361 |
! |
|
362 |
||
363 |
testReturnArrayOfLongs |
|
364 |
||
365 |
||
366 |
self shouldnt: |
|
367 |
[ self |
|
368 |
invoke: #'giveMeArrayOfLongs()[J' |
|
369 |
class: self loadSimpleMathJavaClass |
|
370 |
args: #(). ] |
|
371 |
raise: Error. |
|
372 |
||
373 |
"0 bipush 100 |
|
374 |
2 newarray 11 [T_LONG] |
|
375 |
4 areturn" |
|
376 |
||
377 |
"Created: / 14-03-2011 / 17:08:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
378 |
"Modified: / 20-03-2011 / 21:54:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
379 |
! |
|
380 |
||
381 |
testSimpleAdd |
|
382 |
self shouldnt: |
|
383 |
[ self |
|
384 |
invoke: #'add2To2000Expect2002()I' |
|
385 |
class: self loadSimpleMathJavaClass |
|
386 |
args: nil ] |
|
387 |
raise: Error. |
|
388 |
||
389 |
"static method |
|
390 |
||
391 |
0 iconst_2 |
|
392 |
1 istore_0 |
|
393 |
2 sipush 2000 |
|
394 |
5 istore_1 |
|
395 |
6 iload_0 |
|
396 |
7 iload_1 |
|
397 |
8 iadd |
|
398 |
9 istore_2 |
|
399 |
10 iload_2 |
|
400 |
11 ireturn" |
|
401 |
||
402 |
"Created: / 06-03-2011 / 14:18:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
403 |
"Modified: / 20-03-2011 / 21:55:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
404 |
! |
|
405 |
||
406 |
testSimpleAdd2 |
|
407 |
self shouldnt: |
|
408 |
[ self |
|
409 |
invoke: #'addMinus5ToArg(I)I' |
|
410 |
class: self loadSimpleMathJavaClass |
|
411 |
args: (Array with: 10) ] |
|
412 |
raise: Error. |
|
413 |
||
414 |
"static method |
|
415 |
||
416 |
0 iload_0 |
|
417 |
1 bipush -5 |
|
418 |
3 iadd |
|
419 |
4 ireturn" |
|
420 |
||
421 |
"Created: / 06-03-2011 / 14:18:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
422 |
"Modified: / 20-03-2011 / 21:55:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
423 |
! |
|
424 |
||
425 |
testStackCreation |
|
426 |
self shouldnt: |
|
427 |
[ self |
|
428 |
invoke: #'isYourStackCreatedCorrectly()I' |
|
429 |
class: self loadSimpleMathJavaClass |
|
430 |
args: #()] |
|
431 |
raise: Error. |
|
432 |
||
433 |
"0 iconst_0 |
|
434 |
1 istore_0 |
|
435 |
2 iconst_1 |
|
436 |
3 istore_1 |
|
437 |
4 iconst_2 |
|
438 |
5 istore_0 |
|
439 |
6 iconst_3 |
|
440 |
7 istore_1 |
|
441 |
8 iconst_4 |
|
442 |
9 istore_0 |
|
443 |
10 iconst_5 |
|
444 |
11 istore_0 |
|
445 |
12 bipush 6 |
|
446 |
14 istore_1 |
|
447 |
15 bipush 7 |
|
448 |
17 istore_0 |
|
449 |
18 bipush 8 |
|
450 |
20 istore_1 |
|
451 |
21 bipush 9 |
|
452 |
23 istore_1 |
|
453 |
24 iload_0 |
|
454 |
25 ireturn" |
|
455 |
||
456 |
"Created: / 14-03-2011 / 17:03:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
457 |
"Modified: / 20-03-2011 / 21:55:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
458 |
! |
|
459 |
||
460 |
testSumArray |
|
461 |
self shouldnt: [ |
|
462 |
||
463 |
self |
|
464 |
invoke: #'sumArray([I)I' |
|
465 |
class: self loadSimpleMathJavaClass |
|
466 |
args: #( #(1 2 3 4 5) ) |
|
467 |
||
468 |
] raise: Error. |
|
469 |
" |
|
470 |
Decompiled source: |
|
471 |
Static method |
|
472 |
0 iconst_0 |
|
473 |
1 istore_1 |
|
474 |
2 iconst_0 |
|
475 |
3 istore_2 |
|
476 |
4 iload_2 |
|
477 |
5 aload_0 |
|
478 |
6 arraylength |
|
479 |
7 if_icmpge 15 [22] |
|
480 |
10 iload_1 |
|
481 |
11 aload_0 |
|
482 |
12 iload_2 |
|
483 |
13 iaload |
|
484 |
14 iadd |
|
485 |
15 istore_1 |
|
486 |
16 iinc 2 1 |
|
487 |
19 goto -15 [4] |
|
488 |
22 iload_1 |
|
489 |
23 ireturn" |
|
490 |
||
491 |
"Created: / 14-03-2011 / 17:06:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
492 |
"Modified: / 20-03-2011 / 23:05:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
493 |
! |
|
494 |
||
495 |
testSumArrayOfDoubles |
|
496 |
self shouldnt: |
|
497 |
[self |
|
498 |
invoke: #'sumArrayOfDoubles([D)D' |
|
499 |
class: self loadSimpleMathJavaClass |
|
500 |
args: #( #(1.1 2.2 3.3 4.4 5.5) ) ] |
|
501 |
raise: Error. |
|
502 |
"0 dconst_0 |
|
503 |
1 dstore_1 |
|
504 |
2 iconst_0 |
|
505 |
3 istore_3 |
|
506 |
4 iload_3 |
|
507 |
5 aload_0 |
|
508 |
6 arraylength |
|
509 |
7 if_icmpge 15 [22] |
|
510 |
10 dload_1 |
|
511 |
11 aload_0 |
|
512 |
12 iload_3 |
|
513 |
13 daload |
|
514 |
14 dadd |
|
515 |
15 dstore_1 |
|
516 |
16 iinc 3 1 |
|
517 |
19 goto -15 [4] |
|
518 |
22 dload_1 |
|
519 |
23 dreturn" |
|
520 |
||
521 |
"Created: / 14-03-2011 / 17:07:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
522 |
"Modified: / 20-03-2011 / 21:55:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
523 |
! |
|
524 |
||
525 |
testTableSwitch |
|
526 |
self shouldnt: [ |
|
527 |
||
528 |
self |
|
529 |
invoke: #'switchChar(C)I' |
|
530 |
class: self loadSwitchExamplesClass |
|
531 |
receiver: self loadSwitchExamplesClass new |
|
532 |
args: #( $b ). |
|
533 |
||
534 |
] raise: Error. |
|
535 |
||
536 |
"Created: / 21-03-2011 / 13:51:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
537 |
"Modified: / 21-03-2011 / 15:02:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
538 |
! |
|
539 |
||
540 |
testUnsignedBitShiftLeft |
|
541 |
self shouldnt: |
|
542 |
[ self |
|
543 |
invoke: #'unsignedBitShiftRight(II)I' |
|
544 |
class: self loadSimpleMathJavaClass |
|
545 |
args: #( 1234 5 ) ] |
|
546 |
raise: Error. |
|
547 |
||
548 |
"0 iload_0 |
|
549 |
1 iload_1 |
|
550 |
2 iushr |
|
551 |
3 ireturn" |
|
552 |
||
553 |
"Created: / 14-03-2011 / 17:01:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
554 |
"Modified: / 20-03-2011 / 21:56:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
555 |
! |
|
556 |
||
557 |
testXor |
|
558 |
self shouldnt: |
|
559 |
[ self |
|
560 |
invoke: #'xor(II)I' |
|
561 |
class: self loadSimpleMathJavaClass |
|
562 |
args: #( 1234 5 )] |
|
563 |
raise: Error. |
|
564 |
||
565 |
"0 iload_0 |
|
566 |
1 iload_1 |
|
567 |
2 ixor |
|
568 |
3 ireturn" |
|
569 |
||
570 |
"Modified: / 06-03-2011 / 15:11:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
571 |
"Created: / 14-03-2011 / 17:02:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
572 |
"Modified: / 20-03-2011 / 21:56:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
573 |
! ! |
|
574 |
||
575 |
!JavaByteCodeDisassemblerTests methodsFor:'tests - manual'! |
|
576 |
||
577 |
diassembleAll |
|
578 |
| fails | |
|
579 |
||
580 |
fails := OrderedCollection new. |
|
581 |
JavaMethod allSubInstances do: |
|
582 |
[:method | |
|
583 |
method isNative |
|
584 |
ifFalse: |
|
585 |
[ [ JavaByteCodeDisassembler new diassemble: method to: String new writeStream ] |
|
586 |
on: Error |
|
587 |
do: [ fails add: method ] ] ]. |
|
588 |
fails size ~~ 0 |
|
589 |
ifTrue: [ self error: 'Some java methods failed to disassemble' ]. |
|
590 |
||
591 |
" |
|
592 |
JavaByteCodeDisassemblerTests new diassembleAll" |
|
593 |
||
594 |
"Created: / 21-03-2011 / 21:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
595 |
"Modified: / 22-03-2011 / 21:05:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
596 |
"Modified: / 23-03-2011 / 16:54:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
597 |
! ! |
|
598 |
||
599 |
!JavaByteCodeDisassemblerTests methodsFor:'tests-helpers'! |
|
600 |
||
601 |
invoke:methodName class:aClass receiver:receiver args:args |
|
602 |
|method result| |
|
603 |
||
604 |
method := aClass lookupMethodFor:methodName. |
|
605 |
result := JavaByteCodeDisassembler diassemble:method. |
|
606 |
||
607 |
"Created: / 10-03-2011 / 23:30:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
608 |
"Modified: / 20-03-2011 / 17:42:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
609 |
"Modified: / 22-03-2011 / 21:05:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
610 |
! ! |
|
611 |
||
612 |
!JavaByteCodeDisassemblerTests methodsFor:'tests2'! |
|
613 |
||
614 |
testGetBoolean |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
615 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
616 |
invoke: #'getBoolean()Z' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
617 |
class: self loadSimpleClassWithManyReferences |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
618 |
receiver: self loadSimpleClassWithManyReferences new |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
619 |
args: nil. |
749 | 620 |
|
621 |
" |
|
622 |
Deassembling getBoolean |
|
623 |
1: ALOAD_0 (42) ARGS: [] STACK: [.. -> FIELD 0: stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences] |
|
624 |
2: GETFIELD (180) ARGS: [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] STACK: [objectRef -> objectRef] |
|
625 |
5: BIPUSH (16) ARGS: [9] STACK: [.. -> value] |
|
626 |
7: AALOAD (50) ARGS: [] STACK: [arrayRef, index -> value] |
|
627 |
8: CHECKCAST (192) ARGS: [java.lang.Boolean] STACK: [objectRef -> objectRef] |
|
628 |
11: INVVIRT (182) ARGS: [JavaMethodRef (java.lang.Boolean 'booleanValue'()Z)] STACK: [objectRef, [arg1, arg2, ...] -> ..] |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
629 |
14: IRETURN (172) ARGS: [] STACK: [value -> EMPTY]" |
749 | 630 |
"Created: / 14-03-2011 / 21:36:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
631 |
"Modified: / 22-03-2011 / 16:06:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
632 |
! |
|
633 |
||
634 |
testGetByte |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
635 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
636 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
637 |
self |
749 | 638 |
invoke: #'getByte()B' |
639 |
class: self loadSimpleClassWithManyReferences |
|
640 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
641 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
642 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
643 |
raise: Error. |
749 | 644 |
|
645 |
"0 aload_0 |
|
646 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
647 |
4 bipush 7 |
|
648 |
6 aaload |
|
649 |
7 checkcast 17 [java.lang.Byte] |
|
650 |
10 invokevirtual 31 [JavaMethodRef (java.lang.Byte 'byteValue'()B)] |
|
651 |
13 ireturn" |
|
652 |
"Created: / 14-03-2011 / 21:34:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
653 |
"Modified: / 21-03-2011 / 15:38:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
654 |
! |
|
655 |
||
656 |
testGetChar |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
657 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
658 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
659 |
self |
749 | 660 |
invoke: #'getChar()C' |
661 |
class: self loadSimpleClassWithManyReferences |
|
662 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
663 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
664 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
665 |
raise: Error. |
749 | 666 |
|
667 |
"0 aload_0 |
|
668 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
669 |
4 iconst_3 |
|
670 |
5 aaload |
|
671 |
6 checkcast 25 [java.lang.Character] |
|
672 |
9 invokevirtual 26 [JavaMethodRef (java.lang.Character 'charValue'()C)] |
|
673 |
12 ireturn" |
|
674 |
"Created: / 14-03-2011 / 21:31:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
675 |
"Modified: / 21-03-2011 / 15:39:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
676 |
! |
|
677 |
||
678 |
testGetDateArray |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
679 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
680 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
681 |
self |
749 | 682 |
invoke: #'getDateArray()[Ljava/util/Date;' |
683 |
class: self loadSimpleClassWithManyReferences |
|
684 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
685 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
686 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
687 |
raise: Error. |
749 | 688 |
|
689 |
"0 aload_0 |
|
690 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
691 |
4 bipush 8 |
|
692 |
6 aaload |
|
693 |
7 checkcast 32 [UnresolvedClass([Ljava.util.Date;)] |
|
694 |
10 checkcast 32 [UnresolvedClass([Ljava.util.Date;)] |
|
695 |
13 areturn" |
|
696 |
"Created: / 14-03-2011 / 21:35:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
697 |
"Modified: / 21-03-2011 / 15:39:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
698 |
! |
|
699 |
||
700 |
testGetDouble |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
701 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
702 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
703 |
self |
749 | 704 |
invoke: #'getDouble()Ljava/lang/Double;' |
705 |
class: self loadSimpleClassWithManyReferences |
|
706 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
707 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
708 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
709 |
raise: Error. |
749 | 710 |
|
711 |
"0 aload_0 |
|
712 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
713 |
4 iconst_2 |
|
714 |
5 aaload |
|
715 |
6 checkcast 24 [java.lang.Double] |
|
716 |
9 areturn" |
|
717 |
"Created: / 14-03-2011 / 21:30:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
718 |
"Modified: / 21-03-2011 / 15:39:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
719 |
! |
|
720 |
||
721 |
testGetInt |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
722 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
723 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
724 |
self |
749 | 725 |
invoke: #'getInt()I' |
726 |
class: self loadSimpleClassWithManyReferences |
|
727 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
728 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
729 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
730 |
raise: Error. |
749 | 731 |
|
732 |
"0 aload_0 |
|
733 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
734 |
4 iconst_1 |
|
735 |
5 aaload |
|
736 |
6 checkcast 13 [java.lang.Integer] |
|
737 |
9 invokevirtual 23 [JavaMethodRef (java.lang.Integer 'intValue'()I)] |
|
738 |
12 ireturn" |
|
739 |
"Created: / 14-03-2011 / 21:30:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
740 |
"Modified: / 21-03-2011 / 15:39:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
741 |
! |
|
742 |
||
743 |
testGetIntArray |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
744 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
745 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
746 |
self |
749 | 747 |
invoke: #'getIntArray()[I' |
748 |
class: self loadSimpleClassWithManyReferences |
|
749 |
receiver: self loadSimpleClassWithManyReferences new |
|
750 |
args: nil. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
751 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
752 |
raise: Error. |
749 | 753 |
|
754 |
"0 aload_0 |
|
755 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
756 |
4 iconst_5 |
|
757 |
5 aaload |
|
758 |
6 checkcast 29 [JavaBuiltInClassPointerRef(class:IntegerArray ; name&type: '[I')] |
|
759 |
9 checkcast 29 [JavaBuiltInClassPointerRef(class:IntegerArray ; name&type: '[I')] |
|
760 |
12 areturn" |
|
761 |
"Created: / 14-03-2011 / 21:33:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
762 |
"Modified: / 21-03-2011 / 15:40:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
763 |
! |
|
764 |
||
765 |
testGetLong |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
766 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
767 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
768 |
self |
749 | 769 |
invoke: #'getLong()J' |
770 |
class: self loadSimpleClassWithManyReferences |
|
771 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
772 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
773 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
774 |
raise: Error. |
749 | 775 |
|
776 |
"0 aload_0 |
|
777 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
778 |
4 iconst_4 |
|
779 |
5 aaload |
|
780 |
6 checkcast 27 [java.lang.Long] |
|
781 |
9 invokevirtual 28 [JavaMethodRef (java.lang.Long 'longValue'()J)] |
|
782 |
12 lreturn" |
|
783 |
"Created: / 14-03-2011 / 21:32:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
784 |
"Modified: / 21-03-2011 / 15:40:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
785 |
! |
|
786 |
||
787 |
testGetShort |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
788 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
789 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
790 |
self |
749 | 791 |
invoke: #'getShort()S' |
792 |
class: self loadSimpleClassWithManyReferences |
|
793 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
794 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
795 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
796 |
raise: Error. |
749 | 797 |
|
798 |
"0 aload_0 |
|
799 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
800 |
4 bipush 6 |
|
801 |
6 aaload |
|
802 |
7 checkcast 14 [java.lang.Short] |
|
803 |
10 invokevirtual 30 [JavaMethodRef (java.lang.Short 'shortValue'()S)] |
|
804 |
13 ireturn" |
|
805 |
"Created: / 14-03-2011 / 21:33:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
806 |
"Modified: / 21-03-2011 / 15:40:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
807 |
! |
|
808 |
||
809 |
testGetString |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
810 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
811 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
812 |
self |
749 | 813 |
invoke: #'getString()Ljava/lang/String;' |
814 |
class: self loadSimpleClassWithManyReferences |
|
815 |
receiver: self loadSimpleClassWithManyReferences new |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
816 |
args: nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
817 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
818 |
raise: Error. |
749 | 819 |
|
820 |
"0 aload_0 |
|
821 |
1 getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] |
|
822 |
4 iconst_0 |
|
823 |
5 aaload |
|
824 |
6 checkcast 22 [java.lang.String] |
|
825 |
9 areturn" |
|
826 |
"Created: / 14-03-2011 / 21:27:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
827 |
"Modified: / 21-03-2011 / 15:40:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
828 |
! |
|
829 |
||
830 |
testMultiBytePrintString |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
831 |
<skip> |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
832 |
| badClass | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
833 |
badClass := Java classForName: 'java.nio.charset.CharsetDecoder'. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
834 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
835 |
invoke: #'<init>(Ljava/nio/charset/Charset;FF)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
836 |
class: badClass |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
837 |
args: #( 21 4 ). |
749 | 838 |
|
839 |
"Created: / 23-03-2011 / 16:58:50 / 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:
2152
diff
changeset
|
840 |
"Modified (format): / 06-07-2012 / 21:57: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:
2152
diff
changeset
|
841 |
"Modified: / 01-12-2012 / 14:04:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
749 | 842 |
! |
843 |
||
844 |
testSetBoolean |
|
845 |
self |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
846 |
shouldnt: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
847 |
self |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
848 |
invoke: #'setBoolean(I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
849 |
class: self loadSimpleClassWithManyReferences |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
850 |
receiver: self loadSimpleClassWithManyReferences new |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
851 |
args: nil. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
852 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
853 |
raise: Error. |
749 | 854 |
|
855 |
"Created: / 22-03-2011 / 12:17:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
856 |
! ! |
|
857 |
||
858 |
!JavaByteCodeDisassemblerTests class methodsFor:'documentation'! |
|
859 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
860 |
version_CVS |
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
861 |
^ '$Header: /cvs/stx/stx/libjava/JavaByteCodeDisassemblerTests.st,v 1.6 2015-03-20 12:07:59 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
862 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
863 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
864 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
865 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
866 |
^ '$Changeset: <not expanded> $' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
867 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
868 |
|
749 | 869 |
version_SVN |
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
870 |
^ 'Id' |
2152 | 871 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
872 |