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