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