|
1 " |
|
2 COPYRIGHT (c) 2003 by Claus Gittinger |
|
3 All Rights Reserved |
|
4 |
|
5 This software is furnished under a license and may be used |
|
6 only in accordance with the terms of that license and with the |
|
7 inclusion of the above copyright notice. This software may not |
|
8 be provided or otherwise made available to, or used by, any |
|
9 other person. No title to or ownership of the software is |
|
10 hereby transferred. |
|
11 " |
|
12 "{ Package: 'stx:libjava' }" |
|
13 |
|
14 Object subclass:#JavaByteCodeProcessor |
|
15 instanceVariableNames:'byteCode pc method constantPool context receiver sp retVal |
|
16 instrPointer op wide numArgs numVars leaveProcessor' |
|
17 classVariableNames:'OpSwitchTable Verbose' |
|
18 poolDictionaries:'' |
|
19 category:'Languages-Java-Bytecode' |
|
20 ! |
|
21 |
|
22 !JavaByteCodeProcessor class methodsFor:'documentation'! |
|
23 |
|
24 copyright |
|
25 " |
|
26 COPYRIGHT (c) 2003 by Claus Gittinger |
|
27 All Rights Reserved |
|
28 |
|
29 This software is furnished under a license and may be used |
|
30 only in accordance with the terms of that license and with the |
|
31 inclusion of the above copyright notice. This software may not |
|
32 be provided or otherwise made available to, or used by, any |
|
33 other person. No title to or ownership of the software is |
|
34 hereby transferred. |
|
35 " |
|
36 ! |
|
37 |
|
38 documentation |
|
39 " |
|
40 Base class for processing Java bytecode. |
|
41 This class is based on NewCompiler::JavaByteCodeProcessor |
|
42 written originally by Claus Gittinger |
|
43 |
|
44 [author:] |
|
45 Jan Vrany (jan.vrany@fit.cvut.cz) |
|
46 |
|
47 [instance variables:] |
|
48 |
|
49 [class variables:] |
|
50 |
|
51 [see also:] |
|
52 |
|
53 " |
|
54 ! ! |
|
55 |
|
56 !JavaByteCodeProcessor class methodsFor:'initialization'! |
|
57 |
|
58 initialize |
|
59 OpSwitchTable := Array new: 256. |
|
60 OpSwitchTable at: 1 + 0 put: #nop. |
|
61 OpSwitchTable at: 1 + 1 put: #'aconst_null'. |
|
62 OpSwitchTable at: 1 + 2 put: #'iconst_m1'. |
|
63 OpSwitchTable at: 1 + 3 put: #'iconst_0'. |
|
64 OpSwitchTable at: 1 + 4 put: #'iconst_1'. |
|
65 OpSwitchTable at: 1 + 5 put: #'iconst_2'. |
|
66 OpSwitchTable at: 1 + 6 put: #'iconst_3'. |
|
67 OpSwitchTable at: 1 + 7 put: #'iconst_4'. |
|
68 OpSwitchTable at: 1 + 8 put: #'iconst_5'. |
|
69 OpSwitchTable at: 1 + 9 put: #'lconst_0'. |
|
70 OpSwitchTable at: 1 + 10 put: #'lconst_1'. |
|
71 OpSwitchTable at: 1 + 11 put: #'fconst_0'. |
|
72 OpSwitchTable at: 1 + 12 put: #'fconst_1'. |
|
73 OpSwitchTable at: 1 + 13 put: #'fconst_2'. |
|
74 OpSwitchTable at: 1 + 14 put: #'dconst_0'. |
|
75 OpSwitchTable at: 1 + 15 put: #'dconst_1'. |
|
76 OpSwitchTable at: 1 + 16 put: #bipush. |
|
77 OpSwitchTable at: 1 + 17 put: #sipush. |
|
78 OpSwitchTable at: 1 + 18 put: #ldc1. |
|
79 OpSwitchTable at: 1 + 19 put: #ldc2. |
|
80 OpSwitchTable at: 1 + 20 put: #ldc2w. |
|
81 OpSwitchTable at: 1 + 21 put: #iload. |
|
82 OpSwitchTable at: 1 + 22 put: #lload. |
|
83 OpSwitchTable at: 1 + 23 put: #fload. |
|
84 OpSwitchTable at: 1 + 24 put: #dload. |
|
85 OpSwitchTable at: 1 + 25 put: #aload. |
|
86 OpSwitchTable at: 1 + 26 put: #'iload_0'. |
|
87 OpSwitchTable at: 1 + 27 put: #'iload_1'. |
|
88 OpSwitchTable at: 1 + 28 put: #'iload_2'. |
|
89 OpSwitchTable at: 1 + 29 put: #'iload_3'. |
|
90 OpSwitchTable at: 1 + 30 put: #'lload_0'. |
|
91 OpSwitchTable at: 1 + 31 put: #'lload_1'. |
|
92 OpSwitchTable at: 1 + 32 put: #'lload_2'. |
|
93 OpSwitchTable at: 1 + 33 put: #'lload_3'. |
|
94 OpSwitchTable at: 1 + 34 put: #'fload_0'. |
|
95 OpSwitchTable at: 1 + 35 put: #'fload_1'. |
|
96 OpSwitchTable at: 1 + 36 put: #'fload_2'. |
|
97 OpSwitchTable at: 1 + 37 put: #'fload_3'. |
|
98 OpSwitchTable at: 1 + 38 put: #'dload_0'. |
|
99 OpSwitchTable at: 1 + 39 put: #'dload_1'. |
|
100 OpSwitchTable at: 1 + 40 put: #'dload_2'. |
|
101 OpSwitchTable at: 1 + 41 put: #'dload_3'. |
|
102 OpSwitchTable at: 1 + 42 put: #'aload_0'. |
|
103 OpSwitchTable at: 1 + 43 put: #'aload_1'. |
|
104 OpSwitchTable at: 1 + 44 put: #'aload_2'. |
|
105 OpSwitchTable at: 1 + 45 put: #'aload_3'. |
|
106 OpSwitchTable at: 1 + 46 put: #iaload. |
|
107 OpSwitchTable at: 1 + 47 put: #laload. |
|
108 OpSwitchTable at: 1 + 48 put: #faload. |
|
109 OpSwitchTable at: 1 + 49 put: #daload. |
|
110 OpSwitchTable at: 1 + 50 put: #aaload. |
|
111 OpSwitchTable at: 1 + 51 put: #baload. |
|
112 OpSwitchTable at: 1 + 52 put: #caload. |
|
113 OpSwitchTable at: 1 + 53 put: #saload. |
|
114 OpSwitchTable at: 1 + 54 put: #istore. |
|
115 OpSwitchTable at: 1 + 55 put: #lstore. |
|
116 OpSwitchTable at: 1 + 56 put: #fstore. |
|
117 OpSwitchTable at: 1 + 57 put: #dstore. |
|
118 OpSwitchTable at: 1 + 58 put: #astore. |
|
119 OpSwitchTable at: 1 + 59 put: #'istore_0'. |
|
120 OpSwitchTable at: 1 + 60 put: #'istore_1'. |
|
121 OpSwitchTable at: 1 + 61 put: #'istore_2'. |
|
122 OpSwitchTable at: 1 + 62 put: #'istore_3'. |
|
123 OpSwitchTable at: 1 + 63 put: #'lstore_0'. |
|
124 OpSwitchTable at: 1 + 64 put: #'lstore_1'. |
|
125 OpSwitchTable at: 1 + 65 put: #'lstore_2'. |
|
126 OpSwitchTable at: 1 + 66 put: #'lstore_3'. |
|
127 OpSwitchTable at: 1 + 67 put: #'fstore_0'. |
|
128 OpSwitchTable at: 1 + 68 put: #'fstore_1'. |
|
129 OpSwitchTable at: 1 + 69 put: #'fstore_2'. |
|
130 OpSwitchTable at: 1 + 70 put: #'fstore_3'. |
|
131 OpSwitchTable at: 1 + 71 put: #'dstore_0'. |
|
132 OpSwitchTable at: 1 + 72 put: #'dstore_1'. |
|
133 OpSwitchTable at: 1 + 73 put: #'dstore_2'. |
|
134 OpSwitchTable at: 1 + 74 put: #'dstore_3'. |
|
135 OpSwitchTable at: 1 + 75 put: #'astore_0'. |
|
136 OpSwitchTable at: 1 + 76 put: #'astore_1'. |
|
137 OpSwitchTable at: 1 + 77 put: #'astore_2'. |
|
138 OpSwitchTable at: 1 + 78 put: #'astore_3'. |
|
139 OpSwitchTable at: 1 + 79 put: #iastore. |
|
140 OpSwitchTable at: 1 + 80 put: #lastore. |
|
141 OpSwitchTable at: 1 + 81 put: #fastore. |
|
142 OpSwitchTable at: 1 + 82 put: #dastore. |
|
143 OpSwitchTable at: 1 + 83 put: #aastore. |
|
144 OpSwitchTable at: 1 + 84 put: #bastore. |
|
145 OpSwitchTable at: 1 + 85 put: #castore. |
|
146 OpSwitchTable at: 1 + 86 put: #sastore. |
|
147 OpSwitchTable at: 1 + 87 put: #pop1. |
|
148 OpSwitchTable at: 1 + 88 put: #pop2. |
|
149 OpSwitchTable at: 1 + 89 put: #dup. |
|
150 OpSwitchTable at: 1 + 90 put: #'dup_x1'. |
|
151 OpSwitchTable at: 1 + 91 put: #'dup_x2'. |
|
152 OpSwitchTable at: 1 + 92 put: #dup2. |
|
153 OpSwitchTable at: 1 + 93 put: #'dup2_x1'. |
|
154 OpSwitchTable at: 1 + 94 put: #'dup2_x2'. |
|
155 OpSwitchTable at: 1 + 95 put: #swap. |
|
156 OpSwitchTable at: 1 + 96 put: #iadd. |
|
157 OpSwitchTable at: 1 + 97 put: #ladd. |
|
158 OpSwitchTable at: 1 + 98 put: #fadd. |
|
159 OpSwitchTable at: 1 + 99 put: #dadd. |
|
160 OpSwitchTable at: 1 + 100 put: #isub. |
|
161 OpSwitchTable at: 1 + 101 put: #lsub. |
|
162 OpSwitchTable at: 1 + 102 put: #fsub. |
|
163 OpSwitchTable at: 1 + 103 put: #dsub. |
|
164 OpSwitchTable at: 1 + 104 put: #imul. |
|
165 OpSwitchTable at: 1 + 105 put: #lmul. |
|
166 OpSwitchTable at: 1 + 106 put: #fmul. |
|
167 OpSwitchTable at: 1 + 107 put: #dmul. |
|
168 OpSwitchTable at: 1 + 108 put: #idiv. |
|
169 OpSwitchTable at: 1 + 109 put: #ldiv. |
|
170 OpSwitchTable at: 1 + 110 put: #fdiv. |
|
171 OpSwitchTable at: 1 + 111 put: #ddiv. |
|
172 OpSwitchTable at: 1 + 112 put: #irem. |
|
173 OpSwitchTable at: 1 + 113 put: #lrem. |
|
174 OpSwitchTable at: 1 + 114 put: #frem. |
|
175 OpSwitchTable at: 1 + 115 put: #drem. |
|
176 OpSwitchTable at: 1 + 116 put: #ineg. |
|
177 OpSwitchTable at: 1 + 117 put: #lneg. |
|
178 OpSwitchTable at: 1 + 118 put: #fneg. |
|
179 OpSwitchTable at: 1 + 119 put: #dneg. |
|
180 OpSwitchTable at: 1 + 120 put: #ishl. |
|
181 OpSwitchTable at: 1 + 121 put: #lshl. |
|
182 OpSwitchTable at: 1 + 122 put: #ishr. |
|
183 OpSwitchTable at: 1 + 123 put: #lshr. |
|
184 OpSwitchTable at: 1 + 124 put: #iushr. |
|
185 OpSwitchTable at: 1 + 125 put: #lushr. |
|
186 OpSwitchTable at: 1 + 126 put: #iand. |
|
187 OpSwitchTable at: 1 + 127 put: #land. |
|
188 OpSwitchTable at: 1 + 128 put: #ior. |
|
189 OpSwitchTable at: 1 + 129 put: #lor. |
|
190 OpSwitchTable at: 1 + 130 put: #ixor. |
|
191 OpSwitchTable at: 1 + 131 put: #lxor. |
|
192 OpSwitchTable at: 1 + 132 put: #iinc. |
|
193 OpSwitchTable at: 1 + 133 put: #i2l. |
|
194 OpSwitchTable at: 1 + 134 put: #i2f. |
|
195 OpSwitchTable at: 1 + 135 put: #i2d. |
|
196 OpSwitchTable at: 1 + 136 put: #l2i. |
|
197 OpSwitchTable at: 1 + 137 put: #l2f. |
|
198 OpSwitchTable at: 1 + 138 put: #l2d. |
|
199 OpSwitchTable at: 1 + 139 put: #f2i. |
|
200 OpSwitchTable at: 1 + 140 put: #f2l. |
|
201 OpSwitchTable at: 1 + 141 put: #f2d. |
|
202 OpSwitchTable at: 1 + 142 put: #d2i. |
|
203 OpSwitchTable at: 1 + 143 put: #d2l. |
|
204 OpSwitchTable at: 1 + 144 put: #d2f. |
|
205 OpSwitchTable at: 1 + 145 put: #int2byte. |
|
206 OpSwitchTable at: 1 + 146 put: #int2char. |
|
207 OpSwitchTable at: 1 + 147 put: #int2short. |
|
208 OpSwitchTable at: 1 + 148 put: #lcmp. |
|
209 OpSwitchTable at: 1 + 149 put: #fcmpl. |
|
210 OpSwitchTable at: 1 + 150 put: #fcmpg. |
|
211 OpSwitchTable at: 1 + 151 put: #dcmpl. |
|
212 OpSwitchTable at: 1 + 152 put: #dcmpg. |
|
213 OpSwitchTable at: 1 + 153 put: #ifeq. |
|
214 OpSwitchTable at: 1 + 154 put: #ifne. |
|
215 OpSwitchTable at: 1 + 155 put: #iflt. |
|
216 OpSwitchTable at: 1 + 156 put: #ifge. |
|
217 OpSwitchTable at: 1 + 157 put: #ifgt. |
|
218 OpSwitchTable at: 1 + 158 put: #ifle. |
|
219 OpSwitchTable at: 1 + 159 put: #ificmpeq. |
|
220 OpSwitchTable at: 1 + 160 put: #ificmpne. |
|
221 OpSwitchTable at: 1 + 161 put: #ificmplt. |
|
222 OpSwitchTable at: 1 + 162 put: #ificmpge. |
|
223 OpSwitchTable at: 1 + 163 put: #ificmpgt. |
|
224 OpSwitchTable at: 1 + 164 put: #ificmple. |
|
225 OpSwitchTable at: 1 + 165 put: #ifacmpeq. |
|
226 OpSwitchTable at: 1 + 166 put: #ifacmpne. |
|
227 OpSwitchTable at: 1 + 167 put: #goto. |
|
228 OpSwitchTable at: 1 + 168 put: #jsr. |
|
229 OpSwitchTable at: 1 + 169 put: #ret. |
|
230 OpSwitchTable at: 1 + 170 put: #tableswtch. |
|
231 OpSwitchTable at: 1 + 171 put: #lookupswtch. |
|
232 OpSwitchTable at: 1 + 172 put: #ireturn. |
|
233 OpSwitchTable at: 1 + 173 put: #lreturn. |
|
234 OpSwitchTable at: 1 + 174 put: #freturn. |
|
235 OpSwitchTable at: 1 + 175 put: #dreturn. |
|
236 OpSwitchTable at: 1 + 176 put: #areturn. |
|
237 OpSwitchTable at: 1 + 177 put: #return. |
|
238 OpSwitchTable at: 1 + 178 put: #getstatic. |
|
239 OpSwitchTable at: 1 + 179 put: #putstatic. |
|
240 OpSwitchTable at: 1 + 180 put: #getfield. |
|
241 OpSwitchTable at: 1 + 181 put: #putfield. |
|
242 OpSwitchTable at: 1 + 182 put: #invvirt. |
|
243 OpSwitchTable at: 1 + 183 put: #invnonvirt. |
|
244 OpSwitchTable at: 1 + 184 put: #invstatic. |
|
245 OpSwitchTable at: 1 + 185 put: #invinterface. |
|
246 OpSwitchTable at: 1 + 187 put: #new. |
|
247 OpSwitchTable at: 1 + 188 put: #newarray. |
|
248 OpSwitchTable at: 1 + 189 put: #anewarray. |
|
249 OpSwitchTable at: 1 + 190 put: #arraylength. |
|
250 OpSwitchTable at: 1 + 191 put: #athrow. |
|
251 OpSwitchTable at: 1 + 192 put: #checkcast. |
|
252 OpSwitchTable at: 1 + 193 put: #instanceof. |
|
253 OpSwitchTable at: 1 + 194 put: #monenter. |
|
254 OpSwitchTable at: 1 + 195 put: #monexit. |
|
255 OpSwitchTable at: 1 + 196 put: #wide. |
|
256 OpSwitchTable at: 1 + 197 put: #multianewarray. |
|
257 OpSwitchTable at: 1 + 198 put: #ifnull. |
|
258 OpSwitchTable at: 1 + 199 put: #ifnonnull. |
|
259 OpSwitchTable at: 1 + 200 put: #'goto_w'. |
|
260 OpSwitchTable at: 1 + 201 put: #'jsr_w'. |
|
261 OpSwitchTable at: 1 + 202 put: #breakpoint. |
|
262 OpSwitchTable at: 1 + 203 put: #'ret_w'. |
|
263 |
|
264 Verbose := false. |
|
265 " |
|
266 self initialize" |
|
267 |
|
268 "Created: / 17-03-2011 / 14:56:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
269 "Modified: / 17-03-2011 / 16:43:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
270 "Modified: / 21-03-2011 / 20:23:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
271 ! ! |
|
272 |
|
273 !JavaByteCodeProcessor class methodsFor:'accessing'! |
|
274 |
|
275 verbose: bool |
|
276 Verbose := bool. |
|
277 |
|
278 "Created: / 21-03-2011 / 18:32:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
279 ! ! |
|
280 |
|
281 !JavaByteCodeProcessor class methodsFor:'private-logging'! |
|
282 |
|
283 log: aMessage |
|
284 Verbose ifTrue: [ |
|
285 ('JAVA [info]: ' , aMessage) infoPrintCR.]. |
|
286 |
|
287 "Created: / 17-03-2011 / 14:59:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
288 ! ! |
|
289 |
|
290 !JavaByteCodeProcessor methodsFor:'initialization'! |
|
291 |
|
292 reset |
|
293 pc := method startPC. |
|
294 byteCode := method byteCode. |
|
295 constantPool := method javaClass constantPool. |
|
296 |
|
297 "Modified: / 17-03-2011 / 14:53:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
298 ! ! |
|
299 |
|
300 !JavaByteCodeProcessor methodsFor:'instructions'! |
|
301 |
|
302 aaload |
|
303 "raise an error: must be redefined in concrete subclass(es)" |
|
304 |
|
305 ^ self subclassResponsibility |
|
306 ! |
|
307 |
|
308 aastore |
|
309 "raise an error: must be redefined in concrete subclass(es)" |
|
310 |
|
311 ^ self subclassResponsibility |
|
312 ! |
|
313 |
|
314 aconst_null |
|
315 "raise an error: must be redefined in concrete subclass(es)" |
|
316 |
|
317 ^ self subclassResponsibility |
|
318 ! |
|
319 |
|
320 aload |
|
321 "raise an error: must be redefined in concrete subclass(es)" |
|
322 |
|
323 ^ self subclassResponsibility |
|
324 |
|
325 "Created: / 17-03-2011 / 15:07:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
326 ! |
|
327 |
|
328 aload: arg |
|
329 " |
|
330 Load reference from local variable 0 |
|
331 nothing -> objectRef" |
|
332 "raise an error: must be redefined in concrete subclass(es)" |
|
333 |
|
334 ^ self subclassResponsibility |
|
335 " |
|
336 Description |
|
337 The <n> must be an index into the local variable array of the |
|
338 current frame (§3.6). The local variable at <n> must contain a |
|
339 reference. The objectref in the local variable at index is pushed |
|
340 onto the operand stack. |
|
341 |
|
342 Notes |
|
343 An aload_<n> instruction cannot be used to load a value of type |
|
344 returnAddress from a local variable onto the operand stack. This |
|
345 asymmetry with the corresponding astore_<n> instruction is intentional. |
|
346 Each of the aload_<n> instructions is the same as aload with an index |
|
347 of <n>, except that the operand <n> is implicit." |
|
348 |
|
349 "Modified: / 17-03-2011 / 15:26:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
350 ! |
|
351 |
|
352 aload_0 |
|
353 " |
|
354 Load reference from local variable 0 |
|
355 nothing -> objectRef" |
|
356 |
|
357 self aload: 0. |
|
358 |
|
359 " |
|
360 Description |
|
361 The <n> must be an index into the local variable array of the |
|
362 current frame (§3.6). The local variable at <n> must contain a |
|
363 reference. The objectref in the local variable at index is pushed |
|
364 onto the operand stack. |
|
365 |
|
366 Notes |
|
367 An aload_<n> instruction cannot be used to load a value of type |
|
368 returnAddress from a local variable onto the operand stack. This |
|
369 asymmetry with the corresponding astore_<n> instruction is intentional. |
|
370 Each of the aload_<n> instructions is the same as aload with an index |
|
371 of <n>, except that the operand <n> is implicit." |
|
372 |
|
373 "Created: / 10-03-2011 / 21:42:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
374 "Modified: / 13-03-2011 / 16:56:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
375 ! |
|
376 |
|
377 aload_1 |
|
378 self aload: 1. |
|
379 |
|
380 "Created: / 10-03-2011 / 21:42:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
381 "Modified: / 13-03-2011 / 16:56:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
382 ! |
|
383 |
|
384 aload_2 |
|
385 self aload: 2. |
|
386 |
|
387 "Created: / 10-03-2011 / 21:42:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
388 "Modified: / 13-03-2011 / 16:56:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
389 ! |
|
390 |
|
391 aload_3 |
|
392 self aload: 3. |
|
393 |
|
394 "Created: / 10-03-2011 / 21:43:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
395 "Modified: / 13-03-2011 / 16:56:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
396 ! |
|
397 |
|
398 anewarray |
|
399 "raise an error: must be redefined in concrete subclass(es)" |
|
400 |
|
401 ^ self subclassResponsibility |
|
402 |
|
403 "Created: / 17-03-2011 / 16:57:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
404 ! |
|
405 |
|
406 areturn |
|
407 "raise an error: must be redefined in concrete subclass(es)" |
|
408 |
|
409 ^ self subclassResponsibility |
|
410 ! |
|
411 |
|
412 arraylength |
|
413 "raise an error: must be redefined in concrete subclass(es)" |
|
414 |
|
415 ^ self subclassResponsibility |
|
416 ! |
|
417 |
|
418 astore |
|
419 "raise an error: must be redefined in concrete subclass(es)" |
|
420 |
|
421 ^ self subclassResponsibility |
|
422 |
|
423 "Created: / 17-03-2011 / 16:37:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
424 ! |
|
425 |
|
426 astore:arg |
|
427 "raise an error: must be redefined in concrete subclass(es)" |
|
428 |
|
429 ^ self subclassResponsibility |
|
430 ! |
|
431 |
|
432 astore_0 |
|
433 |
|
434 |
|
435 ^self astore: 0. |
|
436 |
|
437 "Created: / 17-03-2011 / 16:39:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
438 ! |
|
439 |
|
440 astore_1 |
|
441 ^ self astore: 1. |
|
442 |
|
443 "Created: / 17-03-2011 / 16:39:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
444 ! |
|
445 |
|
446 astore_2 |
|
447 ^ self astore: 2. |
|
448 |
|
449 "Created: / 17-03-2011 / 16:39:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
450 ! |
|
451 |
|
452 astore_3 |
|
453 ^ self astore: 3. |
|
454 |
|
455 "Created: / 17-03-2011 / 16:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
456 ! |
|
457 |
|
458 athrow |
|
459 "raise an error: must be redefined in concrete subclass(es)" |
|
460 |
|
461 ^ self subclassResponsibility |
|
462 |
|
463 "Created: / 17-03-2011 / 16:57:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
464 ! |
|
465 |
|
466 baload |
|
467 "raise an error: must be redefined in concrete subclass(es)" |
|
468 |
|
469 ^ self subclassResponsibility |
|
470 ! |
|
471 |
|
472 bastore |
|
473 "raise an error: must be redefined in concrete subclass(es)" |
|
474 |
|
475 ^ self subclassResponsibility |
|
476 ! |
|
477 |
|
478 bipush |
|
479 "raise an error: must be redefined in concrete subclass(es)" |
|
480 |
|
481 ^ self subclassResponsibility |
|
482 ! |
|
483 |
|
484 breakpoint |
|
485 "raise an error: must be redefined in concrete subclass(es)" |
|
486 |
|
487 ^ self subclassResponsibility |
|
488 |
|
489 "Created: / 17-03-2011 / 16:59:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
490 ! |
|
491 |
|
492 caload |
|
493 "raise an error: must be redefined in concrete subclass(es)" |
|
494 |
|
495 ^ self subclassResponsibility |
|
496 ! |
|
497 |
|
498 castore |
|
499 "raise an error: must be redefined in concrete subclass(es)" |
|
500 |
|
501 ^ self subclassResponsibility |
|
502 ! |
|
503 |
|
504 checkcast |
|
505 "raise an error: must be redefined in concrete subclass(es)" |
|
506 |
|
507 ^ self subclassResponsibility |
|
508 |
|
509 "Created: / 17-03-2011 / 16:57:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
510 ! |
|
511 |
|
512 d2f |
|
513 "raise an error: must be redefined in concrete subclass(es)" |
|
514 |
|
515 ^ self subclassResponsibility |
|
516 |
|
517 "Created: / 17-03-2011 / 16:50:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
518 ! |
|
519 |
|
520 d2i |
|
521 "raise an error: must be redefined in concrete subclass(es)" |
|
522 |
|
523 ^ self subclassResponsibility |
|
524 |
|
525 "Created: / 17-03-2011 / 16:50:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
526 ! |
|
527 |
|
528 d2l |
|
529 "raise an error: must be redefined in concrete subclass(es)" |
|
530 |
|
531 ^ self subclassResponsibility |
|
532 |
|
533 "Created: / 17-03-2011 / 16:50:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
534 ! |
|
535 |
|
536 dadd |
|
537 "raise an error: must be redefined in concrete subclass(es)" |
|
538 |
|
539 ^ self subclassResponsibility |
|
540 ! |
|
541 |
|
542 daload |
|
543 "raise an error: must be redefined in concrete subclass(es)" |
|
544 |
|
545 ^ self subclassResponsibility |
|
546 ! |
|
547 |
|
548 dastore |
|
549 "raise an error: must be redefined in concrete subclass(es)" |
|
550 |
|
551 ^ self subclassResponsibility |
|
552 ! |
|
553 |
|
554 dcmpg |
|
555 "raise an error: must be redefined in concrete subclass(es)" |
|
556 |
|
557 ^ self subclassResponsibility |
|
558 |
|
559 "Created: / 17-03-2011 / 16:52:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
560 ! |
|
561 |
|
562 dcmpl |
|
563 "raise an error: must be redefined in concrete subclass(es)" |
|
564 |
|
565 ^ self subclassResponsibility |
|
566 |
|
567 "Created: / 17-03-2011 / 16:52:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
568 ! |
|
569 |
|
570 dconst: arg |
|
571 "Push the double constant <d> (0.0 or 1.0) onto the operand stack. |
|
572 stack: nothing -> const |
|
573 args: nothing" |
|
574 "raise an error: must be redefined in concrete subclass(es)" |
|
575 |
|
576 ^ self subclassResponsibility |
|
577 |
|
578 "Modified: / 17-03-2011 / 15:27:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
579 ! |
|
580 |
|
581 dconst_0 |
|
582 " |
|
583 Push the double constant <d> (0.0 or 1.0) onto the operand stack. |
|
584 stack: nothing -> const |
|
585 args: nothing |
|
586 " |
|
587 self dconst: 0. |
|
588 |
|
589 "Created: / 14-03-2011 / 18:02:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
590 ! |
|
591 |
|
592 dconst_1 |
|
593 " |
|
594 Push the double constant <d> (0.0 or 1.0) onto the operand stack. |
|
595 stack: nothing -> const |
|
596 args: nothing" |
|
597 |
|
598 self dconst: 1. |
|
599 |
|
600 "Created: / 14-03-2011 / 18:03:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
601 ! |
|
602 |
|
603 ddiv |
|
604 "raise an error: must be redefined in concrete subclass(es)" |
|
605 |
|
606 ^ self subclassResponsibility |
|
607 |
|
608 "Created: / 17-03-2011 / 16:46:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
609 ! |
|
610 |
|
611 dload |
|
612 "raise an error: must be redefined in concrete subclass(es)" |
|
613 |
|
614 ^ self subclassResponsibility |
|
615 |
|
616 "Created: / 17-03-2011 / 15:07:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
617 ! |
|
618 |
|
619 dload: arg |
|
620 " |
|
621 Load double from local variable |
|
622 stack: nothing -> value |
|
623 args: nothing" |
|
624 "raise an error: must be redefined in concrete subclass(es)" |
|
625 |
|
626 ^ self subclassResponsibility |
|
627 " |
|
628 Description |
|
629 Both <n> and <n> + 1 must be indices into the local variable array of the current frame (§3.6). |
|
630 The local variable at <n> must contain a double. The value of the local variable at <n> is pushed |
|
631 onto the operand stack. |
|
632 |
|
633 Notes |
|
634 Each of the dload_<n> instructions is the same as dload with an index of <n>, except that the |
|
635 operand <n> is implicit." |
|
636 |
|
637 "Modified: / 17-03-2011 / 15:26:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
638 ! |
|
639 |
|
640 dload_0 |
|
641 " |
|
642 Load double from local variable |
|
643 stack: nothing -> value |
|
644 args: nothing" |
|
645 |
|
646 self dload: 0. |
|
647 |
|
648 " |
|
649 Description |
|
650 Both <n> and <n> + 1 must be indices into the local variable array of the current frame (§3.6). |
|
651 The local variable at <n> must contain a double. The value of the local variable at <n> is pushed |
|
652 onto the operand stack. |
|
653 |
|
654 Notes |
|
655 Each of the dload_<n> instructions is the same as dload with an index of <n>, except that the |
|
656 operand <n> is implicit." |
|
657 |
|
658 "Created: / 13-03-2011 / 17:55:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
659 ! |
|
660 |
|
661 dload_1 |
|
662 self dload: 1. |
|
663 |
|
664 "Created: / 13-03-2011 / 17:55:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
665 ! |
|
666 |
|
667 dload_2 |
|
668 self dload: 2. |
|
669 |
|
670 "Created: / 13-03-2011 / 17:55:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
671 ! |
|
672 |
|
673 dload_3 |
|
674 self dload: 3. |
|
675 |
|
676 "Created: / 13-03-2011 / 17:55:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
677 ! |
|
678 |
|
679 dmul |
|
680 "raise an error: must be redefined in concrete subclass(es)" |
|
681 |
|
682 ^ self subclassResponsibility |
|
683 |
|
684 "Created: / 17-03-2011 / 16:46:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
685 ! |
|
686 |
|
687 dneg |
|
688 "raise an error: must be redefined in concrete subclass(es)" |
|
689 |
|
690 ^ self subclassResponsibility |
|
691 |
|
692 "Created: / 17-03-2011 / 16:47:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
693 ! |
|
694 |
|
695 drem |
|
696 "raise an error: must be redefined in concrete subclass(es)" |
|
697 |
|
698 ^ self subclassResponsibility |
|
699 |
|
700 "Created: / 17-03-2011 / 16:47:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
701 ! |
|
702 |
|
703 dreturn |
|
704 "raise an error: must be redefined in concrete subclass(es)" |
|
705 |
|
706 ^ self subclassResponsibility |
|
707 ! |
|
708 |
|
709 dstore |
|
710 "raise an error: must be redefined in concrete subclass(es)" |
|
711 |
|
712 ^ self subclassResponsibility |
|
713 ! |
|
714 |
|
715 dstore: arg |
|
716 " |
|
717 Store double into local variable |
|
718 stack: value -> nothing |
|
719 args: nothing" |
|
720 "raise an error: must be redefined in concrete subclass(es)" |
|
721 |
|
722 ^ self subclassResponsibility |
|
723 " |
|
724 Description |
|
725 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
726 current frame (§3.6). The value on the top of the operand stack must be of |
|
727 type double. It is popped from the operand stack and undergoes value set |
|
728 conversion (§3.8.3), resulting in value'. The local variables at <n> and |
|
729 <n> + 1 are set to value'. |
|
730 |
|
731 Notes |
|
732 Each of the dstore_<n> instructions is the same as dstore with an index |
|
733 of <n>, except that the operand <n> is implicit." |
|
734 |
|
735 "Modified: / 17-03-2011 / 15:28:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
736 ! |
|
737 |
|
738 dstore_0 |
|
739 " |
|
740 Store double into local variable |
|
741 stack: value -> nothing |
|
742 args: nothing" |
|
743 |
|
744 self dstore: 0. |
|
745 |
|
746 " |
|
747 Description |
|
748 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
749 current frame (§3.6). The value on the top of the operand stack must be of |
|
750 type double. It is popped from the operand stack and undergoes value set |
|
751 conversion (§3.8.3), resulting in value'. The local variables at <n> and |
|
752 <n> + 1 are set to value'. |
|
753 |
|
754 Notes |
|
755 Each of the dstore_<n> instructions is the same as dstore with an index |
|
756 of <n>, except that the operand <n> is implicit." |
|
757 |
|
758 "Created: / 14-03-2011 / 19:04:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
759 ! |
|
760 |
|
761 dstore_1 |
|
762 " |
|
763 Store double into local variable |
|
764 stack: value -> nothing |
|
765 args: nothing |
|
766 " |
|
767 |
|
768 self dstore: 1. |
|
769 " |
|
770 Description |
|
771 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
772 current frame (§3.6). The value on the top of the operand stack must be of |
|
773 type double. It is popped from the operand stack and undergoes value set |
|
774 conversion (§3.8.3), resulting in value'. The local variables at <n> and |
|
775 <n> + 1 are set to value'. |
|
776 |
|
777 Notes |
|
778 Each of the dstore_<n> instructions is the same as dstore with an index |
|
779 of <n>, except that the operand <n> is implicit. |
|
780 " |
|
781 |
|
782 "Created: / 14-03-2011 / 19:04:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
783 ! |
|
784 |
|
785 dstore_2 |
|
786 " |
|
787 Store double into local variable |
|
788 stack: value -> nothing |
|
789 args: nothing" |
|
790 |
|
791 self dstore: 2. |
|
792 |
|
793 " |
|
794 Description |
|
795 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
796 current frame (§3.6). The value on the top of the operand stack must be of |
|
797 type double. It is popped from the operand stack and undergoes value set |
|
798 conversion (§3.8.3), resulting in value'. The local variables at <n> and |
|
799 <n> + 1 are set to value'. |
|
800 |
|
801 Notes |
|
802 Each of the dstore_<n> instructions is the same as dstore with an index |
|
803 of <n>, except that the operand <n> is implicit." |
|
804 |
|
805 "Created: / 14-03-2011 / 19:04:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
806 ! |
|
807 |
|
808 dstore_3 |
|
809 " |
|
810 Store double into local variable |
|
811 stack: value -> nothing |
|
812 args: nothing" |
|
813 |
|
814 self dstore: 3. |
|
815 |
|
816 " |
|
817 Description |
|
818 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
819 current frame (§3.6). The value on the top of the operand stack must be of |
|
820 type double. It is popped from the operand stack and undergoes value set |
|
821 conversion (§3.8.3), resulting in value'. The local variables at <n> and |
|
822 <n> + 1 are set to value'. |
|
823 |
|
824 Notes |
|
825 Each of the dstore_<n> instructions is the same as dstore with an index |
|
826 of <n>, except that the operand <n> is implicit." |
|
827 |
|
828 "Created: / 14-03-2011 / 19:04:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
829 ! |
|
830 |
|
831 dsub |
|
832 "raise an error: must be redefined in concrete subclass(es)" |
|
833 |
|
834 ^ self subclassResponsibility |
|
835 |
|
836 "Created: / 17-03-2011 / 16:45:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
837 ! |
|
838 |
|
839 dup |
|
840 "raise an error: must be redefined in concrete subclass(es)" |
|
841 |
|
842 ^ self subclassResponsibility |
|
843 |
|
844 "Created: / 17-03-2011 / 16:44:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
845 ! |
|
846 |
|
847 dup2 |
|
848 "raise an error: must be redefined in concrete subclass(es)" |
|
849 |
|
850 ^ self subclassResponsibility |
|
851 ! |
|
852 |
|
853 dup2_x1 |
|
854 "raise an error: must be redefined in concrete subclass(es)" |
|
855 |
|
856 ^ self subclassResponsibility |
|
857 ! |
|
858 |
|
859 dup2_x2 |
|
860 "raise an error: must be redefined in concrete subclass(es)" |
|
861 |
|
862 ^ self subclassResponsibility |
|
863 ! |
|
864 |
|
865 dup_x1 |
|
866 "raise an error: must be redefined in concrete subclass(es)" |
|
867 |
|
868 ^ self subclassResponsibility |
|
869 ! |
|
870 |
|
871 dup_x2 |
|
872 "raise an error: must be redefined in concrete subclass(es)" |
|
873 |
|
874 ^ self subclassResponsibility |
|
875 ! |
|
876 |
|
877 f2d |
|
878 "raise an error: must be redefined in concrete subclass(es)" |
|
879 |
|
880 ^ self subclassResponsibility |
|
881 |
|
882 "Created: / 17-03-2011 / 16:50:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
883 ! |
|
884 |
|
885 f2i |
|
886 "raise an error: must be redefined in concrete subclass(es)" |
|
887 |
|
888 ^ self subclassResponsibility |
|
889 |
|
890 "Created: / 17-03-2011 / 16:50:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
891 ! |
|
892 |
|
893 f2l |
|
894 "raise an error: must be redefined in concrete subclass(es)" |
|
895 |
|
896 ^ self subclassResponsibility |
|
897 |
|
898 "Created: / 17-03-2011 / 16:50:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
899 ! |
|
900 |
|
901 fadd |
|
902 "raise an error: must be redefined in concrete subclass(es)" |
|
903 |
|
904 ^ self subclassResponsibility |
|
905 |
|
906 "Created: / 17-03-2011 / 16:44:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
907 ! |
|
908 |
|
909 faload |
|
910 "raise an error: must be redefined in concrete subclass(es)" |
|
911 |
|
912 ^ self subclassResponsibility |
|
913 ! |
|
914 |
|
915 fastore |
|
916 "raise an error: must be redefined in concrete subclass(es)" |
|
917 |
|
918 ^ self subclassResponsibility |
|
919 ! |
|
920 |
|
921 fcmpg |
|
922 "raise an error: must be redefined in concrete subclass(es)" |
|
923 |
|
924 ^ self subclassResponsibility |
|
925 |
|
926 "Created: / 17-03-2011 / 16:52:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
927 ! |
|
928 |
|
929 fcmpl |
|
930 "raise an error: must be redefined in concrete subclass(es)" |
|
931 |
|
932 ^ self subclassResponsibility |
|
933 |
|
934 "Created: / 17-03-2011 / 16:51:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
935 ! |
|
936 |
|
937 fconst: arg |
|
938 " |
|
939 Push float constant |
|
940 stack: nothing -> const |
|
941 arg: nothing" |
|
942 "raise an error: must be redefined in concrete subclass(es)" |
|
943 |
|
944 ^ self subclassResponsibility. |
|
945 " |
|
946 Description |
|
947 Push the float constant <f> (0.0, 1.0, or 2.0) onto the operand stack." |
|
948 |
|
949 "Modified: / 17-03-2011 / 15:28:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
950 ! |
|
951 |
|
952 fconst_0 |
|
953 " |
|
954 Push float constant |
|
955 stack: nothing -> const |
|
956 arg: nothing" |
|
957 |
|
958 self fconst: 0. |
|
959 |
|
960 " |
|
961 Description |
|
962 Push the float constant <f> (0.0, 1.0, or 2.0) onto the operand stack." |
|
963 |
|
964 "Created: / 14-03-2011 / 17:56:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
965 ! |
|
966 |
|
967 fconst_1 |
|
968 " |
|
969 Push float constant |
|
970 stack: nothing -> const |
|
971 arg: nothing" |
|
972 |
|
973 self fconst: 1. |
|
974 |
|
975 " |
|
976 Description |
|
977 Push the float constant <f> (0.0, 1.0, or 2.0) onto the operand stack." |
|
978 |
|
979 "Created: / 14-03-2011 / 17:57:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
980 ! |
|
981 |
|
982 fconst_2 |
|
983 " |
|
984 Push float constant |
|
985 stack: nothing -> const |
|
986 arg: nothing" |
|
987 |
|
988 self fconst: 2. |
|
989 |
|
990 " |
|
991 Description |
|
992 Push the float constant <f> (0.0, 1.0, or 2.0) onto the operand stack." |
|
993 |
|
994 "Created: / 14-03-2011 / 17:57:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
995 ! |
|
996 |
|
997 fdiv |
|
998 "raise an error: must be redefined in concrete subclass(es)" |
|
999 |
|
1000 ^ self subclassResponsibility |
|
1001 |
|
1002 "Created: / 17-03-2011 / 16:46:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1003 ! |
|
1004 |
|
1005 fload |
|
1006 "raise an error: must be redefined in concrete subclass(es)" |
|
1007 |
|
1008 ^ self subclassResponsibility |
|
1009 |
|
1010 "Created: / 17-03-2011 / 15:07:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1011 ! |
|
1012 |
|
1013 fload:arg |
|
1014 "raise an error: must be redefined in concrete subclass(es)" |
|
1015 |
|
1016 ^ self subclassResponsibility |
|
1017 ! |
|
1018 |
|
1019 fload_0 |
|
1020 ^ self fload: 0. |
|
1021 |
|
1022 "Created: / 17-03-2011 / 16:34:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1023 ! |
|
1024 |
|
1025 fload_1 |
|
1026 ^ self fload: 1. |
|
1027 |
|
1028 "Created: / 17-03-2011 / 16:35:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1029 ! |
|
1030 |
|
1031 fload_2 |
|
1032 ^ self fload: 2. |
|
1033 |
|
1034 "Created: / 17-03-2011 / 16:35:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1035 ! |
|
1036 |
|
1037 fload_3 |
|
1038 ^ self fload: 3. |
|
1039 |
|
1040 "Created: / 17-03-2011 / 16:35:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1041 ! |
|
1042 |
|
1043 fmul |
|
1044 "raise an error: must be redefined in concrete subclass(es)" |
|
1045 |
|
1046 ^ self subclassResponsibility |
|
1047 |
|
1048 "Created: / 17-03-2011 / 16:45:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1049 ! |
|
1050 |
|
1051 fneg |
|
1052 "raise an error: must be redefined in concrete subclass(es)" |
|
1053 |
|
1054 ^ self subclassResponsibility |
|
1055 |
|
1056 "Created: / 17-03-2011 / 16:47:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1057 ! |
|
1058 |
|
1059 frem |
|
1060 "raise an error: must be redefined in concrete subclass(es)" |
|
1061 |
|
1062 ^ self subclassResponsibility |
|
1063 |
|
1064 "Created: / 17-03-2011 / 16:46:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1065 ! |
|
1066 |
|
1067 freturn |
|
1068 "raise an error: must be redefined in concrete subclass(es)" |
|
1069 |
|
1070 ^ self subclassResponsibility |
|
1071 |
|
1072 "Created: / 17-03-2011 / 16:55:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1073 ! |
|
1074 |
|
1075 fstore |
|
1076 "raise an error: must be redefined in concrete subclass(es)" |
|
1077 |
|
1078 ^ self subclassResponsibility |
|
1079 ! |
|
1080 |
|
1081 fstore: arg |
|
1082 " |
|
1083 Store float into local variable |
|
1084 stack: value -> nothing |
|
1085 args: index" |
|
1086 "raise an error: must be redefined in concrete subclass(es)" |
|
1087 |
|
1088 ^ self subclassResponsibility |
|
1089 " |
|
1090 Description |
|
1091 The index is an unsigned byte that must be an index into the local |
|
1092 variable array of the current frame (§3.6). The value on the top of |
|
1093 the operand stack must be of type float. It is popped from the operand |
|
1094 stack and undergoes value set conversion (§3.8.3), resulting in value'. |
|
1095 The value of the local variable at index is set to value'. |
|
1096 |
|
1097 Notes |
|
1098 The fstore opcode can be used in conjunction with the wide instruction |
|
1099 to access a local variable using a two-byte unsigned index." |
|
1100 |
|
1101 "Modified: / 17-03-2011 / 15:29:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1102 ! |
|
1103 |
|
1104 fstore_0 |
|
1105 " |
|
1106 Store float into local variable |
|
1107 stack: value -> nothing |
|
1108 args: index" |
|
1109 |
|
1110 self fstore: 0. |
|
1111 |
|
1112 " |
|
1113 Description |
|
1114 The index is an unsigned byte that must be an index into the local |
|
1115 variable array of the current frame (§3.6). The value on the top of |
|
1116 the operand stack must be of type float. It is popped from the operand |
|
1117 stack and undergoes value set conversion (§3.8.3), resulting in value'. |
|
1118 The value of the local variable at index is set to value'. |
|
1119 |
|
1120 Notes |
|
1121 The fstore opcode can be used in conjunction with the wide instruction |
|
1122 to access a local variable using a two-byte unsigned index." |
|
1123 |
|
1124 "Created: / 14-03-2011 / 17:59:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1125 ! |
|
1126 |
|
1127 fstore_1 |
|
1128 " |
|
1129 Store float into local variable |
|
1130 stack: value -> nothing |
|
1131 args: index" |
|
1132 |
|
1133 self fstore: 1. |
|
1134 |
|
1135 " |
|
1136 Description |
|
1137 The index is an unsigned byte that must be an index into the local |
|
1138 variable array of the current frame (§3.6). The value on the top of |
|
1139 the operand stack must be of type float. It is popped from the operand |
|
1140 stack and undergoes value set conversion (§3.8.3), resulting in value'. |
|
1141 The value of the local variable at index is set to value'. |
|
1142 |
|
1143 Notes |
|
1144 The fstore opcode can be used in conjunction with the wide instruction |
|
1145 to access a local variable using a two-byte unsigned index." |
|
1146 |
|
1147 "Created: / 14-03-2011 / 17:59:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1148 ! |
|
1149 |
|
1150 fstore_2 |
|
1151 " |
|
1152 Store float into local variable |
|
1153 stack: value -> nothing |
|
1154 args: index" |
|
1155 |
|
1156 self fstore: 2. |
|
1157 |
|
1158 " |
|
1159 Description |
|
1160 The index is an unsigned byte that must be an index into the local |
|
1161 variable array of the current frame (§3.6). The value on the top of |
|
1162 the operand stack must be of type float. It is popped from the operand |
|
1163 stack and undergoes value set conversion (§3.8.3), resulting in value'. |
|
1164 The value of the local variable at index is set to value'. |
|
1165 |
|
1166 Notes |
|
1167 The fstore opcode can be used in conjunction with the wide instruction |
|
1168 to access a local variable using a two-byte unsigned index." |
|
1169 |
|
1170 "Created: / 14-03-2011 / 18:00:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1171 ! |
|
1172 |
|
1173 fstore_3 |
|
1174 " |
|
1175 Store float into local variable |
|
1176 stack: value -> nothing |
|
1177 args: index" |
|
1178 |
|
1179 self fstore: 3. |
|
1180 |
|
1181 " |
|
1182 Description |
|
1183 The index is an unsigned byte that must be an index into the local |
|
1184 variable array of the current frame (§3.6). The value on the top of |
|
1185 the operand stack must be of type float. It is popped from the operand |
|
1186 stack and undergoes value set conversion (§3.8.3), resulting in value'. |
|
1187 The value of the local variable at index is set to value'. |
|
1188 |
|
1189 Notes |
|
1190 The fstore opcode can be used in conjunction with the wide instruction |
|
1191 to access a local variable using a two-byte unsigned index." |
|
1192 |
|
1193 "Created: / 14-03-2011 / 18:00:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1194 ! |
|
1195 |
|
1196 fsub |
|
1197 "raise an error: must be redefined in concrete subclass(es)" |
|
1198 |
|
1199 ^ self subclassResponsibility |
|
1200 |
|
1201 "Created: / 17-03-2011 / 16:45:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1202 ! |
|
1203 |
|
1204 getfield |
|
1205 "raise an error: must be redefined in concrete subclass(es)" |
|
1206 |
|
1207 ^ self subclassResponsibility |
|
1208 ! |
|
1209 |
|
1210 getstatic |
|
1211 "raise an error: must be redefined in concrete subclass(es)" |
|
1212 |
|
1213 ^ self subclassResponsibility |
|
1214 |
|
1215 "Created: / 17-03-2011 / 16:55:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1216 ! |
|
1217 |
|
1218 goto |
|
1219 "raise an error: must be redefined in concrete subclass(es)" |
|
1220 |
|
1221 ^ self subclassResponsibility |
|
1222 ! |
|
1223 |
|
1224 goto_w |
|
1225 "raise an error: must be redefined in concrete subclass(es)" |
|
1226 |
|
1227 ^ self subclassResponsibility |
|
1228 |
|
1229 "Created: / 17-03-2011 / 16:58:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1230 ! |
|
1231 |
|
1232 i2d |
|
1233 "raise an error: must be redefined in concrete subclass(es)" |
|
1234 |
|
1235 ^ self subclassResponsibility |
|
1236 |
|
1237 "Created: / 17-03-2011 / 16:50:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1238 ! |
|
1239 |
|
1240 i2f |
|
1241 "raise an error: must be redefined in concrete subclass(es)" |
|
1242 |
|
1243 ^ self subclassResponsibility |
|
1244 |
|
1245 "Created: / 17-03-2011 / 16:49:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1246 ! |
|
1247 |
|
1248 i2l |
|
1249 "raise an error: must be redefined in concrete subclass(es)" |
|
1250 |
|
1251 ^ self subclassResponsibility |
|
1252 |
|
1253 "Created: / 17-03-2011 / 16:49:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1254 ! |
|
1255 |
|
1256 i_dup |
|
1257 "raise an error: must be redefined in concrete subclass(es)" |
|
1258 |
|
1259 ^ self subclassResponsibility |
|
1260 ! |
|
1261 |
|
1262 iadd |
|
1263 "raise an error: must be redefined in concrete subclass(es)" |
|
1264 |
|
1265 ^ self subclassResponsibility |
|
1266 ! |
|
1267 |
|
1268 iaload |
|
1269 "raise an error: must be redefined in concrete subclass(es)" |
|
1270 |
|
1271 ^ self subclassResponsibility |
|
1272 ! |
|
1273 |
|
1274 iand |
|
1275 "raise an error: must be redefined in concrete subclass(es)" |
|
1276 |
|
1277 ^ self subclassResponsibility |
|
1278 ! |
|
1279 |
|
1280 iastore |
|
1281 "raise an error: must be redefined in concrete subclass(es)" |
|
1282 |
|
1283 ^ self subclassResponsibility |
|
1284 ! |
|
1285 |
|
1286 iconst: arg |
|
1287 " |
|
1288 Push int constant |
|
1289 stack: nothing -> const |
|
1290 arg: nothing" |
|
1291 |
|
1292 self subclassResponsibility. |
|
1293 |
|
1294 " |
|
1295 Description |
|
1296 Push the int constant <i> (-1, 0, 1, 2, 3, 4 or 5) onto the operand stack. |
|
1297 |
|
1298 Notes |
|
1299 Each of this family of instructions is equivalent to bipush <i> for the |
|
1300 respective value of <i>, except that the operand <i> is implicit." |
|
1301 |
|
1302 "Created: / 17-03-2011 / 15:29:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1303 "Modified: / 20-03-2011 / 20:41:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1304 ! |
|
1305 |
|
1306 iconst_0 |
|
1307 " |
|
1308 Push int constant |
|
1309 stack: nothing -> const |
|
1310 arg: nothing" |
|
1311 |
|
1312 self iconst: 0. |
|
1313 |
|
1314 " |
|
1315 Description |
|
1316 Push the int constant <i> (-1, 0, 1, 2, 3, 4 or 5) onto the operand stack. |
|
1317 |
|
1318 Notes |
|
1319 Each of this family of instructions is equivalent to bipush <i> for the |
|
1320 respective value of <i>, except that the operand <i> is implicit." |
|
1321 |
|
1322 "Modified: / 17-03-2011 / 15:30:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1323 ! |
|
1324 |
|
1325 iconst_1 |
|
1326 self iconst:1. |
|
1327 |
|
1328 "Modified: / 17-03-2011 / 15:30:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1329 ! |
|
1330 |
|
1331 iconst_2 |
|
1332 self iconst: 2. |
|
1333 |
|
1334 "Modified: / 17-03-2011 / 15:30:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1335 ! |
|
1336 |
|
1337 iconst_3 |
|
1338 self iconst: 3. |
|
1339 |
|
1340 "Modified: / 17-03-2011 / 15:30:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1341 ! |
|
1342 |
|
1343 iconst_4 |
|
1344 self iconst: 4. |
|
1345 |
|
1346 "Modified: / 17-03-2011 / 15:30:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1347 ! |
|
1348 |
|
1349 iconst_5 |
|
1350 self iconst: 5. |
|
1351 |
|
1352 "Modified: / 17-03-2011 / 15:30:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1353 ! |
|
1354 |
|
1355 iconst_m1 |
|
1356 self iconst: -1. |
|
1357 |
|
1358 "Modified: / 17-03-2011 / 15:30:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1359 ! |
|
1360 |
|
1361 idiv |
|
1362 "raise an error: must be redefined in concrete subclass(es)" |
|
1363 |
|
1364 ^ self subclassResponsibility |
|
1365 ! |
|
1366 |
|
1367 ifacmpeq |
|
1368 "raise an error: must be redefined in concrete subclass(es)" |
|
1369 |
|
1370 ^ self subclassResponsibility |
|
1371 |
|
1372 "Created: / 17-03-2011 / 16:53:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1373 ! |
|
1374 |
|
1375 ifacmpne |
|
1376 "raise an error: must be redefined in concrete subclass(es)" |
|
1377 |
|
1378 ^ self subclassResponsibility |
|
1379 |
|
1380 "Created: / 17-03-2011 / 16:53:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1381 ! |
|
1382 |
|
1383 ifeq |
|
1384 "raise an error: must be redefined in concrete subclass(es)" |
|
1385 |
|
1386 ^ self subclassResponsibility |
|
1387 ! |
|
1388 |
|
1389 ifge |
|
1390 "raise an error: must be redefined in concrete subclass(es)" |
|
1391 |
|
1392 ^ self subclassResponsibility |
|
1393 ! |
|
1394 |
|
1395 ifgt |
|
1396 "raise an error: must be redefined in concrete subclass(es)" |
|
1397 |
|
1398 ^ self subclassResponsibility |
|
1399 ! |
|
1400 |
|
1401 ificmpeq |
|
1402 "raise an error: must be redefined in concrete subclass(es)" |
|
1403 |
|
1404 ^ self subclassResponsibility |
|
1405 ! |
|
1406 |
|
1407 ificmpge |
|
1408 "raise an error: must be redefined in concrete subclass(es)" |
|
1409 |
|
1410 ^ self subclassResponsibility |
|
1411 ! |
|
1412 |
|
1413 ificmpgt |
|
1414 "raise an error: must be redefined in concrete subclass(es)" |
|
1415 |
|
1416 ^ self subclassResponsibility |
|
1417 ! |
|
1418 |
|
1419 ificmple |
|
1420 "raise an error: must be redefined in concrete subclass(es)" |
|
1421 |
|
1422 ^ self subclassResponsibility |
|
1423 ! |
|
1424 |
|
1425 ificmplt |
|
1426 "raise an error: must be redefined in concrete subclass(es)" |
|
1427 |
|
1428 ^ self subclassResponsibility |
|
1429 ! |
|
1430 |
|
1431 ificmpne |
|
1432 "raise an error: must be redefined in concrete subclass(es)" |
|
1433 |
|
1434 ^ self subclassResponsibility |
|
1435 ! |
|
1436 |
|
1437 ifle |
|
1438 "raise an error: must be redefined in concrete subclass(es)" |
|
1439 |
|
1440 ^ self subclassResponsibility |
|
1441 ! |
|
1442 |
|
1443 iflt |
|
1444 "raise an error: must be redefined in concrete subclass(es)" |
|
1445 |
|
1446 ^ self subclassResponsibility |
|
1447 ! |
|
1448 |
|
1449 ifne |
|
1450 "raise an error: must be redefined in concrete subclass(es)" |
|
1451 |
|
1452 ^ self subclassResponsibility |
|
1453 ! |
|
1454 |
|
1455 ifnonnull |
|
1456 "raise an error: must be redefined in concrete subclass(es)" |
|
1457 |
|
1458 ^ self subclassResponsibility |
|
1459 |
|
1460 "Created: / 17-03-2011 / 16:58:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1461 ! |
|
1462 |
|
1463 ifnull |
|
1464 "raise an error: must be redefined in concrete subclass(es)" |
|
1465 |
|
1466 ^ self subclassResponsibility |
|
1467 |
|
1468 "Created: / 17-03-2011 / 16:58:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1469 ! |
|
1470 |
|
1471 iinc |
|
1472 "raise an error: must be redefined in concrete subclass(es)" |
|
1473 |
|
1474 ^ self subclassResponsibility |
|
1475 ! |
|
1476 |
|
1477 iload |
|
1478 "raise an error: must be redefined in concrete subclass(es)" |
|
1479 |
|
1480 ^ self subclassResponsibility |
|
1481 |
|
1482 "Created: / 17-03-2011 / 15:06:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1483 ! |
|
1484 |
|
1485 iload: arg |
|
1486 " |
|
1487 loads an int value from local variable 0 |
|
1488 stack: nothing -> value |
|
1489 args: nothing" |
|
1490 "raise an error: must be redefined in concrete subclass(es)" |
|
1491 |
|
1492 ^ self subclassResponsibility |
|
1493 " |
|
1494 Description |
|
1495 The <n> must be an index into the local variable array of the current frame (§3.6). |
|
1496 The local variable at <n> must contain an int. The value of the local variable |
|
1497 at <n> is pushed onto the operand stack. |
|
1498 |
|
1499 Notes |
|
1500 Each of the iload_<n> instructions is the same as iload with an index of <n>, |
|
1501 except that the operand <n> is implicit." |
|
1502 |
|
1503 "Modified: / 17-03-2011 / 15:30:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1504 ! |
|
1505 |
|
1506 iload_0 |
|
1507 " |
|
1508 loads an int value from local variable 0 |
|
1509 stack: nothing -> value |
|
1510 args: nothing" |
|
1511 |
|
1512 self iload: 0. |
|
1513 |
|
1514 " |
|
1515 Description |
|
1516 The <n> must be an index into the local variable array of the current frame (§3.6). |
|
1517 The local variable at <n> must contain an int. The value of the local variable |
|
1518 at <n> is pushed onto the operand stack. |
|
1519 |
|
1520 Notes |
|
1521 Each of the iload_<n> instructions is the same as iload with an index of <n>, |
|
1522 except that the operand <n> is implicit." |
|
1523 |
|
1524 "Created: / 06-03-2011 / 21:22:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1525 "Modified: / 13-03-2011 / 20:58:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1526 ! |
|
1527 |
|
1528 iload_1 |
|
1529 "check iload_0" |
|
1530 self iload: 1. |
|
1531 |
|
1532 "Created: / 06-03-2011 / 21:22:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1533 "Modified: / 13-03-2011 / 16:36:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1534 ! |
|
1535 |
|
1536 iload_2 |
|
1537 "check iload_0" |
|
1538 self iload:2. |
|
1539 |
|
1540 "Created: / 06-03-2011 / 21:24:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1541 ! |
|
1542 |
|
1543 iload_3 |
|
1544 "check iload_0" |
|
1545 |
|
1546 self iload: 3. |
|
1547 |
|
1548 "Created: / 14-03-2011 / 19:05:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1549 ! |
|
1550 |
|
1551 imul |
|
1552 "raise an error: must be redefined in concrete subclass(es)" |
|
1553 |
|
1554 ^ self subclassResponsibility |
|
1555 ! |
|
1556 |
|
1557 ineg |
|
1558 "raise an error: must be redefined in concrete subclass(es)" |
|
1559 |
|
1560 ^ self subclassResponsibility |
|
1561 |
|
1562 "Created: / 17-03-2011 / 16:47:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1563 ! |
|
1564 |
|
1565 instanceof |
|
1566 "raise an error: must be redefined in concrete subclass(es)" |
|
1567 |
|
1568 ^ self subclassResponsibility |
|
1569 |
|
1570 "Created: / 17-03-2011 / 16:57:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1571 ! |
|
1572 |
|
1573 int2byte |
|
1574 "raise an error: must be redefined in concrete subclass(es)" |
|
1575 |
|
1576 ^ self subclassResponsibility |
|
1577 |
|
1578 "Created: / 17-03-2011 / 16:51:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1579 ! |
|
1580 |
|
1581 int2char |
|
1582 "raise an error: must be redefined in concrete subclass(es)" |
|
1583 |
|
1584 ^ self subclassResponsibility |
|
1585 |
|
1586 "Created: / 17-03-2011 / 16:51:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1587 ! |
|
1588 |
|
1589 int2short |
|
1590 "raise an error: must be redefined in concrete subclass(es)" |
|
1591 |
|
1592 ^ self subclassResponsibility |
|
1593 |
|
1594 "Created: / 17-03-2011 / 16:51:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1595 ! |
|
1596 |
|
1597 invinterface |
|
1598 "raise an error: must be redefined in concrete subclass(es)" |
|
1599 |
|
1600 ^ self subclassResponsibility |
|
1601 |
|
1602 "Created: / 17-03-2011 / 16:56:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1603 ! |
|
1604 |
|
1605 invnonvirt |
|
1606 "raise an error: must be redefined in concrete subclass(es)" |
|
1607 |
|
1608 ^ self subclassResponsibility |
|
1609 |
|
1610 "Created: / 17-03-2011 / 16:56:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1611 ! |
|
1612 |
|
1613 invstatic |
|
1614 "raise an error: must be redefined in concrete subclass(es)" |
|
1615 |
|
1616 ^ self subclassResponsibility |
|
1617 ! |
|
1618 |
|
1619 invvirt |
|
1620 "raise an error: must be redefined in concrete subclass(es)" |
|
1621 |
|
1622 ^ self subclassResponsibility |
|
1623 |
|
1624 "Created: / 17-03-2011 / 16:56:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1625 ! |
|
1626 |
|
1627 ior |
|
1628 "raise an error: must be redefined in concrete subclass(es)" |
|
1629 |
|
1630 ^ self subclassResponsibility |
|
1631 ! |
|
1632 |
|
1633 irem |
|
1634 "raise an error: must be redefined in concrete subclass(es)" |
|
1635 |
|
1636 ^ self subclassResponsibility |
|
1637 ! |
|
1638 |
|
1639 ireturn |
|
1640 "raise an error: must be redefined in concrete subclass(es)" |
|
1641 |
|
1642 ^ self subclassResponsibility |
|
1643 ! |
|
1644 |
|
1645 ishl |
|
1646 "raise an error: must be redefined in concrete subclass(es)" |
|
1647 |
|
1648 ^ self subclassResponsibility |
|
1649 ! |
|
1650 |
|
1651 ishr |
|
1652 "raise an error: must be redefined in concrete subclass(es)" |
|
1653 |
|
1654 ^ self subclassResponsibility |
|
1655 ! |
|
1656 |
|
1657 istore |
|
1658 |
|
1659 ^ self subclassResponsibility |
|
1660 |
|
1661 "Created: / 17-03-2011 / 16:36:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1662 ! |
|
1663 |
|
1664 istore: arg |
|
1665 "store int value into variable 0 |
|
1666 stack: value -> nothing |
|
1667 args: nothing" |
|
1668 "raise an error: must be redefined in concrete subclass(es)" |
|
1669 |
|
1670 ^ self subclassResponsibility |
|
1671 " |
|
1672 Description |
|
1673 The <n> must be an index into the local variable array of the current frame (§3.6). |
|
1674 The value on the top of the operand stack must be of type int. It is popped from |
|
1675 the operand stack, and the value of the local variable at <n> is set to value. |
|
1676 |
|
1677 Notes |
|
1678 Each of the istore_<n> instructions is the same as istore with an index of <n>, |
|
1679 except that the operand <n> is implicit." |
|
1680 |
|
1681 "Modified: / 17-03-2011 / 15:31:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1682 ! |
|
1683 |
|
1684 istore_0 |
|
1685 "store int value into variable 0 |
|
1686 stack: value -> nothing |
|
1687 args: nothing" |
|
1688 |
|
1689 self istore: 0. |
|
1690 |
|
1691 " |
|
1692 Description |
|
1693 The <n> must be an index into the local variable array of the current frame (§3.6). |
|
1694 The value on the top of the operand stack must be of type int. It is popped from |
|
1695 the operand stack, and the value of the local variable at <n> is set to value. |
|
1696 |
|
1697 Notes |
|
1698 Each of the istore_<n> instructions is the same as istore with an index of <n>, |
|
1699 except that the operand <n> is implicit." |
|
1700 |
|
1701 "Created: / 06-03-2011 / 21:01:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1702 "Modified: / 17-03-2011 / 15:31:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1703 ! |
|
1704 |
|
1705 istore_1 |
|
1706 "check istore_0" |
|
1707 self istore: 1. |
|
1708 |
|
1709 "Created: / 06-03-2011 / 21:18:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1710 ! |
|
1711 |
|
1712 istore_2 |
|
1713 "check istore_0" |
|
1714 self istore: 2. |
|
1715 |
|
1716 "Created: / 06-03-2011 / 21:23:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1717 ! |
|
1718 |
|
1719 istore_3 |
|
1720 "check istore_0" |
|
1721 |
|
1722 self istore: 3. |
|
1723 |
|
1724 "Created: / 14-03-2011 / 19:05:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1725 ! |
|
1726 |
|
1727 isub |
|
1728 "raise an error: must be redefined in concrete subclass(es)" |
|
1729 |
|
1730 ^ self subclassResponsibility |
|
1731 ! |
|
1732 |
|
1733 iushr |
|
1734 "raise an error: must be redefined in concrete subclass(es)" |
|
1735 |
|
1736 ^ self subclassResponsibility |
|
1737 ! |
|
1738 |
|
1739 ixor |
|
1740 "raise an error: must be redefined in concrete subclass(es)" |
|
1741 |
|
1742 ^ self subclassResponsibility |
|
1743 ! |
|
1744 |
|
1745 jsr |
|
1746 "raise an error: must be redefined in concrete subclass(es)" |
|
1747 |
|
1748 ^ self subclassResponsibility |
|
1749 |
|
1750 "Created: / 17-03-2011 / 16:54:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1751 ! |
|
1752 |
|
1753 jsr_w |
|
1754 "raise an error: must be redefined in concrete subclass(es)" |
|
1755 |
|
1756 ^ self subclassResponsibility |
|
1757 |
|
1758 "Created: / 17-03-2011 / 16:58:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1759 ! |
|
1760 |
|
1761 l2d |
|
1762 "raise an error: must be redefined in concrete subclass(es)" |
|
1763 |
|
1764 ^ self subclassResponsibility |
|
1765 |
|
1766 "Created: / 17-03-2011 / 16:50:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1767 ! |
|
1768 |
|
1769 l2f |
|
1770 "raise an error: must be redefined in concrete subclass(es)" |
|
1771 |
|
1772 ^ self subclassResponsibility |
|
1773 |
|
1774 "Created: / 17-03-2011 / 16:50:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1775 ! |
|
1776 |
|
1777 l2i |
|
1778 "raise an error: must be redefined in concrete subclass(es)" |
|
1779 |
|
1780 ^ self subclassResponsibility |
|
1781 |
|
1782 "Created: / 17-03-2011 / 16:50:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1783 ! |
|
1784 |
|
1785 ladd |
|
1786 "raise an error: must be redefined in concrete subclass(es)" |
|
1787 |
|
1788 ^ self subclassResponsibility |
|
1789 |
|
1790 "Created: / 17-03-2011 / 16:44:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1791 ! |
|
1792 |
|
1793 laload |
|
1794 "raise an error: must be redefined in concrete subclass(es)" |
|
1795 |
|
1796 ^ self subclassResponsibility |
|
1797 ! |
|
1798 |
|
1799 land |
|
1800 "raise an error: must be redefined in concrete subclass(es)" |
|
1801 |
|
1802 ^ self subclassResponsibility |
|
1803 |
|
1804 "Created: / 17-03-2011 / 16:48:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1805 ! |
|
1806 |
|
1807 lastore |
|
1808 "raise an error: must be redefined in concrete subclass(es)" |
|
1809 |
|
1810 ^ self subclassResponsibility |
|
1811 ! |
|
1812 |
|
1813 lcmp |
|
1814 "raise an error: must be redefined in concrete subclass(es)" |
|
1815 |
|
1816 ^ self subclassResponsibility |
|
1817 |
|
1818 "Created: / 17-03-2011 / 16:51:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1819 ! |
|
1820 |
|
1821 lconst: arg |
|
1822 " |
|
1823 Push long constant |
|
1824 stack: nothing -> const |
|
1825 arg: nothing" |
|
1826 "raise an error: must be redefined in concrete subclass(es)" |
|
1827 |
|
1828 ^ self subclassResponsibility |
|
1829 " |
|
1830 Push the long constant <l> (0 or 1) onto the operand stack." |
|
1831 |
|
1832 "Modified: / 17-03-2011 / 16:30:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1833 ! |
|
1834 |
|
1835 lconst_0 |
|
1836 " |
|
1837 Push long constant |
|
1838 stack: nothing -> const |
|
1839 arg: nothing" |
|
1840 |
|
1841 self lconst: 0. |
|
1842 |
|
1843 " |
|
1844 Push the long constant <l> (0 or 1) onto the operand stack." |
|
1845 |
|
1846 "Created: / 14-03-2011 / 17:53:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1847 "Modified: / 17-03-2011 / 16:28:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1848 ! |
|
1849 |
|
1850 lconst_1 |
|
1851 " |
|
1852 Push long constant |
|
1853 stack: nothing -> const |
|
1854 arg: nothing" |
|
1855 |
|
1856 self lconst: 1. |
|
1857 |
|
1858 " |
|
1859 Push the long constant <l> (0 or 1) onto the operand stack." |
|
1860 |
|
1861 "Created: / 14-03-2011 / 17:53:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1862 "Modified: / 17-03-2011 / 16:29:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1863 ! |
|
1864 |
|
1865 ldc1 |
|
1866 "raise an error: must be redefined in concrete subclass(es)" |
|
1867 |
|
1868 ^ self subclassResponsibility |
|
1869 ! |
|
1870 |
|
1871 ldc2 |
|
1872 "raise an error: must be redefined in concrete subclass(es)" |
|
1873 |
|
1874 ^ self subclassResponsibility |
|
1875 ! |
|
1876 |
|
1877 ldc2w |
|
1878 "raise an error: must be redefined in concrete subclass(es)" |
|
1879 |
|
1880 ^ self subclassResponsibility |
|
1881 ! |
|
1882 |
|
1883 ldiv |
|
1884 "raise an error: must be redefined in concrete subclass(es)" |
|
1885 |
|
1886 ^ self subclassResponsibility |
|
1887 |
|
1888 "Created: / 17-03-2011 / 16:46:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1889 ! |
|
1890 |
|
1891 lload |
|
1892 "raise an error: must be redefined in concrete subclass(es)" |
|
1893 |
|
1894 ^ self subclassResponsibility |
|
1895 |
|
1896 "Created: / 17-03-2011 / 15:06:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1897 ! |
|
1898 |
|
1899 lload: arg |
|
1900 " |
|
1901 Load long from local variable |
|
1902 stack: nothing -> value |
|
1903 args: nothing" |
|
1904 "raise an error: must be redefined in concrete subclass(es)" |
|
1905 |
|
1906 ^ self subclassResponsibility. |
|
1907 |
|
1908 " |
|
1909 Description |
|
1910 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
1911 current frame (§3.6). The local variable at <n> must contain a long. The |
|
1912 value of the local variable at <n> is pushed onto the operand stack. |
|
1913 |
|
1914 Notes |
|
1915 Each of the lload_<n> instructions is the same as lload with an index |
|
1916 of <n>, except that the operand <n> is implicit." |
|
1917 |
|
1918 "Modified: / 17-03-2011 / 16:33:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1919 ! |
|
1920 |
|
1921 lload_0 |
|
1922 " |
|
1923 Load long from local variable |
|
1924 stack: nothing -> value |
|
1925 args: nothing |
|
1926 " |
|
1927 self lload: 0. |
|
1928 |
|
1929 " |
|
1930 Description |
|
1931 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
1932 current frame (§3.6). The local variable at <n> must contain a long. The |
|
1933 value of the local variable at <n> is pushed onto the operand stack. |
|
1934 |
|
1935 Notes |
|
1936 Each of the lload_<n> instructions is the same as lload with an index |
|
1937 of <n>, except that the operand <n> is implicit. |
|
1938 " |
|
1939 |
|
1940 "Created: / 14-03-2011 / 13:38:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1941 ! |
|
1942 |
|
1943 lload_1 |
|
1944 self lload: 1. |
|
1945 |
|
1946 "Created: / 14-03-2011 / 13:37:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1947 ! |
|
1948 |
|
1949 lload_2 |
|
1950 self lload: 2. |
|
1951 |
|
1952 "Created: / 14-03-2011 / 13:38:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1953 ! |
|
1954 |
|
1955 lload_3 |
|
1956 self lload: 3. |
|
1957 |
|
1958 "Created: / 14-03-2011 / 13:38:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1959 ! |
|
1960 |
|
1961 lmul |
|
1962 "raise an error: must be redefined in concrete subclass(es)" |
|
1963 |
|
1964 ^ self subclassResponsibility |
|
1965 |
|
1966 "Created: / 17-03-2011 / 16:45:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1967 ! |
|
1968 |
|
1969 lneg |
|
1970 "raise an error: must be redefined in concrete subclass(es)" |
|
1971 |
|
1972 ^ self subclassResponsibility |
|
1973 |
|
1974 "Created: / 17-03-2011 / 16:47:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1975 ! |
|
1976 |
|
1977 lookupswtch |
|
1978 "raise an error: must be redefined in concrete subclass(es)" |
|
1979 |
|
1980 ^ self subclassResponsibility |
|
1981 |
|
1982 "Created: / 17-03-2011 / 16:55:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1983 ! |
|
1984 |
|
1985 lor |
|
1986 "raise an error: must be redefined in concrete subclass(es)" |
|
1987 |
|
1988 ^ self subclassResponsibility |
|
1989 |
|
1990 "Created: / 17-03-2011 / 16:49:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1991 ! |
|
1992 |
|
1993 lrem |
|
1994 "raise an error: must be redefined in concrete subclass(es)" |
|
1995 |
|
1996 ^ self subclassResponsibility |
|
1997 |
|
1998 "Created: / 17-03-2011 / 16:46:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1999 ! |
|
2000 |
|
2001 lreturn |
|
2002 "raise an error: must be redefined in concrete subclass(es)" |
|
2003 |
|
2004 ^ self subclassResponsibility |
|
2005 ! |
|
2006 |
|
2007 lshl |
|
2008 "raise an error: must be redefined in concrete subclass(es)" |
|
2009 |
|
2010 ^ self subclassResponsibility |
|
2011 |
|
2012 "Created: / 17-03-2011 / 16:48:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2013 ! |
|
2014 |
|
2015 lshr |
|
2016 "raise an error: must be redefined in concrete subclass(es)" |
|
2017 |
|
2018 ^ self subclassResponsibility |
|
2019 |
|
2020 "Created: / 17-03-2011 / 16:48:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2021 ! |
|
2022 |
|
2023 lstore |
|
2024 "raise an error: must be redefined in concrete subclass(es)" |
|
2025 |
|
2026 ^ self subclassResponsibility |
|
2027 |
|
2028 "Created: / 17-03-2011 / 16:37:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2029 ! |
|
2030 |
|
2031 lstore:arg |
|
2032 "raise an error: must be redefined in concrete subclass(es)" |
|
2033 |
|
2034 ^ self subclassResponsibility |
|
2035 ! |
|
2036 |
|
2037 lstore_0 |
|
2038 "store long into local variable 0 |
|
2039 stack: value -> nothing |
|
2040 args: nothing" |
|
2041 |
|
2042 self lstore: 0. |
|
2043 |
|
2044 " |
|
2045 Description |
|
2046 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
2047 current frame (§3.6). The value on the top of the operand stack must be |
|
2048 of type long. It is popped from the operand stack, and the local variables |
|
2049 at <n> and <n> + 1 are set to value. |
|
2050 |
|
2051 Notes |
|
2052 Each of the lstore_<n> instructions is the same as lstore with an index |
|
2053 of <n>, except that the operand <n> is implicit." |
|
2054 |
|
2055 "Created: / 14-03-2011 / 17:54:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2056 ! |
|
2057 |
|
2058 lstore_1 |
|
2059 "store long into local variable |
|
2060 stack: value -> nothing |
|
2061 args: nothing" |
|
2062 |
|
2063 self lstore: 1. |
|
2064 |
|
2065 " |
|
2066 Description |
|
2067 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
2068 current frame (§3.6). The value on the top of the operand stack must be |
|
2069 of type long. It is popped from the operand stack, and the local variables |
|
2070 at <n> and <n> + 1 are set to value. |
|
2071 |
|
2072 Notes |
|
2073 Each of the lstore_<n> instructions is the same as lstore with an index |
|
2074 of <n>, except that the operand <n> is implicit." |
|
2075 |
|
2076 "Created: / 14-03-2011 / 17:55:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2077 ! |
|
2078 |
|
2079 lstore_2 |
|
2080 "store long into local variable |
|
2081 stack: value -> nothing |
|
2082 args: nothing" |
|
2083 |
|
2084 self lstore: 2. |
|
2085 |
|
2086 " |
|
2087 Description |
|
2088 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
2089 current frame (§3.6). The value on the top of the operand stack must be |
|
2090 of type long. It is popped from the operand stack, and the local variables |
|
2091 at <n> and <n> + 1 are set to value. |
|
2092 |
|
2093 Notes |
|
2094 Each of the lstore_<n> instructions is the same as lstore with an index |
|
2095 of <n>, except that the operand <n> is implicit." |
|
2096 |
|
2097 "Created: / 14-03-2011 / 17:55:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2098 ! |
|
2099 |
|
2100 lstore_3 |
|
2101 "store long into local variable |
|
2102 stack: value -> nothing |
|
2103 args: nothing" |
|
2104 |
|
2105 self lstore: 3. |
|
2106 |
|
2107 " |
|
2108 Description |
|
2109 Both <n> and <n> + 1 must be indices into the local variable array of the |
|
2110 current frame (§3.6). The value on the top of the operand stack must be |
|
2111 of type long. It is popped from the operand stack, and the local variables |
|
2112 at <n> and <n> + 1 are set to value. |
|
2113 |
|
2114 Notes |
|
2115 Each of the lstore_<n> instructions is the same as lstore with an index |
|
2116 of <n>, except that the operand <n> is implicit." |
|
2117 |
|
2118 "Created: / 14-03-2011 / 17:56:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2119 ! |
|
2120 |
|
2121 lsub |
|
2122 "raise an error: must be redefined in concrete subclass(es)" |
|
2123 |
|
2124 ^ self subclassResponsibility |
|
2125 |
|
2126 "Created: / 17-03-2011 / 16:45:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2127 ! |
|
2128 |
|
2129 lushr |
|
2130 "raise an error: must be redefined in concrete subclass(es)" |
|
2131 |
|
2132 ^ self subclassResponsibility |
|
2133 |
|
2134 "Created: / 17-03-2011 / 16:48:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2135 ! |
|
2136 |
|
2137 lxor |
|
2138 "raise an error: must be redefined in concrete subclass(es)" |
|
2139 |
|
2140 ^ self subclassResponsibility |
|
2141 |
|
2142 "Created: / 17-03-2011 / 16:49:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2143 ! |
|
2144 |
|
2145 monenter |
|
2146 "raise an error: must be redefined in concrete subclass(es)" |
|
2147 |
|
2148 ^ self subclassResponsibility |
|
2149 |
|
2150 "Created: / 17-03-2011 / 16:58:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2151 ! |
|
2152 |
|
2153 monexit |
|
2154 "raise an error: must be redefined in concrete subclass(es)" |
|
2155 |
|
2156 ^ self subclassResponsibility |
|
2157 |
|
2158 "Created: / 17-03-2011 / 16:58:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2159 ! |
|
2160 |
|
2161 multianewarray |
|
2162 "raise an error: must be redefined in concrete subclass(es)" |
|
2163 |
|
2164 ^ self subclassResponsibility |
|
2165 |
|
2166 "Created: / 17-03-2011 / 16:58:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2167 ! |
|
2168 |
|
2169 new |
|
2170 "raise an error: must be redefined in concrete subclass(es)" |
|
2171 |
|
2172 ^ self subclassResponsibility |
|
2173 ! |
|
2174 |
|
2175 newarray |
|
2176 "raise an error: must be redefined in concrete subclass(es)" |
|
2177 |
|
2178 ^ self subclassResponsibility |
|
2179 ! |
|
2180 |
|
2181 nop |
|
2182 "Do nothing" |
|
2183 "raise an error: must be redefined in concrete subclass(es)" |
|
2184 |
|
2185 ^ self subclassResponsibility |
|
2186 |
|
2187 "Modified: / 17-03-2011 / 16:27:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2188 ! |
|
2189 |
|
2190 pop1 |
|
2191 "raise an error: must be redefined in concrete subclass(es)" |
|
2192 |
|
2193 ^ self subclassResponsibility |
|
2194 |
|
2195 "Created: / 17-03-2011 / 16:43:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2196 ! |
|
2197 |
|
2198 pop2 |
|
2199 "raise an error: must be redefined in concrete subclass(es)" |
|
2200 |
|
2201 ^ self subclassResponsibility |
|
2202 ! |
|
2203 |
|
2204 putfield |
|
2205 "raise an error: must be redefined in concrete subclass(es)" |
|
2206 |
|
2207 ^ self subclassResponsibility |
|
2208 ! |
|
2209 |
|
2210 putstatic |
|
2211 "raise an error: must be redefined in concrete subclass(es)" |
|
2212 |
|
2213 ^ self subclassResponsibility |
|
2214 ! |
|
2215 |
|
2216 ret |
|
2217 "raise an error: must be redefined in concrete subclass(es)" |
|
2218 |
|
2219 ^ self subclassResponsibility |
|
2220 |
|
2221 "Created: / 17-03-2011 / 16:54:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2222 ! |
|
2223 |
|
2224 ret_w |
|
2225 "raise an error: must be redefined in concrete subclass(es)" |
|
2226 |
|
2227 ^ self subclassResponsibility |
|
2228 |
|
2229 "Created: / 17-03-2011 / 16:59:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2230 ! |
|
2231 |
|
2232 return |
|
2233 "raise an error: must be redefined in concrete subclass(es)" |
|
2234 |
|
2235 ^ self subclassResponsibility |
|
2236 ! |
|
2237 |
|
2238 saload |
|
2239 "raise an error: must be redefined in concrete subclass(es)" |
|
2240 |
|
2241 ^ self subclassResponsibility |
|
2242 ! |
|
2243 |
|
2244 sastore |
|
2245 "raise an error: must be redefined in concrete subclass(es)" |
|
2246 |
|
2247 ^ self subclassResponsibility |
|
2248 ! |
|
2249 |
|
2250 sipush |
|
2251 "raise an error: must be redefined in concrete subclass(es)" |
|
2252 |
|
2253 ^ self subclassResponsibility |
|
2254 ! |
|
2255 |
|
2256 swap |
|
2257 "raise an error: must be redefined in concrete subclass(es)" |
|
2258 |
|
2259 ^ self subclassResponsibility |
|
2260 ! |
|
2261 |
|
2262 tableswtch |
|
2263 "raise an error: must be redefined in concrete subclass(es)" |
|
2264 |
|
2265 ^ self subclassResponsibility |
|
2266 |
|
2267 "Created: / 17-03-2011 / 16:54:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2268 ! |
|
2269 |
|
2270 wide |
|
2271 "raise an error: must be redefined in concrete subclass(es)" |
|
2272 |
|
2273 ^ self subclassResponsibility |
|
2274 |
|
2275 "Created: / 17-03-2011 / 16:58:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2276 ! ! |
|
2277 |
|
2278 !JavaByteCodeProcessor methodsFor:'private-helpers'! |
|
2279 |
|
2280 fetchByte |
|
2281 "fetch sign extended byte value stored in bytecode" |
|
2282 pc := pc + 1. |
|
2283 ^ (byteCode at: (pc - 1)) signExtendedByteValue. |
|
2284 |
|
2285 "Created: / 06-03-2011 / 22:26:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2286 "Modified: / 17-03-2011 / 17:00:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2287 ! |
|
2288 |
|
2289 fetchBytes2 |
|
2290 "fetch sign extended 2 byte value stored in bytecode" |
|
2291 pc := pc + 2. |
|
2292 ^ (((byteCode at: (pc - 2)) bitShift: 8) + (byteCode at: (pc - 1))) |
|
2293 signExtendedShortValue. |
|
2294 |
|
2295 "Created: / 06-03-2011 / 21:12:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2296 "Modified: / 17-03-2011 / 17:00:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2297 ! |
|
2298 |
|
2299 fetchBytes4 |
|
2300 "fetch sign extended 4 byte value stored in bytecode" |
|
2301 |
|
2302 pc := pc + 4. |
|
2303 ^ (((((byteCode at: (pc - 4)) bitShift: 24) |
|
2304 bitOr: ((byteCode at: (pc - 3)) bitShift: 16)) |
|
2305 bitOr: ((byteCode at: (pc - 2)) bitShift: 8)) |
|
2306 bitOr: (byteCode at: (pc - 1))) asSigned32. |
|
2307 |
|
2308 "Created: / 21-03-2011 / 12:59:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2309 "Modified: / 21-03-2011 / 15:10:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2310 ! |
|
2311 |
|
2312 fetchIndex |
|
2313 "fetch index value from bytecode" |
|
2314 pc := pc + 1. |
|
2315 ^ (byteCode at: (pc - 1)). |
|
2316 |
|
2317 "Created: / 24-02-2011 / 22:37:18 / Marcel Hlopko <hlopik@gmail.com>" |
|
2318 "Modified: / 17-03-2011 / 17:01:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2319 ! |
|
2320 |
|
2321 fetchIndex2 |
|
2322 "fetch index 2 byte value from bytecode" |
|
2323 pc := pc + 2. |
|
2324 ^ ((byteCode at: (pc - 2)) bitShift: 8) bitOr: (byteCode at: (pc - 1)). |
|
2325 |
|
2326 "Modified: / 24-02-2011 / 21:33:53 / Marcel Hlopko <hlopik@gmail.com>" |
|
2327 "Modified: / 17-03-2011 / 17:01:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2328 ! |
|
2329 |
|
2330 pop |
|
2331 "return and remove top of the stack" |
|
2332 |
|
2333 sp := sp - 1. |
|
2334 ^ context at: sp + 1. |
|
2335 |
|
2336 "Modified: / 17-03-2011 / 17:39:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2337 ! |
|
2338 |
|
2339 popDouble |
|
2340 "so far I didn't find a reason to handle doubles and long on stack differently" |
|
2341 ^ self pop. |
|
2342 |
|
2343 "Modified: / 17-03-2011 / 17:02:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2344 ! |
|
2345 |
|
2346 popLong |
|
2347 "so far I didn't find a reason to handle doubles and long on stack differently" |
|
2348 ^ self pop. |
|
2349 |
|
2350 "Modified: / 17-03-2011 / 17:02:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2351 ! |
|
2352 |
|
2353 pushConstant: something |
|
2354 "push constant value on the stack - is there really not any better push method?" |
|
2355 sp := sp + 1. |
|
2356 context at: sp put: something |
|
2357 |
|
2358 "Modified: / 17-03-2011 / 17:05:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2359 ! |
|
2360 |
|
2361 pushDouble: something |
|
2362 "push double value on the stack" |
|
2363 |
|
2364 ^ self pushInt: something. |
|
2365 |
|
2366 "Modified: / 17-03-2011 / 17:06:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2367 ! |
|
2368 |
|
2369 pushFloat: something |
|
2370 "push float value on the stack" |
|
2371 self pushInt: something. |
|
2372 |
|
2373 "Created: / 13-03-2011 / 16:39:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2374 "Modified: / 17-03-2011 / 17:06:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2375 ! |
|
2376 |
|
2377 pushInt: something |
|
2378 "push integer value on the stack" |
|
2379 sp := sp + 1. |
|
2380 context at: sp put: something |
|
2381 |
|
2382 "Created: / 13-03-2011 / 17:28:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2383 "Modified: / 17-03-2011 / 17:06:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2384 ! |
|
2385 |
|
2386 pushLong: something |
|
2387 "push long value on the stack" |
|
2388 |
|
2389 ^ self pushInt: something. |
|
2390 |
|
2391 "sp := sp + 2. |
|
2392 context at: sp - 1 put: #'dummy long complement'. |
|
2393 context at: sp put: something asLargeInteger." |
|
2394 |
|
2395 "Modified: / 17-03-2011 / 17:07:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2396 ! |
|
2397 |
|
2398 pushNewArrayOf: type sized: size |
|
2399 "push new array of type with <size> slots" |
|
2400 |
|
2401 self pushRef: ((JavaArray javaArrayClassFor: type) new: size). |
|
2402 |
|
2403 "Created: / 14-03-2011 / 18:36:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2404 "Modified: / 27-03-2011 / 21:06:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2405 ! |
|
2406 |
|
2407 pushNewPrimitiveArrayOf: typeName sized: size |
|
2408 "push new array of <typeName> (e.g. 'long', only primitive types) with <size> slots" |
|
2409 |
|
2410 self |
|
2411 pushRef: ((JavaArray |
|
2412 javaArrayClassFor: (JavaDescriptor baseTypesByTypeName at: typeName)) |
|
2413 new: size). |
|
2414 |
|
2415 "Created: / 27-03-2011 / 21:06:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2416 ! |
|
2417 |
|
2418 pushRef: something |
|
2419 "push java ref on the stack" |
|
2420 sp := sp + 1. |
|
2421 context at: sp put: something |
|
2422 |
|
2423 "Created: / 13-03-2011 / 16:35:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2424 "Modified: / 21-03-2011 / 16:49:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2425 ! |
|
2426 |
|
2427 relativeJump: pos |
|
2428 "move pc relatively by the position <pos>." |
|
2429 |
|
2430 pc := instrPointer + pos. |
|
2431 |
|
2432 "Created: / 21-03-2011 / 18:19:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2433 ! |
|
2434 |
|
2435 skipPadding |
|
2436 "in tableswitch and lookupswitch instructions, there's a padding after instruction to ensure |
|
2437 32bit values following begin at address that is multiple of 4 bytes from the start of the current |
|
2438 method bytecode" |
|
2439 |
|
2440 | jmpSize | |
|
2441 |
|
2442 jmpSize := ((4 - (pc \\ 4)) + 1) \\ 4. |
|
2443 pc := pc + jmpSize. |
|
2444 ^ jmpSize. |
|
2445 |
|
2446 "Created: / 21-03-2011 / 13:13:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2447 "Modified: / 22-03-2011 / 15:54:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2448 ! |
|
2449 |
|
2450 tos |
|
2451 ^ context at:sp. |
|
2452 ! ! |
|
2453 |
|
2454 !JavaByteCodeProcessor methodsFor:'private-logging'! |
|
2455 |
|
2456 log: aMessage |
|
2457 self class log: aMessage. |
|
2458 |
|
2459 "Created: / 17-03-2011 / 14:59:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2460 ! ! |
|
2461 |
|
2462 !JavaByteCodeProcessor methodsFor:'processing loop'! |
|
2463 |
|
2464 enterProcessingLoop |
|
2465 Context cannotReturnSignal handle: |
|
2466 [:ex | |
|
2467 "/ this is required for blocks of this method, which do a homeReturn. |
|
2468 "/ since my context is not really on the stack (and therefore not returnable), |
|
2469 "/ catch the error and return manually. |
|
2470 ^ ex parameter ] |
|
2471 do: |
|
2472 [ [ leaveProcessor ] whileFalse: |
|
2473 [ instrPointer := pc. |
|
2474 op := byteCode at: pc. |
|
2475 pc := pc + 1. |
|
2476 self switch: op. ]. ]. |
|
2477 |
|
2478 "Created: / 31-03-2011 / 16:38:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2479 ! |
|
2480 |
|
2481 handleAbstractMethod |
|
2482 self subclassResponsibility. |
|
2483 |
|
2484 "Created: / 22-03-2011 / 14:49:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2485 ! |
|
2486 |
|
2487 initializeContextArgsFrom: argArray |
|
2488 1 to: numArgs do: [:idx | context at: idx put: (argArray at: idx). ] |
|
2489 |
|
2490 "Created: / 21-03-2011 / 15:17:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2491 ! |
|
2492 |
|
2493 initializeContextVars |
|
2494 1 to: numVars do: [:idx | context at: (numArgs + idx) put: nil. ] |
|
2495 ! |
|
2496 |
|
2497 leaveProcessorWith: aReturnObject |
|
2498 retVal := aReturnObject. |
|
2499 leaveProcessor := true |
|
2500 |
|
2501 "Modified: / 17-03-2011 / 17:39:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2502 ! |
|
2503 |
|
2504 process: aMethod receiver: aReceiver arguments: args |
|
2505 | argArray | |
|
2506 |
|
2507 aMethod isAbstract |
|
2508 ifTrue: |
|
2509 [ ('Processing abstract method ' , aMethod displayString) infoPrintCR. |
|
2510 ^ self handleAbstractMethod. ]. |
|
2511 args size ~~ aMethod javaNumArgs |
|
2512 ifTrue: [ self error: 'bad number of arguments' ]. |
|
2513 aMethod isStatic |
|
2514 ifTrue: [ argArray := args ] |
|
2515 ifFalse: |
|
2516 [ argArray := OrderedCollection with: aReceiver. |
|
2517 args ifNotNil: [ argArray addAll: args. ]. ]. |
|
2518 numArgs := argArray size. |
|
2519 numVars := aMethod numVars. |
|
2520 method := aMethod. |
|
2521 context := JavaContext new: (numArgs + numVars + aMethod stackSize). |
|
2522 context setNumArgs: numArgs numVars: numVars. |
|
2523 receiver := aReceiver. |
|
2524 byteCode := aMethod byteCode. |
|
2525 constantPool := aMethod constantPool. |
|
2526 pc := 1. |
|
2527 wide := false. |
|
2528 self initializeContextArgsFrom: argArray. |
|
2529 self initializeContextVars. |
|
2530 sp := numArgs + numVars. |
|
2531 leaveProcessor := false. |
|
2532 self enterProcessingLoop. |
|
2533 ^ retVal |
|
2534 |
|
2535 "Modified: / 24-02-2011 / 11:09:07 / Marcel Hlopko <hlopik@gmail.com>" |
|
2536 "Created: / 17-03-2011 / 17:25:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2537 "Modified: / 31-03-2011 / 16:38:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2538 ! |
|
2539 |
|
2540 switch: op |
|
2541 |
|
2542 self log: 'invoking ' , (OpSwitchTable at: op + 1) printString , '(' , op printString , ')'. |
|
2543 self perform: (OpSwitchTable at: op + 1) |
|
2544 |
|
2545 "Modified: / 17-03-2011 / 15:01:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
2546 "Modified: / 22-03-2011 / 20:55:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2547 ! ! |
|
2548 |
|
2549 !JavaByteCodeProcessor class methodsFor:'documentation'! |
|
2550 |
|
2551 version |
|
2552 ^ '$Header: /cvs/stx/cg/newCompiler/ByteCodeProcessor.st,v 1.8 2008/11/04 12:42:00 cg Exp $' |
|
2553 ! |
|
2554 |
|
2555 version_SVN |
|
2556 ^ '$Id$' |
|
2557 ! ! |
|
2558 |
|
2559 JavaByteCodeProcessor initialize! |