* Updated to jitcache-arm-x86 branch d4f6023b26c5+d1b5b1c106ac
[cacao.git] / src / vm / jit / ir / bytecode.h
1 /* src/vm/jit/ir/bytecode.h - Java byte code definitions
2
3    Copyright (C) 2007 
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _VM_JIT_IR_BYTECODE_H
27 #define _VM_JIT_IR_BYTECODE_H
28
29 #include "config.h"
30
31
32 /* bytecode_t *****************************************************************/
33
34 typedef struct bytecode_t bytecode_t;
35
36 struct bytecode_t {
37         int   length;                       /* length of the instruction in bytes */
38         int   slots;                        /* required stack slots               */
39         char *mnemonic;
40 };
41
42 extern bytecode_t bytecode[256];
43
44
45 /* Java bytecodes *************************************************************/
46
47 enum {
48         BC_nop             = 0,
49
50         BC_aconst_null     = 1,
51
52         BC_iconst_m1       = 2,
53         BC_iconst_0        = 3,
54         BC_iconst_1        = 4,
55         BC_iconst_2        = 5,
56         BC_iconst_3        = 6,
57         BC_iconst_4        = 7,
58         BC_iconst_5        = 8,
59
60         BC_lconst_0        = 9,
61         BC_lconst_1        = 10,
62
63         BC_fconst_0        = 11,
64         BC_fconst_1        = 12,
65         BC_fconst_2        = 13,
66
67         BC_dconst_0        = 14,
68         BC_dconst_1        = 15,
69
70         BC_bipush          = 16,
71         BC_sipush          = 17,
72
73         BC_ldc1            = 18,
74         BC_ldc2            = 19,
75         BC_ldc2w           = 20,
76
77         BC_iload           = 21,
78         BC_lload           = 22,
79         BC_fload           = 23,
80         BC_dload           = 24,
81         BC_aload           = 25,
82
83         BC_iload_0         = 26,
84         BC_iload_1         = 27,
85         BC_iload_2         = 28,
86         BC_iload_3         = 29,
87
88         BC_lload_0         = 30,
89         BC_lload_1         = 31,
90         BC_lload_2         = 32,
91         BC_lload_3         = 33,
92
93         BC_fload_0         = 34,
94         BC_fload_1         = 35,
95         BC_fload_2         = 36,
96         BC_fload_3         = 37,
97
98         BC_dload_0         = 38,
99         BC_dload_1         = 39,
100         BC_dload_2         = 40,
101         BC_dload_3         = 41,
102
103         BC_aload_0         = 42,
104         BC_aload_1         = 43,
105         BC_aload_2         = 44,
106         BC_aload_3         = 45,
107
108         BC_iaload          = 46,
109         BC_laload          = 47,
110         BC_faload          = 48,
111         BC_daload          = 49,
112         BC_aaload          = 50,
113         BC_baload          = 51,
114         BC_caload          = 52,
115         BC_saload          = 53,
116
117         BC_istore          = 54,
118         BC_lstore          = 55,
119         BC_fstore          = 56,
120         BC_dstore          = 57,
121         BC_astore          = 58,
122
123         BC_istore_0        = 59,
124         BC_istore_1        = 60,
125         BC_istore_2        = 61,
126         BC_istore_3        = 62,
127
128         BC_lstore_0        = 63,
129         BC_lstore_1        = 64,
130         BC_lstore_2        = 65,
131         BC_lstore_3        = 66,
132
133         BC_fstore_0        = 67,
134         BC_fstore_1        = 68,
135         BC_fstore_2        = 69,
136         BC_fstore_3        = 70,
137
138         BC_dstore_0        = 71,
139         BC_dstore_1        = 72,
140         BC_dstore_2        = 73,
141         BC_dstore_3        = 74,
142
143         BC_astore_0        = 75,
144         BC_astore_1        = 76,
145         BC_astore_2        = 77,
146         BC_astore_3        = 78,
147
148         BC_iastore         = 79,
149         BC_lastore         = 80,
150         BC_fastore         = 81,
151         BC_dastore         = 82,
152         BC_aastore         = 83,
153         BC_bastore         = 84,
154         BC_castore         = 85,
155         BC_sastore         = 86,
156
157         BC_pop             = 87,
158         BC_pop2            = 88,
159         BC_dup             = 89,
160         BC_dup_x1          = 90,
161         BC_dup_x2          = 91,
162         BC_dup2            = 92,
163         BC_dup2_x1         = 93,
164         BC_dup2_x2         = 94,
165         BC_swap            = 95,
166
167         BC_iadd            = 96,
168         BC_ladd            = 97,
169         BC_fadd            = 98,
170         BC_dadd            = 99,
171
172         BC_isub            = 100,
173         BC_lsub            = 101,
174         BC_fsub            = 102,
175         BC_dsub            = 103,
176
177         BC_imul            = 104,
178         BC_lmul            = 105,
179         BC_fmul            = 106,
180         BC_dmul            = 107,
181
182         BC_idiv            = 108,
183         BC_ldiv            = 109,
184         BC_fdiv            = 110,
185         BC_ddiv            = 111,
186
187         BC_irem            = 112,
188         BC_lrem            = 113,
189         BC_frem            = 114,
190         BC_drem            = 115,
191
192         BC_ineg            = 116,
193         BC_lneg            = 117,
194         BC_fneg            = 118,
195         BC_dneg            = 119,
196
197         BC_ishl            = 120,
198         BC_lshl            = 121,
199         BC_ishr            = 122,
200         BC_lshr            = 123,
201         BC_iushr           = 124,
202         BC_lushr           = 125,
203
204         BC_iand            = 126,
205         BC_land            = 127,
206         BC_ior             = 128,
207         BC_lor             = 129,
208         BC_ixor            = 130,
209         BC_lxor            = 131,
210
211         BC_iinc            = 132,
212
213         BC_i2l             = 133,
214         BC_i2f             = 134,
215         BC_i2d             = 135,
216         BC_l2i             = 136,
217         BC_l2f             = 137,
218         BC_l2d             = 138,
219         BC_f2i             = 139,
220         BC_f2l             = 140,
221         BC_f2d             = 141,
222         BC_d2i             = 142,
223         BC_d2l             = 143,
224         BC_d2f             = 144,
225
226         BC_int2byte        = 145,
227         BC_int2char        = 146,
228         BC_int2short       = 147,
229
230         BC_lcmp            = 148,
231         BC_fcmpl           = 149,
232         BC_fcmpg           = 150,
233         BC_dcmpl           = 151,
234         BC_dcmpg           = 152,
235
236         BC_ifeq            = 153,
237         BC_ifne            = 154,
238         BC_iflt            = 155,
239         BC_ifge            = 156,
240         BC_ifgt            = 157,
241         BC_ifle            = 158,
242
243         BC_if_icmpeq       = 159,
244         BC_if_icmpne       = 160,
245         BC_if_icmplt       = 161,
246         BC_if_icmpge       = 162,
247         BC_if_icmpgt       = 163,
248         BC_if_icmple       = 164,
249         BC_if_acmpeq       = 165,
250         BC_if_acmpne       = 166,
251
252         BC_goto            = 167,
253         BC_jsr             = 168,
254         BC_ret             = 169,
255
256         BC_tableswitch     = 170,
257         BC_lookupswitch    = 171,
258
259         BC_ireturn         = 172,
260         BC_lreturn         = 173,
261         BC_freturn         = 174,
262         BC_dreturn         = 175,
263         BC_areturn         = 176,
264         BC_return          = 177,
265
266         BC_getstatic       = 178,
267         BC_putstatic       = 179,
268         BC_getfield        = 180,
269         BC_putfield        = 181,
270
271         BC_invokevirtual   = 182,
272         BC_invokespecial   = 183,
273         BC_invokestatic    = 184,
274         BC_invokeinterface = 185,
275
276         /* xxxunusedxxx 186 */
277
278         BC_new             = 187,
279         BC_newarray        = 188,
280         BC_anewarray       = 189,
281
282         BC_arraylength     = 190,
283
284         BC_athrow          = 191,
285
286         BC_checkcast       = 192,
287         BC_instanceof      = 193,
288
289         BC_monitorenter    = 194,
290         BC_monitorexit     = 195,
291
292         BC_wide            = 196,
293
294         BC_multianewarray  = 197,
295
296         BC_ifnull          = 198,
297         BC_ifnonnull       = 199,
298
299         BC_goto_w          = 200,
300         BC_jsr_w           = 201,
301
302         /* Reserved opcodes. */
303
304         BC_breakpoint      = 202,
305
306         BC_impdep1         = 254,
307         BC_impdep2         = 255
308 };
309
310 #endif /* _VM_JIT_IR_BYTECODE_H */
311
312
313 /*
314  * These are local overrides for various environment variables in Emacs.
315  * Please do not remove this and leave it at the end of the file, where
316  * Emacs will automagically detect them.
317  * ---------------------------------------------------------------------
318  * Local variables:
319  * mode: c
320  * indent-tabs-mode: t
321  * c-basic-offset: 4
322  * tab-width: 4
323  * End:
324  * vim:noexpandtab:sw=4:ts=4:
325  */