blob: 429955615a85c406894e6ddef125e59e1953774c [file] [log] [blame]
Stuart McCulloch39cc9ac2012-07-16 13:43:38 +00001package aQute.bnd.osgi;
Stuart McCullochbb014372012-06-07 21:57:32 +00002
3public class OpCodes {
Stuart McCulloch2286f232012-06-15 13:27:53 +00004 final static short nop = 0x00; // [No change]
5 // performs
6 // no
Stuart McCullochbb014372012-06-07 21:57:32 +00007 // operation
Stuart McCulloch2286f232012-06-15 13:27:53 +00008 final static short aconst_null = 0x01; // ? null pushes a
9 // null
Stuart McCullochbb014372012-06-07 21:57:32 +000010 // reference onto the stack
Stuart McCulloch2286f232012-06-15 13:27:53 +000011 final static short iconst_m1 = 0x02; // ? -1 loads the
12 // int
13 // value -1
Stuart McCullochbb014372012-06-07 21:57:32 +000014 // onto the stack
15 final static short iconst_0 = 0x03; // ? 0 loads the int
Stuart McCulloch2286f232012-06-15 13:27:53 +000016 // value 0
Stuart McCullochbb014372012-06-07 21:57:32 +000017 // onto the stack
18 final static short iconst_1 = 0x04; // ? 1 loads the int
Stuart McCulloch2286f232012-06-15 13:27:53 +000019 // value 1
Stuart McCullochbb014372012-06-07 21:57:32 +000020 // onto the stack
21 final static short iconst_2 = 0x05; // ? 2 loads the int
Stuart McCulloch2286f232012-06-15 13:27:53 +000022 // value 2
Stuart McCullochbb014372012-06-07 21:57:32 +000023 // onto the stack
24 final static short iconst_3 = 0x06; // ? 3 loads the int
Stuart McCulloch2286f232012-06-15 13:27:53 +000025 // value 3
Stuart McCullochbb014372012-06-07 21:57:32 +000026 // onto the stack
27 final static short iconst_4 = 0x07; // ? 4 loads the int
Stuart McCulloch2286f232012-06-15 13:27:53 +000028 // value 4
Stuart McCullochbb014372012-06-07 21:57:32 +000029 // onto the stack
30 final static short iconst_5 = 0x08; // ? 5 loads the int
Stuart McCulloch2286f232012-06-15 13:27:53 +000031 // value 5
Stuart McCullochbb014372012-06-07 21:57:32 +000032 // onto the stack
Stuart McCulloch2286f232012-06-15 13:27:53 +000033 final static short lconst_0 = 0x09; // ? 0L pushes the
34 // long
35 // 0 onto
Stuart McCullochbb014372012-06-07 21:57:32 +000036 // the stack
Stuart McCulloch2286f232012-06-15 13:27:53 +000037 final static short bipush = 0x10; // byte ? value
38 // pushes a
39 // byte
Stuart McCullochbb014372012-06-07 21:57:32 +000040 // onto the stack as an integer
41 // value
Stuart McCulloch2286f232012-06-15 13:27:53 +000042 final static short sipush = 0x11; // byte1, byte2 ?
43 // value
44 // pushes a
Stuart McCullochbb014372012-06-07 21:57:32 +000045 // signed integer (byte1 << 8 +
46 // byte2) onto the stack
Stuart McCulloch2286f232012-06-15 13:27:53 +000047 final static short ldc = 0x12; // index ? value
48 // pushes
49 // a
Stuart McCullochbb014372012-06-07 21:57:32 +000050 // constant #index from a
51 // constant pool (String, int,
52 // float or class type) onto the
53 // stack
54 final static short ldc_w = 0x13; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +000055 // indexbyte2 ?
Stuart McCullochbb014372012-06-07 21:57:32 +000056 // value pushes a constant
57 // #index from a constant pool
58 // (String, int, float or class
59 // type) onto the stack (wide
60 // index is constructed as
61 // indexbyte1 << 8 + indexbyte2)
62 final static short ldc2_w = 0x14; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +000063 // indexbyte2 ?
Stuart McCullochbb014372012-06-07 21:57:32 +000064 // value pushes a constant
65 // #index from a constant pool
66 // (double or long) onto the
67 // stack (wide index is
68 // constructed as indexbyte1 <<
69 // 8 + indexbyte2)
Stuart McCulloch2286f232012-06-15 13:27:53 +000070 final static short iload = 0x15; // index ? value
71 // loads
72 // an int
Stuart McCullochbb014372012-06-07 21:57:32 +000073 // value from a variable #index
Stuart McCulloch2286f232012-06-15 13:27:53 +000074 final static short lload = 0x16; // index ? value
75 // load a
76 // long
Stuart McCullochbb014372012-06-07 21:57:32 +000077 // value from a local variable
78 // #index
Stuart McCulloch2286f232012-06-15 13:27:53 +000079 final static short fload = 0x17; // index ? value
80 // loads a
81 // float
Stuart McCullochbb014372012-06-07 21:57:32 +000082 // value from a local variable
83 // #index
Stuart McCulloch2286f232012-06-15 13:27:53 +000084 final static short dload = 0x18; // index ? value
85 // loads a
86 // double
Stuart McCullochbb014372012-06-07 21:57:32 +000087 // value from a local variable
88 // #index
89 final static short aload = 0x19; // index ? objectref
Stuart McCulloch2286f232012-06-15 13:27:53 +000090 // loads a
Stuart McCullochbb014372012-06-07 21:57:32 +000091 // reference onto the stack from
92 // a local variable #index
Stuart McCulloch2286f232012-06-15 13:27:53 +000093 final static short lload_2 = 0x20; // ? value load a
94 // long
95 // value
Stuart McCullochbb014372012-06-07 21:57:32 +000096 // from a local variable 2
Stuart McCulloch2286f232012-06-15 13:27:53 +000097 final static short lload_3 = 0x21; // ? value load a
98 // long
99 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000100 // from a local variable 3
Stuart McCulloch2286f232012-06-15 13:27:53 +0000101 final static short fload_0 = 0x22; // ? value loads a
102 // float
103 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000104 // from local variable 0
Stuart McCulloch2286f232012-06-15 13:27:53 +0000105 final static short fload_1 = 0x23; // ? value loads a
106 // float
107 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000108 // from local variable 1
Stuart McCulloch2286f232012-06-15 13:27:53 +0000109 final static short fload_2 = 0x24; // ? value loads a
110 // float
111 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000112 // from local variable 2
Stuart McCulloch2286f232012-06-15 13:27:53 +0000113 final static short fload_3 = 0x25; // ? value loads a
114 // float
115 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000116 // from local variable 3
117 final static short dload_0 = 0x26; // ? value loads a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000118 // double from
Stuart McCullochbb014372012-06-07 21:57:32 +0000119 // local variable 0
120 final static short dload_1 = 0x27; // ? value loads a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000121 // double from
Stuart McCullochbb014372012-06-07 21:57:32 +0000122 // local variable 1
123 final static short dload_2 = 0x28; // ? value loads a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000124 // double from
Stuart McCullochbb014372012-06-07 21:57:32 +0000125 // local variable 2
126 final static short dload_3 = 0x29; // ? value loads a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000127 // double from
Stuart McCullochbb014372012-06-07 21:57:32 +0000128 // local variable 3
129 final static short faload = 0x30; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000130 // value loads
Stuart McCullochbb014372012-06-07 21:57:32 +0000131 // a float from an array
132 final static short daload = 0x31; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000133 // value loads
Stuart McCullochbb014372012-06-07 21:57:32 +0000134 // a double from an array
135 final static short aaload = 0x32; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000136 // value loads
Stuart McCullochbb014372012-06-07 21:57:32 +0000137 // onto the stack a reference
138 // from an array
139 final static short baload = 0x33; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000140 // value loads
Stuart McCullochbb014372012-06-07 21:57:32 +0000141 // a byte or Boolean value from
142 // an array
143 final static short caload = 0x34; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000144 // value loads
Stuart McCullochbb014372012-06-07 21:57:32 +0000145 // a char from an array
146 final static short saload = 0x35; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000147 // value load
Stuart McCullochbb014372012-06-07 21:57:32 +0000148 // short from array
Stuart McCulloch2286f232012-06-15 13:27:53 +0000149 final static short istore = 0x36; // index value ?
150 // store
151 // int value
Stuart McCullochbb014372012-06-07 21:57:32 +0000152 // into variable #index
Stuart McCulloch2286f232012-06-15 13:27:53 +0000153 final static short lstore = 0x37; // index value ?
154 // store a
155 // long
Stuart McCullochbb014372012-06-07 21:57:32 +0000156 // value in a local variable
157 // #index
Stuart McCulloch2286f232012-06-15 13:27:53 +0000158 final static short fstore = 0x38; // index value ?
159 // stores
160 // a float
Stuart McCullochbb014372012-06-07 21:57:32 +0000161 // value into a local variable
162 // #index
Stuart McCulloch2286f232012-06-15 13:27:53 +0000163 final static short dstore = 0x39; // index value ?
164 // stores
165 // a double
Stuart McCullochbb014372012-06-07 21:57:32 +0000166 // value into a local variable
167 // #index
Stuart McCulloch2286f232012-06-15 13:27:53 +0000168 final static short lstore_1 = 0x40; // value ? store a
169 // long
170 // value in
Stuart McCullochbb014372012-06-07 21:57:32 +0000171 // a local variable 1
Stuart McCulloch2286f232012-06-15 13:27:53 +0000172 final static short lstore_2 = 0x41; // value ? store a
173 // long
174 // value in
Stuart McCullochbb014372012-06-07 21:57:32 +0000175 // a local variable 2
Stuart McCulloch2286f232012-06-15 13:27:53 +0000176 final static short lstore_3 = 0x42; // value ? store a
177 // long
178 // value in
Stuart McCullochbb014372012-06-07 21:57:32 +0000179 // a local variable 3
180 final static short fstore_0 = 0x43; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000181 // float value
Stuart McCullochbb014372012-06-07 21:57:32 +0000182 // into local variable 0
183 final static short fstore_1 = 0x44; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000184 // float value
Stuart McCullochbb014372012-06-07 21:57:32 +0000185 // into local variable 1
186 final static short fstore_2 = 0x45; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000187 // float value
Stuart McCullochbb014372012-06-07 21:57:32 +0000188 // into local variable 2
189 final static short fstore_3 = 0x46; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000190 // float value
Stuart McCullochbb014372012-06-07 21:57:32 +0000191 // into local variable 3
192 final static short dstore_0 = 0x47; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000193 // double into
Stuart McCullochbb014372012-06-07 21:57:32 +0000194 // local variable 0
195 final static short dstore_1 = 0x48; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000196 // double into
Stuart McCullochbb014372012-06-07 21:57:32 +0000197 // local variable 1
198 final static short dstore_2 = 0x49; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000199 // double into
Stuart McCullochbb014372012-06-07 21:57:32 +0000200 // local variable 2
201 final static short lastore = 0x50; // arrayref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000202 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000203 // store a long to an array
204 final static short fastore = 0x51; // arreyref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000205 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000206 // stores a float in an array
207 final static short dastore = 0x52; // arrayref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000208 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000209 // stores a double into an array
210 final static short aastore = 0x53; // arrayref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000211 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000212 // stores into a reference to an
213 // array
214 final static short bastore = 0x54; // arrayref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000215 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000216 // stores a byte or Boolean
217 // value into an array
218 final static short castore = 0x55; // arrayref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000219 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000220 // stores a char into an array
221 final static short sastore = 0x56; // arrayref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000222 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000223 // store short to array
Stuart McCulloch2286f232012-06-15 13:27:53 +0000224 final static short pop = 0x57; // value ? discards
225 // the
226 // top
Stuart McCullochbb014372012-06-07 21:57:32 +0000227 // value on the stack
Stuart McCulloch2286f232012-06-15 13:27:53 +0000228 final static short pop2 = 0x58; // {value2, value1}
229 // ?
230 // discards
Stuart McCullochbb014372012-06-07 21:57:32 +0000231 // the top two values on the
232 // stack (or one value, if it is
233 // a double or long)
Stuart McCulloch2286f232012-06-15 13:27:53 +0000234 final static short dup = 0x59; // value ? value,
235 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000236 // duplicates the value on top
237 // of the stack
238 final static short iadd = 0x60; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000239 // result adds
Stuart McCullochbb014372012-06-07 21:57:32 +0000240 // two ints together
241 final static short ladd = 0x61; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000242 // result add
Stuart McCullochbb014372012-06-07 21:57:32 +0000243 // two longs
244 final static short fadd = 0x62; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000245 // result adds
Stuart McCullochbb014372012-06-07 21:57:32 +0000246 // two floats
247 final static short dadd = 0x63; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000248 // result adds
Stuart McCullochbb014372012-06-07 21:57:32 +0000249 // two doubles
250 final static short isub = 0x64; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000251 // result int
Stuart McCullochbb014372012-06-07 21:57:32 +0000252 // subtract
253 final static short lsub = 0x65; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000254 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000255 // subtract two longs
256 final static short fsub = 0x66; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000257 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000258 // subtracts two floats
259 final static short dsub = 0x67; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000260 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000261 // subtracts a double from
262 // another
263 final static short imul = 0x68; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000264 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000265 // multiply two integers
266 final static short lmul = 0x69; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000267 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000268 // multiplies two longs
269 final static short irem = 0x70; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000270 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000271 // logical int remainder
272 final static short lrem = 0x71; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000273 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000274 // remainder of division of two
275 // longs
276 final static short frem = 0x72; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000277 // result gets
Stuart McCullochbb014372012-06-07 21:57:32 +0000278 // the remainder from a division
279 // between two floats
280 final static short drem = 0x73; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000281 // result gets
Stuart McCullochbb014372012-06-07 21:57:32 +0000282 // the remainder from a division
283 // between two doubles
Stuart McCulloch2286f232012-06-15 13:27:53 +0000284 final static short ineg = 0x74; // value ? result
285 // negate
286 // int
Stuart McCullochbb014372012-06-07 21:57:32 +0000287 final static short lneg = 0x75; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000288 // negates a long
Stuart McCullochbb014372012-06-07 21:57:32 +0000289 final static short fneg = 0x76; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000290 // negates a
Stuart McCullochbb014372012-06-07 21:57:32 +0000291 // float
292 final static short dneg = 0x77; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000293 // negates a
Stuart McCullochbb014372012-06-07 21:57:32 +0000294 // double
295 final static short ishl = 0x78; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000296 // result int
Stuart McCullochbb014372012-06-07 21:57:32 +0000297 // shift left
298 final static short lshl = 0x79; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000299 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000300 // bitwise shift left of a long
301 // value1 by value2 positions
302 final static short ior = 0x80; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000303 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000304 // logical int or
305 final static short lor = 0x81; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000306 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000307 // bitwise or of two longs
308 final static short ixor = 0x82; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000309 // result int
Stuart McCullochbb014372012-06-07 21:57:32 +0000310 // xor
311 final static short lxor = 0x83; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000312 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000313 // bitwise exclusive or of two
314 // longs
315 final static short iinc = 0x84; // index, const [No
Stuart McCulloch2286f232012-06-15 13:27:53 +0000316 // change]
Stuart McCullochbb014372012-06-07 21:57:32 +0000317 // increment local variable
318 // #index by signed byte const
319 final static short i2l = 0x85; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000320 // converts an
Stuart McCullochbb014372012-06-07 21:57:32 +0000321 // int into a long
322 final static short i2f = 0x86; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000323 // converts an
Stuart McCullochbb014372012-06-07 21:57:32 +0000324 // int into a float
325 final static short i2d = 0x87; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000326 // converts an
Stuart McCullochbb014372012-06-07 21:57:32 +0000327 // int into a double
328 final static short l2i = 0x88; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000329 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000330 // long to an int
331 final static short l2f = 0x89; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000332 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000333 // long to a float
334 final static short d2f = 0x90; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000335 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000336 // double to a float
337 final static short i2b = 0x91; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000338 // converts an
Stuart McCullochbb014372012-06-07 21:57:32 +0000339 // int into a byte
340 final static short i2c = 0x92; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000341 // converts an
Stuart McCullochbb014372012-06-07 21:57:32 +0000342 // int into a character
343 final static short i2s = 0x93; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000344 // converts an
Stuart McCullochbb014372012-06-07 21:57:32 +0000345 // int into a short
346 final static short lcmp = 0x94; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000347 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000348 // compares two longs values
349 final static short fcmpl = 0x95; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000350 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000351 // compares two floats
352 final static short fcmpg = 0x96; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000353 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000354 // compares two floats
355 final static short dcmpl = 0x97; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000356 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000357 // compares two doubles
358 final static short dcmpg = 0x98; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000359 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000360 // compares two doubles
361 final static short ifeq = 0x99; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000362 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000363 // value ? if value is 0, branch
364 // to instruction at
365 // branchoffset (signed short
366 // constructed from unsigned
367 // bytes branchbyte1 << 8 +
368 // branchbyte2)
Stuart McCulloch2286f232012-06-15 13:27:53 +0000369 final static short lconst_1 = 0x0a; // ? 1L pushes the
370 // long
371 // 1 onto
Stuart McCullochbb014372012-06-07 21:57:32 +0000372 // the stack
Stuart McCulloch2286f232012-06-15 13:27:53 +0000373 final static short fconst_0 = 0x0b; // ? 0.0f pushes
374 // 0.0f on
375 // the
Stuart McCullochbb014372012-06-07 21:57:32 +0000376 // stack
Stuart McCulloch2286f232012-06-15 13:27:53 +0000377 final static short fconst_1 = 0x0c; // ? 1.0f pushes
378 // 1.0f on
379 // the
Stuart McCullochbb014372012-06-07 21:57:32 +0000380 // stack
Stuart McCulloch2286f232012-06-15 13:27:53 +0000381 final static short fconst_2 = 0x0d; // ? 2.0f pushes
382 // 2.0f on
383 // the
Stuart McCullochbb014372012-06-07 21:57:32 +0000384 // stack
385 final static short dconst_0 = 0x0e; // ? 0.0 pushes the
Stuart McCulloch2286f232012-06-15 13:27:53 +0000386 // constant 0.0
Stuart McCullochbb014372012-06-07 21:57:32 +0000387 // onto the stack
388 final static short dconst_1 = 0x0f; // ? 1.0 pushes the
Stuart McCulloch2286f232012-06-15 13:27:53 +0000389 // constant 1.0
Stuart McCullochbb014372012-06-07 21:57:32 +0000390 // onto the stack
Stuart McCulloch2286f232012-06-15 13:27:53 +0000391 final static short iload_0 = 0x1a; // ? value loads an
392 // int
393 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000394 // from variable 0
Stuart McCulloch2286f232012-06-15 13:27:53 +0000395 final static short iload_1 = 0x1b; // ? value loads an
396 // int
397 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000398 // from variable 1
Stuart McCulloch2286f232012-06-15 13:27:53 +0000399 final static short iload_2 = 0x1c; // ? value loads an
400 // int
401 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000402 // from variable 2
Stuart McCulloch2286f232012-06-15 13:27:53 +0000403 final static short iload_3 = 0x1d; // ? value loads an
404 // int
405 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000406 // from variable 3
Stuart McCulloch2286f232012-06-15 13:27:53 +0000407 final static short lload_0 = 0x1e; // ? value load a
408 // long
409 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000410 // from a local variable 0
Stuart McCulloch2286f232012-06-15 13:27:53 +0000411 final static short lload_1 = 0x1f; // ? value load a
412 // long
413 // value
Stuart McCullochbb014372012-06-07 21:57:32 +0000414 // from a local variable 1
Stuart McCulloch2286f232012-06-15 13:27:53 +0000415 final static short aload_0 = 0x2a; // ? objectref loads
416 // a
417 // reference
Stuart McCullochbb014372012-06-07 21:57:32 +0000418 // onto the stack from local
419 // variable 0
Stuart McCulloch2286f232012-06-15 13:27:53 +0000420 final static short aload_1 = 0x2b; // ? objectref loads
421 // a
422 // reference
Stuart McCullochbb014372012-06-07 21:57:32 +0000423 // onto the stack from local
424 // variable 1
Stuart McCulloch2286f232012-06-15 13:27:53 +0000425 final static short aload_2 = 0x2c; // ? objectref loads
426 // a
427 // reference
Stuart McCullochbb014372012-06-07 21:57:32 +0000428 // onto the stack from local
429 // variable 2
Stuart McCulloch2286f232012-06-15 13:27:53 +0000430 final static short aload_3 = 0x2d; // ? objectref loads
431 // a
432 // reference
Stuart McCullochbb014372012-06-07 21:57:32 +0000433 // onto the stack from local
434 // variable 3
435 final static short iaload = 0x2e; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000436 // value loads
Stuart McCullochbb014372012-06-07 21:57:32 +0000437 // an int from an array
438 final static short laload = 0x2f; // arrayref, index ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000439 // value load
Stuart McCullochbb014372012-06-07 21:57:32 +0000440 // a long from an array
441 final static short astore = 0x3a; // index objectref ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000442 // stores a
Stuart McCullochbb014372012-06-07 21:57:32 +0000443 // reference into a local
444 // variable #index
445 final static short istore_0 = 0x3b; // value ? store int
Stuart McCulloch2286f232012-06-15 13:27:53 +0000446 // value into
Stuart McCullochbb014372012-06-07 21:57:32 +0000447 // variable 0
448 final static short istore_1 = 0x3c; // value ? store int
Stuart McCulloch2286f232012-06-15 13:27:53 +0000449 // value into
Stuart McCullochbb014372012-06-07 21:57:32 +0000450 // variable 1
451 final static short istore_2 = 0x3d; // value ? store int
Stuart McCulloch2286f232012-06-15 13:27:53 +0000452 // value into
Stuart McCullochbb014372012-06-07 21:57:32 +0000453 // variable 2
454 final static short istore_3 = 0x3e; // value ? store int
Stuart McCulloch2286f232012-06-15 13:27:53 +0000455 // value into
Stuart McCullochbb014372012-06-07 21:57:32 +0000456 // variable 3
Stuart McCulloch2286f232012-06-15 13:27:53 +0000457 final static short lstore_0 = 0x3f; // value ? store a
458 // long
459 // value in
Stuart McCullochbb014372012-06-07 21:57:32 +0000460 // a local variable 0
461 final static short dstore_3 = 0x4a; // value ? stores a
Stuart McCulloch2286f232012-06-15 13:27:53 +0000462 // double into
Stuart McCullochbb014372012-06-07 21:57:32 +0000463 // local variable 3
Stuart McCulloch2286f232012-06-15 13:27:53 +0000464 final static short astore_0 = 0x4b; // objectref ?
465 // stores a
Stuart McCullochbb014372012-06-07 21:57:32 +0000466 // reference into local variable
467 // 0
Stuart McCulloch2286f232012-06-15 13:27:53 +0000468 final static short astore_1 = 0x4c; // objectref ?
469 // stores a
Stuart McCullochbb014372012-06-07 21:57:32 +0000470 // reference into local variable
471 // 1
Stuart McCulloch2286f232012-06-15 13:27:53 +0000472 final static short astore_2 = 0x4d; // objectref ?
473 // stores a
Stuart McCullochbb014372012-06-07 21:57:32 +0000474 // reference into local variable
475 // 2
Stuart McCulloch2286f232012-06-15 13:27:53 +0000476 final static short astore_3 = 0x4e; // objectref ?
477 // stores a
Stuart McCullochbb014372012-06-07 21:57:32 +0000478 // reference into local variable
479 // 3
480 final static short iastore = 0x4f; // arrayref, index,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000481 // value ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000482 // stores an int into an array
483 final static short dup_x1 = 0x5a; // value2, value1 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000484 // value1,
Stuart McCullochbb014372012-06-07 21:57:32 +0000485 // value2, value1 inserts a copy
486 // of the top value into the
487 // stack two values from the top
488 final static short dup_x2 = 0x5b; // value3, value2,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000489 // value1 ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000490 // value1, value3, value2,
491 // value1 inserts a copy of the
492 // top value into the stack two
493 // (if value2 is double or long
494 // it takes up the entry of
495 // value3, too) or three values
496 // (if value2 is neither double
497 // nor long) from the top
Stuart McCulloch2286f232012-06-15 13:27:53 +0000498 final static short dup2 = 0x5c; // {value2, value1}
499 // ?
500 // {value2,
Stuart McCullochbb014372012-06-07 21:57:32 +0000501 // value1}, {value2, value1}
502 // duplicate top two stack words
503 // (two values, if value1 is not
504 // double nor long; a single
505 // value, if value1 is double or
506 // long)
507 final static short dup2_x1 = 0x5d; // value3, {value2,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000508 // value1} ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000509 // {value2, value1}, value3,
510 // {value2, value1} duplicate
511 // two words and insert beneath
512 // third word (see explanation
513 // above)
514 final static short dup2_x2 = 0x5e; // {value4, value3},
Stuart McCulloch2286f232012-06-15 13:27:53 +0000515 // {value2,
Stuart McCullochbb014372012-06-07 21:57:32 +0000516 // value1} ? {value2, value1},
517 // {value4, value3}, {value2,
518 // value1} duplicate two words
519 // and insert beneath fourth
520 // word
521 final static short swap = 0x5f; // value2, value1 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000522 // value1,
Stuart McCullochbb014372012-06-07 21:57:32 +0000523 // value2 swaps two top words on
524 // the stack (note that value1
525 // and value2 must not be double
526 // or long)
527 final static short fmul = 0x6a; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000528 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000529 // multiplies two floats
530 final static short dmul = 0x6b; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000531 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000532 // multiplies two doubles
533 final static short idiv = 0x6c; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000534 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000535 // divides two integers
536 final static short ldiv = 0x6d; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000537 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000538 // divide two longs
539 final static short fdiv = 0x6e; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000540 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000541 // divides two floats
542 final static short ddiv = 0x6f; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000543 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000544 // divides two doubles
545 final static short ishr = 0x7a; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000546 // result int
Stuart McCullochbb014372012-06-07 21:57:32 +0000547 // shift right
548 final static short lshr = 0x7b; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000549 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000550 // bitwise shift right of a long
551 // value1 by value2 positions
552 final static short iushr = 0x7c; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000553 // result int
Stuart McCullochbb014372012-06-07 21:57:32 +0000554 // shift right
555 final static short lushr = 0x7d; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000556 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000557 // bitwise shift right of a long
558 // value1 by value2 positions,
559 // unsigned
560 final static short iand = 0x7e; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000561 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000562 // performs a logical and on two
563 // integers
564 final static short land = 0x7f; // value1, value2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000565 // result
Stuart McCullochbb014372012-06-07 21:57:32 +0000566 // bitwise and of two longs
567 final static short l2d = 0x8a; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000568 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000569 // long to a double
570 final static short f2i = 0x8b; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000571 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000572 // float to an int
573 final static short f2l = 0x8c; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000574 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000575 // float to a long
576 final static short f2d = 0x8d; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000577 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000578 // float to a double
579 final static short d2i = 0x8e; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000580 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000581 // double to an int
582 final static short d2l = 0x8f; // value ? result
Stuart McCulloch2286f232012-06-15 13:27:53 +0000583 // converts a
Stuart McCullochbb014372012-06-07 21:57:32 +0000584 // double to a long
585 final static short ifne = 0x9a; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000586 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000587 // value ? if value is not 0,
588 // branch to instruction at
589 // branchoffset (signed short
590 // constructed from unsigned
591 // bytes branchbyte1 << 8 +
592 // branchbyte2)
593 final static short iflt = 0x9b; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000594 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000595 // value ? if value is less than
596 // 0, branch to instruction at
597 // branchoffset (signed short
598 // constructed from unsigned
599 // bytes branchbyte1 << 8 +
600 // branchbyte2)
601 final static short ifge = 0x9c; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000602 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000603 // value ? if value is greater
604 // than or equal to 0, branch to
605 // instruction at branchoffset
606 // (signed short constructed
607 // from unsigned bytes
608 // branchbyte1 << 8 +
609 // branchbyte2)
610 final static short ifgt = 0x9d; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000611 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000612 // value ? if value is greater
613 // than 0, branch to instruction
614 // at branchoffset (signed short
615 // constructed from unsigned
616 // bytes branchbyte1 << 8 +
617 // branchbyte2)
618 final static short ifle = 0x9e; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000619 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000620 // value ? if value is less than
621 // or equal to 0, branch to
622 // instruction at branchoffset
623 // (signed short constructed
624 // from unsigned bytes
625 // branchbyte1 << 8 +
626 // branchbyte2)
627 final static short if_icmpeq = 0x9f; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000628 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000629 // value1, value2 ? if ints are
630 // equal, branch to instruction
631 // at branchoffset (signed short
632 // constructed from unsigned
633 // bytes branchbyte1 << 8 +
634 // branchbyte2)
635 final static short if_icmpne = 0xa0; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000636 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000637 // value1, value2 ? if ints are
638 // not equal, branch to
639 // instruction at branchoffset
640 // (signed short constructed
641 // from unsigned bytes
642 // branchbyte1 << 8 +
643 // branchbyte2)
644 final static short if_icmplt = 0xa1; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000645 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000646 // value1, value2 ? if value1 is
647 // less than value2, branch to
648 // instruction at branchoffset
649 // (signed short constructed
650 // from unsigned bytes
651 // branchbyte1 << 8 +
652 // branchbyte2)
653 final static short if_icmpge = 0xa2; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000654 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000655 // value1, value2 ? if value1 is
656 // greater than or equal to
657 // value2, branch to instruction
658 // at branchoffset (signed short
659 // constructed from unsigned
660 // bytes branchbyte1 << 8 +
661 // branchbyte2)
662 final static short if_icmpgt = 0xa3; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000663 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000664 // value1, value2 ? if value1 is
665 // greater than value2, branch
666 // to instruction at
667 // branchoffset (signed short
668 // constructed from unsigned
669 // bytes branchbyte1 << 8 +
670 // branchbyte2)
671 final static short if_icmple = 0xa4; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000672 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000673 // value1, value2 ? if value1 is
674 // less than or equal to value2,
675 // branch to instruction at
676 // branchoffset (signed short
677 // constructed from unsigned
678 // bytes branchbyte1 << 8 +
679 // branchbyte2)
680 final static short if_acmpeq = 0xa5; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000681 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000682 // value1, value2 ? if
683 // references are equal, branch
684 // to instruction at
685 // branchoffset (signed short
686 // constructed from unsigned
687 // bytes branchbyte1 << 8 +
688 // branchbyte2)
689 final static short if_acmpne = 0xa6; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000690 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000691 // value1, value2 ? if
692 // references are not equal,
693 // branch to instruction at
694 // branchoffset (signed short
695 // constructed from unsigned
696 // bytes branchbyte1 << 8 +
697 // branchbyte2)
698 final static short goto_ = 0xa7; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000699 // branchbyte2 [no
Stuart McCullochbb014372012-06-07 21:57:32 +0000700 // change] goes to another
701 // instruction at branchoffset
702 // (signed short constructed
703 // from unsigned bytes
704 // branchbyte1 << 8 +
705 // branchbyte2)
706 final static short jsr = 0xa8; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000707 // branchbyte2 ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000708 // address jump to subroutine at
709 // branchoffset (signed short
710 // constructed from unsigned
711 // bytes branchbyte1 << 8 +
712 // branchbyte2) and place the
713 // return address on the stack
714 final static short ret = 0xa9; // index [No change]
Stuart McCulloch2286f232012-06-15 13:27:53 +0000715 // continue
Stuart McCullochbb014372012-06-07 21:57:32 +0000716 // execution from address taken
717 // from a local variable #index
718 // (the asymmetry with jsr is
719 // intentional)
Stuart McCulloch2286f232012-06-15 13:27:53 +0000720 final static short tableswitch = 0xaa; // [0-3 bytes
721 // padding],
Stuart McCullochbb014372012-06-07 21:57:32 +0000722 // defaultbyte1, defaultbyte2,
723 // defaultbyte3, defaultbyte4,
724 // lowbyte1, lowbyte2, lowbyte3,
725 // lowbyte4, highbyte1,
726 // highbyte2, highbyte3,
727 // highbyte4, jump offsets...
728 // index ? continue execution
729 // from an address in the table
730 // at offset index
Stuart McCulloch2286f232012-06-15 13:27:53 +0000731 final static short lookupswitch = 0xab; // <0-3 bytes
732 // padding>,
Stuart McCullochbb014372012-06-07 21:57:32 +0000733 // defaultbyte1, defaultbyte2,
734 // defaultbyte3, defaultbyte4,
735 // npairs1, npairs2, npairs3,
736 // npairs4, match-offset
737 // pairs... key ? a target
738 // address is looked up from a
739 // table using a key and
740 // execution continues from the
741 // instruction at that address
742 final static short ireturn = 0xac; // value ? [empty]
Stuart McCulloch2286f232012-06-15 13:27:53 +0000743 // returns an
Stuart McCullochbb014372012-06-07 21:57:32 +0000744 // integer from a method
745 final static short lreturn = 0xad; // value ? [empty]
Stuart McCulloch2286f232012-06-15 13:27:53 +0000746 // returns a
Stuart McCullochbb014372012-06-07 21:57:32 +0000747 // long value
748 final static short freturn = 0xae; // value ? [empty]
Stuart McCulloch2286f232012-06-15 13:27:53 +0000749 // returns a
Stuart McCullochbb014372012-06-07 21:57:32 +0000750 // float
751 final static short dreturn = 0xaf; // value ? [empty]
Stuart McCulloch2286f232012-06-15 13:27:53 +0000752 // returns a
Stuart McCullochbb014372012-06-07 21:57:32 +0000753 // double from a method
Stuart McCulloch2286f232012-06-15 13:27:53 +0000754 final static short areturn = 0xb0; // objectref ?
755 // [empty]
756 // returns a
Stuart McCullochbb014372012-06-07 21:57:32 +0000757 // reference from a method
Stuart McCulloch2286f232012-06-15 13:27:53 +0000758 final static short return_ = 0xb1; // ? [empty] return
759 // void
760 // from
Stuart McCullochbb014372012-06-07 21:57:32 +0000761 // method
762 final static short getstatic = 0xb2; // index1, index2 ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000763 // value gets a
Stuart McCullochbb014372012-06-07 21:57:32 +0000764 // static field value of a
765 // class, where the field is
766 // identified by field reference
767 // in the constant pool index
768 // (index1 << 8 + index2)
769 final static short putstatic = 0xb3; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000770 // indexbyte2 value
Stuart McCullochbb014372012-06-07 21:57:32 +0000771 // ? set static field to value
772 // in a class, where the field
773 // is identified by a field
774 // reference index in constant
775 // pool (indexbyte1 << 8 +
776 // indexbyte2)
777 final static short getfield = 0xb4; // index1, index2
Stuart McCulloch2286f232012-06-15 13:27:53 +0000778 // objectref ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000779 // value gets a field value of
780 // an object objectref, where
781 // the field is identified by
782 // field reference in the
783 // constant pool index (index1
784 // << 8 + index2)
785 final static short putfield = 0xb5; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000786 // indexbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000787 // objectref, value ? set field
788 // to value in an object
789 // objectref, where the field is
790 // identified by a field
791 // reference index in constant
792 // pool (indexbyte1 << 8 +
793 // indexbyte2)
794 final static short invokevirtual = 0xb6; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000795 // indexbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000796 // objectref, [arg1, arg2, ...]
797 // ? invoke virtual method on
798 // object objectref, where the
799 // method is identified by
800 // method reference index in
801 // constant pool (indexbyte1 <<
802 // 8 + indexbyte2)
803 final static short invokespecial = 0xb7; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000804 // indexbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000805 // objectref, [arg1, arg2, ...]
806 // ? invoke instance method on
807 // object objectref, where the
808 // method is identified by
809 // method reference index in
810 // constant pool (indexbyte1 <<
811 // 8 + indexbyte2)
812 final static short invokestatic = 0xb8; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000813 // indexbyte2 [arg1,
Stuart McCullochbb014372012-06-07 21:57:32 +0000814 // arg2, ...] ? invoke a static
815 // method, where the method is
816 // identified by method
817 // reference index in constant
818 // pool (indexbyte1 << 8 +
819 // indexbyte2)
820 final static short invokeinterface = 0xb9; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000821 // indexbyte2,
Stuart McCullochbb014372012-06-07 21:57:32 +0000822 // count, 0 objectref, [arg1,
823 // arg2, ...] ? invokes an
824 // interface method on object
825 // objectref, where the
826 // interface method is
827 // identified by method
828 // reference index in constant
829 // pool (indexbyte1 << 8 +
830 // indexbyte2)
831 final static short xxxunusedxxx = 0xba; // this opcode is
Stuart McCulloch2286f232012-06-15 13:27:53 +0000832 // reserved "for
Stuart McCullochbb014372012-06-07 21:57:32 +0000833 // historical reasons"
834 final static short new_ = 0xbb; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000835 // indexbyte2 ?
Stuart McCullochbb014372012-06-07 21:57:32 +0000836 // objectref creates new object
837 // of type identified by class
838 // reference in constant pool
839 // index (indexbyte1 << 8 +
840 // indexbyte2)
841 final static short newarray = 0xbc; // atype count ?
Stuart McCulloch2286f232012-06-15 13:27:53 +0000842 // arrayref
Stuart McCullochbb014372012-06-07 21:57:32 +0000843 // creates new array with count
844 // elements of primitive type
845 // identified by atype
846 final static short anewarray = 0xbd; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000847 // indexbyte2 count
Stuart McCullochbb014372012-06-07 21:57:32 +0000848 // ? arrayref creates a new
849 // array of references of length
850 // count and component type
851 // identified by the class
852 // reference index (indexbyte1
853 // << 8 + indexbyte2) in the
854 // constant pool
855 final static short arraylength = 0xbe; // arrayref ? length
Stuart McCulloch2286f232012-06-15 13:27:53 +0000856 // gets the
Stuart McCullochbb014372012-06-07 21:57:32 +0000857 // length of an array
Stuart McCulloch2286f232012-06-15 13:27:53 +0000858 final static short athrow = 0xbf; // objectref ?
859 // [empty],
Stuart McCullochbb014372012-06-07 21:57:32 +0000860 // objectref throws an error or
861 // exception (notice that the
862 // rest of the stack is cleared,
863 // leaving only a reference to
864 // the Throwable)
865 final static short checkcast = 0xc0; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000866 // indexbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000867 // objectref ? objectref checks
868 // whether an objectref is of a
869 // certain type, the class
870 // reference of which is in the
871 // constant pool at index
872 // (indexbyte1 << 8 +
873 // indexbyte2)
874 final static short instanceof_ = 0xc1; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000875 // indexbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000876 // objectref ? result determines
877 // if an object objectref is of
878 // a given type, identified by
879 // class reference index in
880 // constant pool (indexbyte1 <<
881 // 8 + indexbyte2)
882 final static short monitorenter = 0xc2; // objectref ? enter
Stuart McCulloch2286f232012-06-15 13:27:53 +0000883 // monitor for
Stuart McCullochbb014372012-06-07 21:57:32 +0000884 // object ("grab the lock" -
885 // start of synchronized()
886 // section)
887 final static short monitorexit = 0xc3; // objectref ? exit
Stuart McCulloch2286f232012-06-15 13:27:53 +0000888 // monitor for
Stuart McCullochbb014372012-06-07 21:57:32 +0000889 // object ("release the lock" -
890 // end of synchronized()
891 // section)
Stuart McCulloch2286f232012-06-15 13:27:53 +0000892 final static short wide = 0xc4; // opcode,
893 // indexbyte1,
Stuart McCullochbb014372012-06-07 21:57:32 +0000894 // indexbyte2
895 final static short multianewarray = 0xc5; // indexbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000896 // indexbyte2,
Stuart McCullochbb014372012-06-07 21:57:32 +0000897 // dimensions count1,
898 // [count2,...] ? arrayref
899 // create a new array of
900 // dimensions dimensions with
901 // elements of type identified
902 // by class reference in
903 // constant pool index
904 // (indexbyte1 << 8 +
905 // indexbyte2); the sizes of
906 // each dimension is identified
907 // by count1, [count2, etc]
908 final static short ifnull = 0xc6; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000909 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000910 // value ? if value is null,
911 // branch to instruction at
912 // branchoffset (signed short
913 // constructed from unsigned
914 // bytes branchbyte1 << 8 +
915 // branchbyte2)
916 final static short ifnonnull = 0xc7; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000917 // branchbyte2
Stuart McCullochbb014372012-06-07 21:57:32 +0000918 // value ? if value is not null,
919 // branch to instruction at
920 // branchoffset (signed short
921 // constructed from unsigned
922 // bytes branchbyte1 << 8 +
923 // branchbyte2)
924 final static short goto_w = 0xc8; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000925 // branchbyte2,
Stuart McCullochbb014372012-06-07 21:57:32 +0000926 // branchbyte3, branchbyte4 [no
927 // change] goes to another
928 // instruction at branchoffset
929 // (signed int constructed from
930 // unsigned bytes branchbyte1 <<
931 // 24 + branchbyte2 << 16 +
932 // branchbyte3 << 8 +
933 // branchbyte4)
934 final static short jsr_w = 0xc9; // branchbyte1,
Stuart McCulloch2286f232012-06-15 13:27:53 +0000935 // branchbyte2,
Stuart McCullochbb014372012-06-07 21:57:32 +0000936 // branchbyte3, branchbyte4 ?
937 // address jump to subroutine at
938 // branchoffset (signed int
939 // constructed from unsigned
940 // bytes branchbyte1 << 24 +
941 // branchbyte2 << 16 +
942 // branchbyte3 << 8 +
943 // branchbyte4) and place the
944 // return address on the stack
945 final static short breakpoint = 0xca; // reserved for
Stuart McCulloch2286f232012-06-15 13:27:53 +0000946 // breakpoints in
Stuart McCullochbb014372012-06-07 21:57:32 +0000947 // Java debuggers; should not
948 // appear in any class file
949 final static short impdep1 = 0xfe; // reserved for
950 // implementation-dependent
951 // operations within debuggers;
952 // should not appear in any
953 // class file
954 final static short impdep2 = 0xff; // reserved for
955 // implementation-dependent
956 // operations within debuggers;
957 // should not appear in any
958 // class file
959
960 final static byte OFFSETS[] = new byte[256];
961
962 static {
963 OFFSETS[bipush] = 1; // byte ? value pushes a byte onto the
964 // stack as an integer value
965 OFFSETS[sipush] = 2; // byte1, byte2 ? value pushes a signed
966 // integer (byte1 << 8 + byte2) onto the
967 // stack
968 OFFSETS[ldc] = 1; // index ? value pushes a constant
969 // #index from a constant pool (String,
970 // int, float or class type) onto the
971 // stack
972 OFFSETS[ldc_w] = 2; // indexbyte1, indexbyte2 ? value pushes
973 // a constant #index from a constant
974 // pool (String, int, float or class
975 // type) onto the stack (wide index is
976 // constructed as indexbyte1 << 8 +
977 // indexbyte2)
978 OFFSETS[ldc2_w] = 2; // indexbyte1, indexbyte2 ? value pushes
979 // a constant #index from a constant
980 // pool (double or long) onto the stack
981 // (wide index is constructed as
982 // indexbyte1 << 8 + indexbyte2)
983 OFFSETS[iload] = 1; // index ? value loads an int value from
984 // a variable #index
985 OFFSETS[lload] = 1; // index ? value load a long value from
986 // a local variable #index
987 OFFSETS[fload] = 1; // index ? value loads a float value
988 // from a local variable #index
989 OFFSETS[dload] = 1; // index ? value loads a double value
990 // from a local variable #index
991 OFFSETS[aload] = 1; // index ? objectref loads a reference
992 // onto the stack from a local variable
993 // #index
994 OFFSETS[istore] = 1; // index value ? store int value into
995 // variable #index
996 OFFSETS[lstore] = 1; // index value ? store a long value in a
997 // local variable #index
998 OFFSETS[fstore] = 1; // index value ? stores a float value
999 // into a local variable #index
1000 OFFSETS[dstore] = 1; // index value ? stores a double value
1001 // into a local variable #index
1002 OFFSETS[iinc] = 2; // index, const [No change] increment
1003 // local variable #index by signed byte
1004 // const
1005 OFFSETS[ifeq] = 2; // branchbyte1, branchbyte2 value ? if
1006 // value is 0, branch to instruction at
1007 // branchoffset (signed short
1008 // constructed from unsigned bytes
1009 // branchbyte1 << 8 + branchbyte2)
1010 OFFSETS[astore] = 1; // index objectref ? stores a reference
1011 // into a local variable #index
1012 OFFSETS[ifne] = 2; // branchbyte1, branchbyte2 value ? if
1013 // value is not 0, branch to instruction
1014 // at branchoffset (signed short
1015 // constructed from unsigned bytes
1016 // branchbyte1 << 8 + branchbyte2)
1017 OFFSETS[iflt] = 2; // branchbyte1, branchbyte2 value ? if
1018 // value is less than 0, branch to
1019 // instruction at branchoffset (signed
1020 // short constructed from unsigned bytes
1021 // branchbyte1 << 8 + branchbyte2)
1022 OFFSETS[ifge] = 2; // branchbyte1, branchbyte2 value ? if
1023 // value is greater than or equal to 0,
1024 // branch to instruction at branchoffset
1025 // (signed short constructed from
1026 // unsigned bytes branchbyte1 << 8 +
1027 // branchbyte2)
1028 OFFSETS[ifgt] = 2; // branchbyte1, branchbyte2 value ? if
1029 // value is greater than 0, branch to
1030 // instruction at branchoffset (signed
1031 // short constructed from unsigned bytes
1032 // branchbyte1 << 8 + branchbyte2)
1033 OFFSETS[ifle] = 2; // branchbyte1, branchbyte2 value ? if
1034 // value is less than or equal to 0,
1035 // branch to instruction at branchoffset
1036 // (signed short constructed from
1037 // unsigned bytes branchbyte1 << 8 +
1038 // branchbyte2)
1039 OFFSETS[if_icmpeq] = 2; // branchbyte1, branchbyte2 value1,
1040 // value2 ? if ints are equal,
1041 // branch to instruction at
1042 // branchoffset (signed short
1043 // constructed from unsigned bytes
1044 // branchbyte1 << 8 + branchbyte2)
1045 OFFSETS[if_icmpne] = 2; // branchbyte1, branchbyte2 value1,
1046 // value2 ? if ints are not equal,
1047 // branch to instruction at
1048 // branchoffset (signed short
1049 // constructed from unsigned bytes
1050 // branchbyte1 << 8 + branchbyte2)
1051 OFFSETS[if_icmplt] = 2; // branchbyte1, branchbyte2 value1,
1052 // value2 ? if value1 is less than
1053 // value2, branch to instruction at
1054 // branchoffset (signed short
1055 // constructed from unsigned bytes
1056 // branchbyte1 << 8 + branchbyte2)
1057 OFFSETS[if_icmpge] = 2; // branchbyte1, branchbyte2 value1,
1058 // value2 ? if value1 is greater
1059 // than or equal to value2, branch
1060 // to instruction at branchoffset
1061 // (signed short constructed from
1062 // unsigned bytes branchbyte1 << 8 +
1063 // branchbyte2)
1064 OFFSETS[if_icmpgt] = 2; // branchbyte1, branchbyte2 value1,
1065 // value2 ? if value1 is greater
1066 // than value2, branch to
1067 // instruction at branchoffset
1068 // (signed short constructed from
1069 // unsigned bytes branchbyte1 << 8 +
1070 // branchbyte2)
1071 OFFSETS[if_icmple] = 2; // branchbyte1, branchbyte2 value1,
1072 // value2 ? if value1 is less than
1073 // or equal to value2, branch to
1074 // instruction at branchoffset
1075 // (signed short constructed from
1076 // unsigned bytes branchbyte1 << 8 +
1077 // branchbyte2)
1078 OFFSETS[if_acmpeq] = 2; // branchbyte1, branchbyte2 value1,
1079 // value2 ? if references are equal,
1080 // branch to instruction at
1081 // branchoffset (signed short
1082 // constructed from unsigned bytes
1083 // branchbyte1 << 8 + branchbyte2)
1084 OFFSETS[if_acmpne] = 2; // branchbyte1, branchbyte2 value1,
1085 // value2 ? if references are not
1086 // equal, branch to instruction at
1087 // branchoffset (signed short
1088 // constructed from unsigned bytes
1089 // branchbyte1 << 8 + branchbyte2)
1090 OFFSETS[goto_] = 2; // branchbyte1, branchbyte2 [no change]
1091 // goes to another instruction at
1092 // branchoffset (signed short
1093 // constructed from unsigned bytes
1094 // branchbyte1 << 8 + branchbyte2)
1095 OFFSETS[jsr] = 2; // branchbyte1, branchbyte2 ? address
1096 // jump to subroutine at branchoffset
1097 // (signed short constructed from
1098 // unsigned bytes branchbyte1 << 8 +
1099 // branchbyte2) and place the return
1100 // address on the stack
1101 OFFSETS[ret] = 1; // index [No change] continue execution
1102 // from address taken from a local
1103 // variable #index (the asymmetry with
1104 // jsr is intentional)
1105 OFFSETS[tableswitch] = -1; // [0-3 bytes padding],
1106 // defaultbyte1, defaultbyte2,
1107 // defaultbyte3, defaultbyte4,
1108 // lowbyte1, lowbyte2, lowbyte3,
1109 // lowbyte4, highbyte1,
1110 // highbyte2, highbyte3,
1111 // highbyte4, jump offsets...
1112 // index ? continue execution
1113 // from an address in the table
1114 // at offset index
1115 OFFSETS[lookupswitch] = -1; // <0-3 bytes padding>,
1116 // defaultbyte1, defaultbyte2,
1117 // defaultbyte3, defaultbyte4,
1118 // npairs1, npairs2, npairs3,
1119 // npairs4, match-offset
1120 // pairs... key ? a target
1121 // address is looked up from a
1122 // table using a key and
1123 // execution continues from the
1124 // instruction at that address
1125 OFFSETS[getstatic] = 2; // index1, index2 ? value gets a
1126 // static field value of a class,
1127 // where the field is identified by
1128 // field reference in the constant
1129 // pool index (index1 << 8 + index2)
1130 OFFSETS[putstatic] = 2; // indexbyte1, indexbyte2 value ?
1131 // set static field to value in a
1132 // class, where the field is
1133 // identified by a field reference
1134 // index in constant pool
1135 // (indexbyte1 << 8 + indexbyte2)
1136 OFFSETS[getfield] = 2; // index1, index2 objectref ? value
1137 // gets a field value of an object
1138 // objectref, where the field is
1139 // identified by field reference in
1140 // the constant pool index (index1
1141 // << 8 + index2)
1142 OFFSETS[putfield] = 2; // indexbyte1, indexbyte2 objectref,
1143 // value ? set field to value in an
1144 // object objectref, where the field
1145 // is identified by a field
1146 // reference index in constant pool
1147 // (indexbyte1 << 8 + indexbyte2)
1148 OFFSETS[invokevirtual] = 2; // indexbyte1, indexbyte2
1149 // objectref, [arg1, arg2, ...]
1150 // ? invoke virtual method on
1151 // object objectref, where the
1152 // method is identified by
1153 // method reference index in
1154 // constant pool (indexbyte1 <<
1155 // 8 + indexbyte2)
1156 OFFSETS[invokespecial] = 2; // indexbyte1, indexbyte2
1157 // objectref, [arg1, arg2, ...]
1158 // ? invoke instance method on
1159 // object objectref, where the
1160 // method is identified by
1161 // method reference index in
1162 // constant pool (indexbyte1 <<
1163 // 8 + indexbyte2)
1164 OFFSETS[invokestatic] = 2; // indexbyte1, indexbyte2 [arg1,
1165 // arg2, ...] ? invoke a static
1166 // method, where the method is
1167 // identified by method
1168 // reference index in constant
1169 // pool (indexbyte1 << 8 +
1170 // indexbyte2)
1171 OFFSETS[invokeinterface] = 2; // indexbyte1, indexbyte2,
1172 // count, 0 objectref,
1173 // [arg1, arg2, ...] ?
1174 // invokes an interface
1175 // method on object
1176 // objectref, where the
1177 // interface method is
1178 // identified by method
1179 // reference index in
1180 // constant pool (indexbyte1
1181 // << 8 + indexbyte2)
1182 OFFSETS[new_] = 2; // indexbyte1, indexbyte2 ? objectref
1183 // creates new object of type identified
1184 // by class reference in constant pool
1185 // index (indexbyte1 << 8 + indexbyte2)
1186 OFFSETS[newarray] = 1; // atype count ? arrayref creates
1187 // new array with count elements of
1188 // primitive type identified by
1189 // atype
1190 OFFSETS[anewarray] = 2; // indexbyte1, indexbyte2 count ?
1191 // arrayref creates a new array of
1192 // references of length count and
1193 // component type identified by the
1194 // class reference index (indexbyte1
1195 // << 8 + indexbyte2) in the
1196 // constant pool
1197 OFFSETS[checkcast] = 2; // indexbyte1, indexbyte2 objectref
1198 // ? objectref checks whether an
1199 // objectref is of a certain type,
1200 // the class reference of which is
1201 // in the constant pool at index
1202 // (indexbyte1 << 8 + indexbyte2)
1203 OFFSETS[instanceof_] = 2; // indexbyte1, indexbyte2 objectref
1204 // ? result determines if an object
1205 // objectref is of a given type,
1206 // identified by class reference
1207 // index in constant pool
1208 // (indexbyte1 << 8 + indexbyte2)
1209 OFFSETS[wide] = 3; // opcode, indexbyte1, indexbyte2
1210 OFFSETS[multianewarray] = 3; // indexbyte1, indexbyte2,
1211 // dimensions count1,
1212 // [count2,...] ? arrayref
1213 // create a new array of
1214 // dimensions dimensions with
1215 // elements of type identified
1216 // by class reference in
1217 // constant pool index
1218 // (indexbyte1 << 8 +
1219 // indexbyte2); the sizes of
1220 // each dimension is identified
1221 // by count1, [count2, etc]
1222 OFFSETS[ifnull] = 2; // branchbyte1, branchbyte2 value ? if
1223 // value is null, branch to instruction
1224 // at branchoffset (signed short
1225 // constructed from unsigned bytes
1226 // branchbyte1 << 8 + branchbyte2)
1227 OFFSETS[ifnonnull] = 2; // branchbyte1, branchbyte2 value ?
1228 // if value is not null, branch to
1229 // instruction at branchoffset
1230 // (signed short constructed from
1231 // unsigned bytes branchbyte1 << 8 +
1232 // branchbyte2)
1233 OFFSETS[goto_w] = 4; // branchbyte1, branchbyte2,
1234 // branchbyte3, branchbyte4 [no change]
1235 // goes to another instruction at
1236 // branchoffset (signed int constructed
1237 // from unsigned bytes branchbyte1 << 24
1238 // + branchbyte2 << 16 + branchbyte3 <<
1239 // 8 + branchbyte4)
1240 OFFSETS[jsr_w] = 4; // branchbyte1, branchbyte2,
1241 // branchbyte3, branchbyte4 ? address
1242 // jump to subroutine at branchoffset
1243 // (signed int constructed from unsigned
1244 // bytes branchbyte1 << 24 + branchbyte2
1245 // << 16 + branchbyte3 << 8 +
1246 // branchbyte4) and place the return
1247 // address on the stack
1248 }
1249
1250}