CACAO
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
source
cacao
src
vm
jit
ir
bytecode.hpp
Go to the documentation of this file.
1
/* src/vm/jit/ir/bytecode.hpp - 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 BYTECODE_HPP_
27
#define BYTECODE_HPP_ 1
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
const
char
*
mnemonic
;
40
};
41
42
extern
bytecode_t
bytecode
[256];
43
44
45
/* Java bytecodes *************************************************************/
46
47
enum
ByteCode
{
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 // BYTECODE_HPP_
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
*/
BC_dconst_0
Definition:
bytecode.hpp:67
bytecode_t::slots
int slots
Definition:
bytecode.hpp:38
BC_dastore
Definition:
bytecode.hpp:151
BC_ireturn
Definition:
bytecode.hpp:259
BC_istore
Definition:
bytecode.hpp:117
BC_l2f
Definition:
bytecode.hpp:217
BC_lmul
Definition:
bytecode.hpp:178
BC_iflt
Definition:
bytecode.hpp:238
BC_areturn
Definition:
bytecode.hpp:263
BC_return
Definition:
bytecode.hpp:264
BC_arraylength
Definition:
bytecode.hpp:282
BC_if_icmpge
Definition:
bytecode.hpp:246
BC_tableswitch
Definition:
bytecode.hpp:256
BC_lload_3
Definition:
bytecode.hpp:91
BC_iastore
Definition:
bytecode.hpp:148
BC_astore_1
Definition:
bytecode.hpp:144
BC_d2l
Definition:
bytecode.hpp:223
BC_lrem
Definition:
bytecode.hpp:188
bytecode_t
Definition:
bytecode.hpp:36
BC_aload_2
Definition:
bytecode.hpp:105
BC_fload_0
Definition:
bytecode.hpp:93
BC_if_icmple
Definition:
bytecode.hpp:248
BC_fsub
Definition:
bytecode.hpp:174
BC_dneg
Definition:
bytecode.hpp:195
BC_freturn
Definition:
bytecode.hpp:261
BC_dload_3
Definition:
bytecode.hpp:101
BC_invokespecial
Definition:
bytecode.hpp:272
BC_caload
Definition:
bytecode.hpp:114
BC_iload
Definition:
bytecode.hpp:77
BC_fcmpl
Definition:
bytecode.hpp:231
BC_istore_1
Definition:
bytecode.hpp:124
BC_impdep2
Definition:
bytecode.hpp:307
BC_newarray
Definition:
bytecode.hpp:279
BC_dload_1
Definition:
bytecode.hpp:99
BC_lookupswitch
Definition:
bytecode.hpp:257
BC_iand
Definition:
bytecode.hpp:204
BC_dmul
Definition:
bytecode.hpp:180
BC_iload_0
Definition:
bytecode.hpp:83
BC_frem
Definition:
bytecode.hpp:189
BC_ineg
Definition:
bytecode.hpp:192
BC_if_icmpne
Definition:
bytecode.hpp:244
BC_dstore_0
Definition:
bytecode.hpp:138
BC_jsr_w
Definition:
bytecode.hpp:300
BC_anewarray
Definition:
bytecode.hpp:280
BC_dup_x2
Definition:
bytecode.hpp:161
BC_lneg
Definition:
bytecode.hpp:193
BC_lastore
Definition:
bytecode.hpp:149
BC_fconst_2
Definition:
bytecode.hpp:65
BC_if_icmpgt
Definition:
bytecode.hpp:247
BC_if_icmplt
Definition:
bytecode.hpp:245
BC_fdiv
Definition:
bytecode.hpp:184
BC_pop2
Definition:
bytecode.hpp:158
BC_iinc
Definition:
bytecode.hpp:211
BC_bipush
Definition:
bytecode.hpp:70
BC_f2i
Definition:
bytecode.hpp:219
BC_castore
Definition:
bytecode.hpp:154
BC_dstore_3
Definition:
bytecode.hpp:141
BC_dload
Definition:
bytecode.hpp:80
BC_getstatic
Definition:
bytecode.hpp:266
BC_fstore_1
Definition:
bytecode.hpp:134
BC_imul
Definition:
bytecode.hpp:177
BC_fconst_1
Definition:
bytecode.hpp:64
BC_dadd
Definition:
bytecode.hpp:170
BC_d2f
Definition:
bytecode.hpp:224
BC_ret
Definition:
bytecode.hpp:254
BC_impdep1
Definition:
bytecode.hpp:306
BC_dcmpl
Definition:
bytecode.hpp:233
BC_fcmpg
Definition:
bytecode.hpp:232
BC_getfield
Definition:
bytecode.hpp:268
BC_fneg
Definition:
bytecode.hpp:194
BC_idiv
Definition:
bytecode.hpp:182
BC_goto
Definition:
bytecode.hpp:252
BC_iconst_4
Definition:
bytecode.hpp:57
BC_breakpoint
Definition:
bytecode.hpp:304
BC_aload_1
Definition:
bytecode.hpp:104
BC_lstore_2
Definition:
bytecode.hpp:130
BC_int2byte
Definition:
bytecode.hpp:226
BC_lor
Definition:
bytecode.hpp:207
BC_astore
Definition:
bytecode.hpp:121
BC_iload_2
Definition:
bytecode.hpp:85
BC_multianewarray
Definition:
bytecode.hpp:294
bytecode_t::mnemonic
const char * mnemonic
Definition:
bytecode.hpp:39
BC_lstore_3
Definition:
bytecode.hpp:131
BC_monitorexit
Definition:
bytecode.hpp:290
BC_bastore
Definition:
bytecode.hpp:153
BC_lxor
Definition:
bytecode.hpp:209
BC_fstore_3
Definition:
bytecode.hpp:136
BC_d2i
Definition:
bytecode.hpp:222
BC_ifne
Definition:
bytecode.hpp:237
BC_l2d
Definition:
bytecode.hpp:218
BC_ixor
Definition:
bytecode.hpp:208
BC_invokeinterface
Definition:
bytecode.hpp:274
BC_lreturn
Definition:
bytecode.hpp:260
BC_invokestatic
Definition:
bytecode.hpp:273
BC_iconst_1
Definition:
bytecode.hpp:54
BC_istore_2
Definition:
bytecode.hpp:125
BC_fload
Definition:
bytecode.hpp:79
BC_ifnonnull
Definition:
bytecode.hpp:297
BC_ishl
Definition:
bytecode.hpp:197
BC_iconst_m1
Definition:
bytecode.hpp:52
BC_lsub
Definition:
bytecode.hpp:173
BC_dstore_1
Definition:
bytecode.hpp:139
BC_dsub
Definition:
bytecode.hpp:175
BC_checkcast
Definition:
bytecode.hpp:286
BC_lload
Definition:
bytecode.hpp:78
BC_daload
Definition:
bytecode.hpp:111
BC_ifle
Definition:
bytecode.hpp:241
BC_dconst_1
Definition:
bytecode.hpp:68
BC_i2f
Definition:
bytecode.hpp:214
BC_astore_0
Definition:
bytecode.hpp:143
BC_astore_3
Definition:
bytecode.hpp:146
BC_dup
Definition:
bytecode.hpp:159
BC_aload
Definition:
bytecode.hpp:81
BC_ifeq
Definition:
bytecode.hpp:236
BC_fload_3
Definition:
bytecode.hpp:96
BC_new
Definition:
bytecode.hpp:278
BC_istore_0
Definition:
bytecode.hpp:123
BC_isub
Definition:
bytecode.hpp:172
BC_aload_3
Definition:
bytecode.hpp:106
BC_aastore
Definition:
bytecode.hpp:152
BC_fload_1
Definition:
bytecode.hpp:94
BC_fconst_0
Definition:
bytecode.hpp:63
BC_dreturn
Definition:
bytecode.hpp:262
BC_aconst_null
Definition:
bytecode.hpp:50
BC_sipush
Definition:
bytecode.hpp:71
BC_i2d
Definition:
bytecode.hpp:215
BC_fload_2
Definition:
bytecode.hpp:95
BC_iconst_5
Definition:
bytecode.hpp:58
BC_if_icmpeq
Definition:
bytecode.hpp:243
BC_iushr
Definition:
bytecode.hpp:201
BC_ifge
Definition:
bytecode.hpp:239
BC_l2i
Definition:
bytecode.hpp:216
BC_faload
Definition:
bytecode.hpp:110
BC_dup2_x1
Definition:
bytecode.hpp:163
BC_land
Definition:
bytecode.hpp:205
BC_nop
Definition:
bytecode.hpp:48
BC_lload_1
Definition:
bytecode.hpp:89
BC_lcmp
Definition:
bytecode.hpp:230
BC_ddiv
Definition:
bytecode.hpp:185
BC_dup2_x2
Definition:
bytecode.hpp:164
BC_putstatic
Definition:
bytecode.hpp:267
BC_dstore
Definition:
bytecode.hpp:120
BC_lstore_1
Definition:
bytecode.hpp:129
BC_saload
Definition:
bytecode.hpp:115
BC_putfield
Definition:
bytecode.hpp:269
BC_ishr
Definition:
bytecode.hpp:199
BC_jsr
Definition:
bytecode.hpp:253
BC_dup2
Definition:
bytecode.hpp:162
BC_sastore
Definition:
bytecode.hpp:155
BC_i2l
Definition:
bytecode.hpp:213
BC_lstore
Definition:
bytecode.hpp:118
ByteCode
ByteCode
Definition:
bytecode.hpp:47
BC_iadd
Definition:
bytecode.hpp:167
BC_astore_2
Definition:
bytecode.hpp:145
BC_ifnull
Definition:
bytecode.hpp:296
BC_iconst_3
Definition:
bytecode.hpp:56
BC_if_acmpeq
Definition:
bytecode.hpp:249
BC_lconst_1
Definition:
bytecode.hpp:61
BC_lload_0
Definition:
bytecode.hpp:88
bytecode_t::length
int length
Definition:
bytecode.hpp:37
BC_ldc2
Definition:
bytecode.hpp:74
BC_if_acmpne
Definition:
bytecode.hpp:250
BC_iaload
Definition:
bytecode.hpp:108
BC_dstore_2
Definition:
bytecode.hpp:140
BC_fstore_0
Definition:
bytecode.hpp:133
BC_dload_2
Definition:
bytecode.hpp:100
BC_lshr
Definition:
bytecode.hpp:200
BC_ldc2w
Definition:
bytecode.hpp:75
BC_fastore
Definition:
bytecode.hpp:150
BC_lushr
Definition:
bytecode.hpp:202
BC_lload_2
Definition:
bytecode.hpp:90
BC_lshl
Definition:
bytecode.hpp:198
BC_ldiv
Definition:
bytecode.hpp:183
BC_lconst_0
Definition:
bytecode.hpp:60
BC_iload_1
Definition:
bytecode.hpp:84
BC_pop
Definition:
bytecode.hpp:157
BC_iload_3
Definition:
bytecode.hpp:86
BC_ldc1
Definition:
bytecode.hpp:73
BC_fstore_2
Definition:
bytecode.hpp:135
BC_laload
Definition:
bytecode.hpp:109
BC_wide
Definition:
bytecode.hpp:292
bytecode
bytecode_t bytecode[256]
Definition:
bytecode.cpp:33
BC_athrow
Definition:
bytecode.hpp:284
BC_aload_0
Definition:
bytecode.hpp:103
BC_irem
Definition:
bytecode.hpp:187
BC_monitorenter
Definition:
bytecode.hpp:289
BC_ladd
Definition:
bytecode.hpp:168
BC_ifgt
Definition:
bytecode.hpp:240
BC_invokevirtual
Definition:
bytecode.hpp:271
BC_instanceof
Definition:
bytecode.hpp:287
BC_istore_3
Definition:
bytecode.hpp:126
BC_dcmpg
Definition:
bytecode.hpp:234
BC_aaload
Definition:
bytecode.hpp:112
BC_f2d
Definition:
bytecode.hpp:221
BC_ior
Definition:
bytecode.hpp:206
BC_lstore_0
Definition:
bytecode.hpp:128
BC_baload
Definition:
bytecode.hpp:113
BC_fmul
Definition:
bytecode.hpp:179
BC_dload_0
Definition:
bytecode.hpp:98
BC_drem
Definition:
bytecode.hpp:190
BC_fstore
Definition:
bytecode.hpp:119
BC_swap
Definition:
bytecode.hpp:165
BC_iconst_0
Definition:
bytecode.hpp:53
BC_f2l
Definition:
bytecode.hpp:220
BC_dup_x1
Definition:
bytecode.hpp:160
BC_int2char
Definition:
bytecode.hpp:227
BC_fadd
Definition:
bytecode.hpp:169
BC_int2short
Definition:
bytecode.hpp:228
BC_goto_w
Definition:
bytecode.hpp:299
BC_iconst_2
Definition:
bytecode.hpp:55
Generated on Fri Aug 4 2017 03:01:53 for CACAO by
1.8.5