Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

16 роки тому
16 роки тому
6 роки тому
5 роки тому
16 роки тому
16 роки тому
16 роки тому
16 роки тому
12 роки тому
5 роки тому
12 роки тому
16 роки тому
6 роки тому
16 роки тому
12 роки тому
16 роки тому
14 роки тому
16 роки тому
16 роки тому
12 роки тому
16 роки тому
12 роки тому
16 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. package org.aspectj.apache.bcel;
  2. import org.aspectj.apache.bcel.generic.Type;
  3. /* ====================================================================
  4. * The Apache Software License, Version 1.1
  5. *
  6. * Copyright (c) 2001 The Apache Software Foundation. All rights
  7. * reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. *
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. *
  16. * 2. Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in
  18. * the documentation and/or other materials provided with the
  19. * distribution.
  20. *
  21. * 3. The end-user documentation included with the redistribution,
  22. * if any, must include the following acknowledgment:
  23. * "This product includes software developed by the
  24. * Apache Software Foundation (http://www.apache.org/)."
  25. * Alternately, this acknowledgment may appear in the software itself,
  26. * if and wherever such third-party acknowledgments normally appear.
  27. *
  28. * 4. The names "Apache" and "Apache Software Foundation" and
  29. * "Apache BCEL" must not be used to endorse or promote products
  30. * derived from this software without prior written permission. For
  31. * written permission, please contact apache@apache.org.
  32. *
  33. * 5. Products derived from this software may not be called "Apache",
  34. * "Apache BCEL", nor may "Apache" appear in their name, without
  35. * prior written permission of the Apache Software Foundation.
  36. *
  37. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  38. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  39. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  40. * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  41. * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  42. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  43. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  44. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  45. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  46. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  47. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  48. * SUCH DAMAGE.
  49. * ====================================================================
  50. *
  51. * This software consists of voluntary contributions made by many
  52. * individuals on behalf of the Apache Software Foundation. For more
  53. * information on the Apache Software Foundation, please see
  54. * <http://www.apache.org/>.
  55. */
  56. /**
  57. * Constants for the project, mostly defined in the JVM specification.
  58. *
  59. * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
  60. * @author Andy Clement
  61. */
  62. public interface Constants {
  63. // Major and minor version of the code
  64. public final static short MAJOR_1_1 = 45;
  65. public final static short MINOR_1_1 = 3;
  66. public final static short MAJOR_1_2 = 46;
  67. public final static short MINOR_1_2 = 0;
  68. public final static short MAJOR_1_3 = 47;
  69. public final static short MINOR_1_3 = 0;
  70. public final static short MAJOR_1_4 = 48;
  71. public final static short MINOR_1_4 = 0;
  72. public final static short MAJOR_1_5 = 49;
  73. public final static short MINOR_1_5 = 0;
  74. public final static short MAJOR_1_6 = 50;
  75. public final static short MINOR_1_6 = 0;
  76. public final static short MAJOR_1_7 = 51;
  77. public final static short MINOR_1_7 = 0;
  78. public final static short MAJOR_1_8 = 52;
  79. public final static short MINOR_1_8 = 0;
  80. public final static short MAJOR_1_9 = 53;
  81. public final static short MINOR_1_9 = 0;
  82. public final static short MAJOR_10 = 54;
  83. public final static short MINOR_10 = 0;
  84. public final static short MAJOR_11 = 55;
  85. public final static short MINOR_11 = 0;
  86. // Defaults
  87. public final static short MAJOR = MAJOR_1_1;
  88. public final static short MINOR = MINOR_1_1;
  89. /** Maximum value for an unsigned short */
  90. public final static int MAX_SHORT = 65535; // 2^16 - 1
  91. /** Maximum value for an unsigned byte */
  92. public final static int MAX_BYTE = 255; // 2^8 - 1
  93. /** Access flags for classes, fields and methods */
  94. public final static short ACC_PUBLIC = 0x0001;
  95. public final static short ACC_PRIVATE = 0x0002;
  96. public final static short ACC_PROTECTED = 0x0004;
  97. public final static short ACC_STATIC = 0x0008;
  98. public final static short ACC_FINAL = 0x0010;
  99. public final static short ACC_SYNCHRONIZED = 0x0020;
  100. public final static short ACC_VOLATILE = 0x0040;
  101. public final static short ACC_TRANSIENT = 0x0080;
  102. public final static short ACC_NATIVE = 0x0100;
  103. public final static short ACC_INTERFACE = 0x0200;
  104. public final static short ACC_ABSTRACT = 0x0400;
  105. public final static short ACC_STRICT = 0x0800;
  106. public final static short ACC_SYNTHETIC = 0x1000;
  107. public final static short ACC_ANNOTATION = 0x2000;
  108. public final static short ACC_ENUM = 0x4000;
  109. public final static int ACC_MODULE = 0x8000;
  110. public final static short ACC_BRIDGE = 0x0040;
  111. public final static short ACC_VARARGS = 0x0080;
  112. // Module related
  113. // Indicates that any module which depends on the current module,
  114. // implicitly declares a dependence on the module indicated by this entry.
  115. public final static int MODULE_ACC_TRANSITIVE = 0x0020;
  116. // Indicates that this dependence is mandatory in the static phase, i.e., at
  117. // compile time, but is optional in the dynamic phase, i.e., at run time.
  118. public final static int MODULE_ACC_STATIC_PHASE = 0x0040;
  119. // Indicates that this dependence was not explicitly or implicitly declared
  120. // in the source of the module declaration.
  121. public final static int MODULE_ACC_SYNTHETIC = 0x1000;
  122. // Indicates that this dependence was implicitly declared in the source of
  123. // the module declaration
  124. public final static int MODULE_ACC_MANDATED = 0x8000;
  125. // Applies to classes compiled by new compilers only
  126. public final static short ACC_SUPER = 0x0020;
  127. public final static short MAX_ACC_FLAG = ACC_STRICT;
  128. public final static String[] ACCESS_NAMES = { "public", "private", "protected", "static", "final", "synchronized", "volatile",
  129. "transient", "native", "interface", "abstract", "strictfp" };
  130. /** Tags in constant pool to denote type of constant */
  131. public final static byte CONSTANT_Utf8 = 1;
  132. public final static byte CONSTANT_Integer = 3;
  133. public final static byte CONSTANT_Float = 4;
  134. public final static byte CONSTANT_Long = 5;
  135. public final static byte CONSTANT_Double = 6;
  136. public final static byte CONSTANT_Class = 7;
  137. public final static byte CONSTANT_Fieldref = 9;
  138. public final static byte CONSTANT_String = 8;
  139. public final static byte CONSTANT_Methodref = 10;
  140. public final static byte CONSTANT_InterfaceMethodref = 11;
  141. public final static byte CONSTANT_NameAndType = 12;
  142. public final static byte CONSTANT_MethodHandle = 15;
  143. public final static byte CONSTANT_MethodType = 16;
  144. public final static byte CONSTANT_Dynamic = 17;
  145. public final static byte CONSTANT_InvokeDynamic = 18;
  146. public final static byte CONSTANT_Module = 19;
  147. public final static byte CONSTANT_Package = 20;
  148. public final static String[] CONSTANT_NAMES = { "", "CONSTANT_Utf8", "", "CONSTANT_Integer", "CONSTANT_Float", "CONSTANT_Long",
  149. "CONSTANT_Double", "CONSTANT_Class", "CONSTANT_String", "CONSTANT_Fieldref", "CONSTANT_Methodref",
  150. "CONSTANT_InterfaceMethodref", "CONSTANT_NameAndType","","","CONSTANT_MethodHandle","CONSTANT_MethodType","","CONSTANT_InvokeDynamic",
  151. // J9:
  152. "CONSTANT_Module", "CONSTANT_Package"};
  153. /**
  154. * The name of the static initializer, also called &quot;class initialization method&quot; or &quot;interface initialization
  155. * method&quot;. This is &quot;&lt;clinit&gt;&quot;.
  156. */
  157. public final static String STATIC_INITIALIZER_NAME = "<clinit>";
  158. /**
  159. * The name of every constructor method in a class, also called &quot;instance initialization method&quot;. This is
  160. * &quot;&lt;init&gt;&quot;.
  161. */
  162. public final static String CONSTRUCTOR_NAME = "<init>";
  163. /** The names of the interfaces implemented by arrays */
  164. public final static String[] INTERFACES_IMPLEMENTED_BY_ARRAYS = { "java.lang.Cloneable", "java.io.Serializable" };
  165. /**
  166. * Limitations of the Java Virtual Machine. See The Java Virtual Machine Specification, Second Edition, page 152, chapter 4.10.
  167. */
  168. public static final int MAX_CP_ENTRIES = 65535;
  169. public static final int MAX_CODE_SIZE = 65536; // bytes
  170. /**
  171. * Java VM opcodes.
  172. */
  173. public static final short NOP = 0;
  174. public static final short ACONST_NULL = 1;
  175. public static final short ICONST_M1 = 2;
  176. public static final short ICONST_0 = 3;
  177. public static final short ICONST_1 = 4;
  178. public static final short ICONST_2 = 5;
  179. public static final short ICONST_3 = 6;
  180. public static final short ICONST_4 = 7;
  181. public static final short ICONST_5 = 8;
  182. public static final short LCONST_0 = 9;
  183. public static final short LCONST_1 = 10;
  184. public static final short FCONST_0 = 11;
  185. public static final short FCONST_1 = 12;
  186. public static final short FCONST_2 = 13;
  187. public static final short DCONST_0 = 14;
  188. public static final short DCONST_1 = 15;
  189. public static final short BIPUSH = 16;
  190. public static final short SIPUSH = 17;
  191. public static final short LDC = 18;
  192. public static final short LDC_W = 19;
  193. public static final short LDC2_W = 20;
  194. public static final short ILOAD = 21;
  195. public static final short LLOAD = 22;
  196. public static final short FLOAD = 23;
  197. public static final short DLOAD = 24;
  198. public static final short ALOAD = 25;
  199. public static final short ILOAD_0 = 26;
  200. public static final short ILOAD_1 = 27;
  201. public static final short ILOAD_2 = 28;
  202. public static final short ILOAD_3 = 29;
  203. public static final short LLOAD_0 = 30;
  204. public static final short LLOAD_1 = 31;
  205. public static final short LLOAD_2 = 32;
  206. public static final short LLOAD_3 = 33;
  207. public static final short FLOAD_0 = 34;
  208. public static final short FLOAD_1 = 35;
  209. public static final short FLOAD_2 = 36;
  210. public static final short FLOAD_3 = 37;
  211. public static final short DLOAD_0 = 38;
  212. public static final short DLOAD_1 = 39;
  213. public static final short DLOAD_2 = 40;
  214. public static final short DLOAD_3 = 41;
  215. public static final short ALOAD_0 = 42;
  216. public static final short ALOAD_1 = 43;
  217. public static final short ALOAD_2 = 44;
  218. public static final short ALOAD_3 = 45;
  219. public static final short IALOAD = 46;
  220. public static final short LALOAD = 47;
  221. public static final short FALOAD = 48;
  222. public static final short DALOAD = 49;
  223. public static final short AALOAD = 50;
  224. public static final short BALOAD = 51;
  225. public static final short CALOAD = 52;
  226. public static final short SALOAD = 53;
  227. public static final short ISTORE = 54;
  228. public static final short LSTORE = 55;
  229. public static final short FSTORE = 56;
  230. public static final short DSTORE = 57;
  231. public static final short ASTORE = 58;
  232. public static final short ISTORE_0 = 59;
  233. public static final short ISTORE_1 = 60;
  234. public static final short ISTORE_2 = 61;
  235. public static final short ISTORE_3 = 62;
  236. public static final short LSTORE_0 = 63;
  237. public static final short LSTORE_1 = 64;
  238. public static final short LSTORE_2 = 65;
  239. public static final short LSTORE_3 = 66;
  240. public static final short FSTORE_0 = 67;
  241. public static final short FSTORE_1 = 68;
  242. public static final short FSTORE_2 = 69;
  243. public static final short FSTORE_3 = 70;
  244. public static final short DSTORE_0 = 71;
  245. public static final short DSTORE_1 = 72;
  246. public static final short DSTORE_2 = 73;
  247. public static final short DSTORE_3 = 74;
  248. public static final short ASTORE_0 = 75;
  249. public static final short ASTORE_1 = 76;
  250. public static final short ASTORE_2 = 77;
  251. public static final short ASTORE_3 = 78;
  252. public static final short IASTORE = 79;
  253. public static final short LASTORE = 80;
  254. public static final short FASTORE = 81;
  255. public static final short DASTORE = 82;
  256. public static final short AASTORE = 83;
  257. public static final short BASTORE = 84;
  258. public static final short CASTORE = 85;
  259. public static final short SASTORE = 86;
  260. public static final short POP = 87;
  261. public static final short POP2 = 88;
  262. public static final short DUP = 89;
  263. public static final short DUP_X1 = 90;
  264. public static final short DUP_X2 = 91;
  265. public static final short DUP2 = 92;
  266. public static final short DUP2_X1 = 93;
  267. public static final short DUP2_X2 = 94;
  268. public static final short SWAP = 95;
  269. public static final short IADD = 96;
  270. public static final short LADD = 97;
  271. public static final short FADD = 98;
  272. public static final short DADD = 99;
  273. public static final short ISUB = 100;
  274. public static final short LSUB = 101;
  275. public static final short FSUB = 102;
  276. public static final short DSUB = 103;
  277. public static final short IMUL = 104;
  278. public static final short LMUL = 105;
  279. public static final short FMUL = 106;
  280. public static final short DMUL = 107;
  281. public static final short IDIV = 108;
  282. public static final short LDIV = 109;
  283. public static final short FDIV = 110;
  284. public static final short DDIV = 111;
  285. public static final short IREM = 112;
  286. public static final short LREM = 113;
  287. public static final short FREM = 114;
  288. public static final short DREM = 115;
  289. public static final short INEG = 116;
  290. public static final short LNEG = 117;
  291. public static final short FNEG = 118;
  292. public static final short DNEG = 119;
  293. public static final short ISHL = 120;
  294. public static final short LSHL = 121;
  295. public static final short ISHR = 122;
  296. public static final short LSHR = 123;
  297. public static final short IUSHR = 124;
  298. public static final short LUSHR = 125;
  299. public static final short IAND = 126;
  300. public static final short LAND = 127;
  301. public static final short IOR = 128;
  302. public static final short LOR = 129;
  303. public static final short IXOR = 130;
  304. public static final short LXOR = 131;
  305. public static final short IINC = 132;
  306. public static final short I2L = 133;
  307. public static final short I2F = 134;
  308. public static final short I2D = 135;
  309. public static final short L2I = 136;
  310. public static final short L2F = 137;
  311. public static final short L2D = 138;
  312. public static final short F2I = 139;
  313. public static final short F2L = 140;
  314. public static final short F2D = 141;
  315. public static final short D2I = 142;
  316. public static final short D2L = 143;
  317. public static final short D2F = 144;
  318. public static final short I2B = 145;
  319. public static final short INT2BYTE = 145; // Old notion
  320. public static final short I2C = 146;
  321. public static final short INT2CHAR = 146; // Old notion
  322. public static final short I2S = 147;
  323. public static final short INT2SHORT = 147; // Old notion
  324. public static final short LCMP = 148;
  325. public static final short FCMPL = 149;
  326. public static final short FCMPG = 150;
  327. public static final short DCMPL = 151;
  328. public static final short DCMPG = 152;
  329. public static final short IFEQ = 153;
  330. public static final short IFNE = 154;
  331. public static final short IFLT = 155;
  332. public static final short IFGE = 156;
  333. public static final short IFGT = 157;
  334. public static final short IFLE = 158;
  335. public static final short IF_ICMPEQ = 159;
  336. public static final short IF_ICMPNE = 160;
  337. public static final short IF_ICMPLT = 161;
  338. public static final short IF_ICMPGE = 162;
  339. public static final short IF_ICMPGT = 163;
  340. public static final short IF_ICMPLE = 164;
  341. public static final short IF_ACMPEQ = 165;
  342. public static final short IF_ACMPNE = 166;
  343. public static final short GOTO = 167;
  344. public static final short JSR = 168;
  345. public static final short RET = 169;
  346. public static final short TABLESWITCH = 170;
  347. public static final short LOOKUPSWITCH = 171;
  348. public static final short IRETURN = 172;
  349. public static final short LRETURN = 173;
  350. public static final short FRETURN = 174;
  351. public static final short DRETURN = 175;
  352. public static final short ARETURN = 176;
  353. public static final short RETURN = 177;
  354. public static final short GETSTATIC = 178;
  355. public static final short PUTSTATIC = 179;
  356. public static final short GETFIELD = 180;
  357. public static final short PUTFIELD = 181;
  358. public static final short INVOKEVIRTUAL = 182;
  359. public static final short INVOKESPECIAL = 183;
  360. public static final short INVOKENONVIRTUAL = 183; // Old name in JDK 1.0
  361. public static final short INVOKESTATIC = 184;
  362. public static final short INVOKEINTERFACE = 185;
  363. public static final short INVOKEDYNAMIC = 186;
  364. public static final short NEW = 187;
  365. public static final short NEWARRAY = 188;
  366. public static final short ANEWARRAY = 189;
  367. public static final short ARRAYLENGTH = 190;
  368. public static final short ATHROW = 191;
  369. public static final short CHECKCAST = 192;
  370. public static final short INSTANCEOF = 193;
  371. public static final short MONITORENTER = 194;
  372. public static final short MONITOREXIT = 195;
  373. public static final short WIDE = 196;
  374. public static final short MULTIANEWARRAY = 197;
  375. public static final short IFNULL = 198;
  376. public static final short IFNONNULL = 199;
  377. public static final short GOTO_W = 200;
  378. public static final short JSR_W = 201;
  379. /**
  380. * Non-legal opcodes, may be used by JVM internally.
  381. */
  382. public static final short BREAKPOINT = 202;
  383. public static final short LDC_QUICK = 203;
  384. public static final short LDC_W_QUICK = 204;
  385. public static final short LDC2_W_QUICK = 205;
  386. public static final short GETFIELD_QUICK = 206;
  387. public static final short PUTFIELD_QUICK = 207;
  388. public static final short GETFIELD2_QUICK = 208;
  389. public static final short PUTFIELD2_QUICK = 209;
  390. public static final short GETSTATIC_QUICK = 210;
  391. public static final short PUTSTATIC_QUICK = 211;
  392. public static final short GETSTATIC2_QUICK = 212;
  393. public static final short PUTSTATIC2_QUICK = 213;
  394. public static final short INVOKEVIRTUAL_QUICK = 214;
  395. public static final short INVOKENONVIRTUAL_QUICK = 215;
  396. public static final short INVOKESUPER_QUICK = 216;
  397. public static final short INVOKESTATIC_QUICK = 217;
  398. public static final short INVOKEINTERFACE_QUICK = 218;
  399. public static final short INVOKEVIRTUALOBJECT_QUICK = 219;
  400. public static final short NEW_QUICK = 221;
  401. public static final short ANEWARRAY_QUICK = 222;
  402. public static final short MULTIANEWARRAY_QUICK = 223;
  403. public static final short CHECKCAST_QUICK = 224;
  404. public static final short INSTANCEOF_QUICK = 225;
  405. public static final short INVOKEVIRTUAL_QUICK_W = 226;
  406. public static final short GETFIELD_QUICK_W = 227;
  407. public static final short PUTFIELD_QUICK_W = 228;
  408. public static final short IMPDEP1 = 254;
  409. public static final short IMPDEP2 = 255;
  410. /**
  411. * For internal purposes only.
  412. */
  413. public static final short PUSH = 4711;
  414. public static final short SWITCH = 4712;
  415. /**
  416. * Illegal codes
  417. */
  418. public static final short UNDEFINED = '/' - '0'; // -1;
  419. public static final short UNPREDICTABLE = '.' - '0';// -2;
  420. public static final short RESERVED = -3;
  421. public static final String ILLEGAL_OPCODE = "<illegal opcode>";
  422. public static final String ILLEGAL_TYPE = "<illegal type>";
  423. public static final byte T_BOOLEAN = 4;
  424. public static final byte T_CHAR = 5;
  425. public static final byte T_FLOAT = 6;
  426. public static final byte T_DOUBLE = 7;
  427. public static final byte T_BYTE = 8;
  428. public static final byte T_SHORT = 9;
  429. public static final byte T_INT = 10;
  430. public static final byte T_LONG = 11;
  431. public static final byte T_VOID = 12; // Non-standard
  432. public static final byte T_ARRAY = 13;
  433. public static final byte T_OBJECT = 14;
  434. public static final byte T_REFERENCE = 14; // Deprecated
  435. public static final byte T_UNKNOWN = 15;
  436. public static final byte T_ADDRESS = 16;
  437. /**
  438. * The primitive type names corresponding to the T_XX constants, e.g., TYPE_NAMES[T_INT] = "int"
  439. */
  440. public static final String[] TYPE_NAMES = { ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "boolean", "char", "float",
  441. "double", "byte", "short", "int", "long", "void", "array", "object", "unknown" // Non-standard
  442. };
  443. /**
  444. * The primitive class names corresponding to the T_XX constants, e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
  445. */
  446. public static final String[] CLASS_TYPE_NAMES = { ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "java.lang.Boolean",
  447. "java.lang.Character", "java.lang.Float", "java.lang.Double", "java.lang.Byte", "java.lang.Short", "java.lang.Integer",
  448. "java.lang.Long", "java.lang.Void", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE };
  449. /**
  450. * The signature characters corresponding to primitive types, e.g., SHORT_TYPE_NAMES[T_INT] = "I"
  451. */
  452. public static final String[] SHORT_TYPE_NAMES = { ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "Z", "C", "F", "D",
  453. "B", "S", "I", "J", "V", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE };
  454. public static int PUSH_INST = 0x0001;
  455. public static int CONSTANT_INST = 0x0002;
  456. public static long LOADCLASS_INST = 0x0004;
  457. public static int CP_INST = 0x0008;
  458. public static int INDEXED = 0x0010;
  459. public static int LOAD_INST = 0x0020; // load instruction
  460. public static int LV_INST = 0x0040; // local variable instruction
  461. public static int POP_INST = 0x0080;
  462. public static int STORE_INST = 0x0100;
  463. public static long STACK_INST = 0x0200;
  464. public static long BRANCH_INSTRUCTION = 0x0400;
  465. public static long TARGETER_INSTRUCTION = 0x0800;
  466. public static long NEGATABLE = 0x1000;
  467. public static long IF_INST = 0x2000;
  468. public static long JSR_INSTRUCTION = 0x4000;
  469. public static long RET_INST = 0x8000;
  470. public static long EXCEPTION_THROWER = 0x10000;
  471. public static final byte[] iLen = new byte[256];
  472. public static final byte UNDEFINED_LENGTH = 'X' - '0';
  473. public static final byte VARIABLE_LENGTH = 'V' - '0';
  474. public static final byte[] stackEntriesProduced = new byte[256];
  475. public static final Type[] types = new Type[256];
  476. public static final long[] instFlags = new long[256];
  477. public static final Class<Throwable>[][] instExcs = new Class[256][];
  478. static final Object _unused = ConstantsInitializer.initialize();
  479. /**
  480. * How the byte code operands are to be interpreted.
  481. */
  482. public static final short[][] TYPE_OF_OPERANDS = { {}/* nop */, {}/* aconst_null */, {}/* iconst_m1 */, {}/* iconst_0 */,
  483. {}/* iconst_1 */, {}/* iconst_2 */, {}/* iconst_3 */, {}/* iconst_4 */, {}/* iconst_5 */, {}/* lconst_0 */, {}/* lconst_1 */,
  484. {}/* fconst_0 */, {}/* fconst_1 */, {}/* fconst_2 */, {}/* dconst_0 */, {}/* dconst_1 */, { T_BYTE }/* bipush */,
  485. { T_SHORT }/* sipush */, { T_BYTE }/* ldc */, { T_SHORT }/* ldc_w */, { T_SHORT }/* ldc2_w */, { T_BYTE }/* iload */,
  486. { T_BYTE }/* lload */, { T_BYTE }/* fload */, { T_BYTE }/* dload */, { T_BYTE }/* aload */, {}/* iload_0 */,
  487. {}/* iload_1 */, {}/* iload_2 */, {}/* iload_3 */, {}/* lload_0 */, {}/* lload_1 */, {}/* lload_2 */, {}/* lload_3 */,
  488. {}/* fload_0 */, {}/* fload_1 */, {}/* fload_2 */, {}/* fload_3 */, {}/* dload_0 */, {}/* dload_1 */, {}/* dload_2 */,
  489. {}/* dload_3 */, {}/* aload_0 */, {}/* aload_1 */, {}/* aload_2 */, {}/* aload_3 */, {}/* iaload */, {}/* laload */,
  490. {}/* faload */, {}/* daload */, {}/* aaload */, {}/* baload */, {}/* caload */, {}/* saload */, { T_BYTE }/* istore */,
  491. { T_BYTE }/* lstore */, { T_BYTE }/* fstore */, { T_BYTE }/* dstore */, { T_BYTE }/* astore */, {}/* istore_0 */,
  492. {}/* istore_1 */, {}/* istore_2 */, {}/* istore_3 */, {}/* lstore_0 */, {}/* lstore_1 */, {}/* lstore_2 */, {}/* lstore_3 */,
  493. {}/* fstore_0 */, {}/* fstore_1 */, {}/* fstore_2 */, {}/* fstore_3 */, {}/* dstore_0 */, {}/* dstore_1 */, {}/* dstore_2 */,
  494. {}/* dstore_3 */, {}/* astore_0 */, {}/* astore_1 */, {}/* astore_2 */, {}/* astore_3 */, {}/* iastore */, {}/* lastore */,
  495. {}/* fastore */, {}/* dastore */, {}/* aastore */, {}/* bastore */, {}/* castore */, {}/* sastore */, {}/* pop */, {}/* pop2 */,
  496. {}/* dup */, {}/* dup_x1 */, {}/* dup_x2 */, {}/* dup2 */, {}/* dup2_x1 */, {}/* dup2_x2 */, {}/* swap */, {}/* iadd */,
  497. {}/* ladd */, {}/* fadd */, {}/* dadd */, {}/* isub */, {}/* lsub */, {}/* fsub */, {}/* dsub */, {}/* imul */, {}/* lmul */, {}/* fmul */,
  498. {}/* dmul */, {}/* idiv */, {}/* ldiv */, {}/* fdiv */, {}/* ddiv */, {}/* irem */, {}/* lrem */, {}/* frem */, {}/* drem */, {}/* ineg */,
  499. {}/* lneg */, {}/* fneg */, {}/* dneg */, {}/* ishl */, {}/* lshl */, {}/* ishr */, {}/* lshr */, {}/* iushr */, {}/* lushr */,
  500. {}/* iand */, {}/* land */, {}/* ior */, {}/* lor */, {}/* ixor */, {}/* lxor */, { T_BYTE, T_BYTE }/* iinc */, {}/* i2l */,
  501. {}/* i2f */, {}/* i2d */, {}/* l2i */, {}/* l2f */, {}/* l2d */, {}/* f2i */, {}/* f2l */, {}/* f2d */, {}/* d2i */, {}/* d2l */,
  502. {}/* d2f */, {}/* i2b */, {}/* i2c */, {}/* i2s */, {}/* lcmp */, {}/* fcmpl */, {}/* fcmpg */, {}/* dcmpl */,
  503. {}/* dcmpg */, { T_SHORT }/* ifeq */, { T_SHORT }/* ifne */, { T_SHORT }/* iflt */, { T_SHORT }/* ifge */,
  504. { T_SHORT }/* ifgt */, { T_SHORT }/* ifle */, { T_SHORT }/* if_icmpeq */, { T_SHORT }/* if_icmpne */,
  505. { T_SHORT }/* if_icmplt */, { T_SHORT }/* if_icmpge */, { T_SHORT }/* if_icmpgt */, { T_SHORT }/* if_icmple */,
  506. { T_SHORT }/* if_acmpeq */, { T_SHORT }/* if_acmpne */, { T_SHORT }/* goto */, { T_SHORT }/* jsr */,
  507. { T_BYTE }/* ret */, {}/* tableswitch */, {}/* lookupswitch */, {}/* ireturn */, {}/* lreturn */, {}/* freturn */,
  508. {}/* dreturn */, {}/* areturn */, {}/* return */, { T_SHORT }/* getstatic */, { T_SHORT }/* putstatic */,
  509. { T_SHORT }/* getfield */, { T_SHORT }/* putfield */, { T_SHORT }/* invokevirtual */,
  510. { T_SHORT }/* invokespecial */, { T_SHORT }/* invokestatic */, { T_SHORT, T_BYTE, T_BYTE }/* invokeinterface */, {},
  511. { T_SHORT }/* new */, { T_BYTE }/* newarray */, { T_SHORT }/* anewarray */, {}/* arraylength */, {}/* athrow */,
  512. { T_SHORT }/* checkcast */, { T_SHORT }/* instanceof */, {}/* monitorenter */, {}/* monitorexit */, { T_BYTE }/* wide */,
  513. { T_SHORT, T_BYTE }/* multianewarray */, { T_SHORT }/* ifnull */, { T_SHORT }/* ifnonnull */, { T_INT }/* goto_w */,
  514. { T_INT }/* jsr_w */, {}/* breakpoint */, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
  515. {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
  516. {}, {}, {}/* impdep1 */, {} /* impdep2 */
  517. };
  518. /**
  519. * Names of opcodes.
  520. */
  521. public static final String[] OPCODE_NAMES = { "nop", "aconst_null", "iconst_m1", "iconst_0", "iconst_1", "iconst_2",
  522. "iconst_3", "iconst_4", "iconst_5", "lconst_0", "lconst_1", "fconst_0", "fconst_1", "fconst_2", "dconst_0", "dconst_1",
  523. "bipush", "sipush", "ldc", "ldc_w", "ldc2_w", "iload", "lload", "fload", "dload", "aload", "iload_0", "iload_1",
  524. "iload_2", "iload_3", "lload_0", "lload_1", "lload_2", "lload_3", "fload_0", "fload_1", "fload_2", "fload_3",
  525. "dload_0", "dload_1", "dload_2", "dload_3", "aload_0", "aload_1", "aload_2", "aload_3", "iaload", "laload", "faload",
  526. "daload", "aaload", "baload", "caload", "saload", "istore", "lstore", "fstore", "dstore", "astore", "istore_0",
  527. "istore_1", "istore_2", "istore_3", "lstore_0", "lstore_1", "lstore_2", "lstore_3", "fstore_0", "fstore_1", "fstore_2",
  528. "fstore_3", "dstore_0", "dstore_1", "dstore_2", "dstore_3", "astore_0", "astore_1", "astore_2", "astore_3", "iastore",
  529. "lastore", "fastore", "dastore", "aastore", "bastore", "castore", "sastore", "pop", "pop2", "dup", "dup_x1", "dup_x2",
  530. "dup2", "dup2_x1", "dup2_x2", "swap", "iadd", "ladd", "fadd", "dadd", "isub", "lsub", "fsub", "dsub", "imul", "lmul",
  531. "fmul", "dmul", "idiv", "ldiv", "fdiv", "ddiv", "irem", "lrem", "frem", "drem", "ineg", "lneg", "fneg", "dneg", "ishl",
  532. "lshl", "ishr", "lshr", "iushr", "lushr", "iand", "land", "ior", "lor", "ixor", "lxor", "iinc", "i2l", "i2f", "i2d",
  533. "l2i", "l2f", "l2d", "f2i", "f2l", "f2d", "d2i", "d2l", "d2f", "i2b", "i2c", "i2s", "lcmp", "fcmpl", "fcmpg", "dcmpl",
  534. "dcmpg", "ifeq", "ifne", "iflt", "ifge", "ifgt", "ifle", "if_icmpeq", "if_icmpne", "if_icmplt", "if_icmpge",
  535. "if_icmpgt", "if_icmple", "if_acmpeq", "if_acmpne", "goto", "jsr", "ret", "tableswitch", "lookupswitch", "ireturn",
  536. "lreturn", "freturn", "dreturn", "areturn", "return", "getstatic", "putstatic", "getfield", "putfield",
  537. "invokevirtual", "invokespecial", "invokestatic", "invokeinterface", "invokedynamic", "new", "newarray", "anewarray",
  538. "arraylength", "athrow", "checkcast", "instanceof", "monitorenter", "monitorexit", "wide", "multianewarray", "ifnull",
  539. "ifnonnull", "goto_w", "jsr_w", "breakpoint", ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
  540. ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
  541. ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
  542. ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
  543. ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
  544. ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
  545. ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
  546. ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, "impdep1", "impdep2" };
  547. /**
  548. * Number of words consumed on operand stack by instructions.
  549. */
  550. public static final int[] CONSUME_STACK = { 0/* nop */, 0/* aconst_null */, 0/* iconst_m1 */, 0/* iconst_0 */, 0/* iconst_1 */,
  551. 0/* iconst_2 */, 0/* iconst_3 */, 0/* iconst_4 */, 0/* iconst_5 */, 0/* lconst_0 */, 0/* lconst_1 */, 0/* fconst_0 */,
  552. 0/* fconst_1 */, 0/* fconst_2 */, 0/* dconst_0 */, 0/* dconst_1 */, 0/* bipush */, 0/* sipush */, 0/* ldc */,
  553. 0/* ldc_w */, 0/* ldc2_w */, 0/* iload */, 0/* lload */, 0/* fload */, 0/* dload */, 0/* aload */, 0/* iload_0 */, 0/* iload_1 */,
  554. 0/* iload_2 */, 0/* iload_3 */, 0/* lload_0 */, 0/* lload_1 */, 0/* lload_2 */, 0/* lload_3 */, 0/* fload_0 */,
  555. 0/* fload_1 */, 0/* fload_2 */, 0/* fload_3 */, 0/* dload_0 */, 0/* dload_1 */, 0/* dload_2 */, 0/* dload_3 */,
  556. 0/* aload_0 */, 0/* aload_1 */, 0/* aload_2 */, 0/* aload_3 */, 2/* iaload */, 2/* laload */, 2/* faload */,
  557. 2/* daload */, 2/* aaload */, 2/* baload */, 2/* caload */, 2/* saload */, 1/* istore */, 2/* lstore */,
  558. 1/* fstore */, 2/* dstore */, 1/* astore */, 1/* istore_0 */, 1/* istore_1 */, 1/* istore_2 */, 1/* istore_3 */,
  559. 2/* lstore_0 */, 2/* lstore_1 */, 2/* lstore_2 */, 2/* lstore_3 */, 1/* fstore_0 */, 1/* fstore_1 */, 1/* fstore_2 */,
  560. 1/* fstore_3 */, 2/* dstore_0 */, 2/* dstore_1 */, 2/* dstore_2 */, 2/* dstore_3 */, 1/* astore_0 */, 1/* astore_1 */,
  561. 1/* astore_2 */, 1/* astore_3 */, 3/* iastore */, 4/* lastore */, 3/* fastore */, 4/* dastore */, 3/* aastore */,
  562. 3/* bastore */, 3/* castore */, 3/* sastore */, 1/* pop */, 2/* pop2 */, 1/* dup */, 2/* dup_x1 */, 3/* dup_x2 */,
  563. 2/* dup2 */, 3/* dup2_x1 */, 4/* dup2_x2 */, 2/* swap */, 2/* iadd */, 4/* ladd */, 2/* fadd */, 4/* dadd */, 2/* isub */,
  564. 4/* lsub */, 2/* fsub */, 4/* dsub */, 2/* imul */, 4/* lmul */, 2/* fmul */, 4/* dmul */, 2/* idiv */, 4/* ldiv */, 2/* fdiv */,
  565. 4/* ddiv */, 2/* irem */, 4/* lrem */, 2/* frem */, 4/* drem */, 1/* ineg */, 2/* lneg */, 1/* fneg */, 2/* dneg */, 2/* ishl */,
  566. 3/* lshl */, 2/* ishr */, 3/* lshr */, 2/* iushr */, 3/* lushr */, 2/* iand */, 4/* land */, 2/* ior */, 4/* lor */, 2/* ixor */,
  567. 4/* lxor */, 0/* iinc */, 1/* i2l */, 1/* i2f */, 1/* i2d */, 2/* l2i */, 2/* l2f */, 2/* l2d */, 1/* f2i */, 1/* f2l */,
  568. 1/* f2d */, 2/* d2i */, 2/* d2l */, 2/* d2f */, 1/* i2b */, 1/* i2c */, 1/* i2s */, 4/* lcmp */, 2/* fcmpl */,
  569. 2/* fcmpg */, 4/* dcmpl */, 4/* dcmpg */, 1/* ifeq */, 1/* ifne */, 1/* iflt */, 1/* ifge */, 1/* ifgt */, 1/* ifle */,
  570. 2/* if_icmpeq */, 2/* if_icmpne */, 2/* if_icmplt */, 2 /* if_icmpge */, 2/* if_icmpgt */, 2/* if_icmple */, 2/* if_acmpeq */,
  571. 2/* if_acmpne */, 0/* goto */, 0/* jsr */, 0/* ret */, 1/* tableswitch */, 1/* lookupswitch */, 1/* ireturn */,
  572. 2/* lreturn */, 1/* freturn */, 2/* dreturn */, 1/* areturn */, 0/* return */, 0/* getstatic */,
  573. UNPREDICTABLE/* putstatic */, 1/* getfield */, UNPREDICTABLE/* putfield */, UNPREDICTABLE/* invokevirtual */,
  574. UNPREDICTABLE/* invokespecial */, UNPREDICTABLE/* invokestatic */, UNPREDICTABLE/* invokeinterface */, UNDEFINED,
  575. 0/* new */, 1/* newarray */, 1/* anewarray */, 1/* arraylength */, 1/* athrow */, 1/* checkcast */, 1/* instanceof */,
  576. 1/* monitorenter */, 1/* monitorexit */, 0/* wide */, UNPREDICTABLE/* multianewarray */, 1/* ifnull */,
  577. 1/* ifnonnull */, 0/* goto_w */, 0/* jsr_w */, 0/* breakpoint */, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
  578. UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
  579. UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
  580. UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
  581. UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
  582. UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNPREDICTABLE/* impdep1 */, UNPREDICTABLE /* impdep2 */
  583. };
  584. // Attributes and their corresponding names.
  585. public static final byte ATTR_UNKNOWN = -1;
  586. public static final byte ATTR_SOURCE_FILE = 0;
  587. public static final byte ATTR_CONSTANT_VALUE = 1;
  588. public static final byte ATTR_CODE = 2;
  589. public static final byte ATTR_EXCEPTIONS = 3;
  590. public static final byte ATTR_LINE_NUMBER_TABLE = 4;
  591. public static final byte ATTR_LOCAL_VARIABLE_TABLE = 5;
  592. public static final byte ATTR_INNER_CLASSES = 6;
  593. public static final byte ATTR_SYNTHETIC = 7;
  594. public static final byte ATTR_DEPRECATED = 8;
  595. public static final byte ATTR_PMG = 9;
  596. public static final byte ATTR_SIGNATURE = 10;
  597. public static final byte ATTR_STACK_MAP = 11;
  598. public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS = 12;
  599. public static final byte ATTR_RUNTIME_INVISIBLE_ANNOTATIONS = 13;
  600. public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS = 14;
  601. public static final byte ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS = 15;
  602. public static final byte ATTR_LOCAL_VARIABLE_TYPE_TABLE = 16;
  603. public static final byte ATTR_ENCLOSING_METHOD = 17;
  604. public static final byte ATTR_ANNOTATION_DEFAULT = 18;
  605. public static final byte ATTR_BOOTSTRAPMETHODS = 19;
  606. public static final byte ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS = 20;
  607. public static final byte ATTR_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS = 21;
  608. public static final byte ATTR_METHOD_PARAMETERS = 22;
  609. // J9:
  610. public static final byte ATTR_MODULE = 23;
  611. public static final byte ATTR_MODULE_PACKAGES = 24;
  612. public static final byte ATTR_MODULE_MAIN_CLASS = 25;
  613. public static final short KNOWN_ATTRIBUTES = 26;
  614. public static final String[] ATTRIBUTE_NAMES = {
  615. "SourceFile", "ConstantValue", "Code", "Exceptions", "LineNumberTable", "LocalVariableTable",
  616. "InnerClasses", "Synthetic", "Deprecated", "PMGClass", "Signature", "StackMap",
  617. "RuntimeVisibleAnnotations", "RuntimeInvisibleAnnotations", "RuntimeVisibleParameterAnnotations",
  618. "RuntimeInvisibleParameterAnnotations", "LocalVariableTypeTable", "EnclosingMethod",
  619. "AnnotationDefault","BootstrapMethods", "RuntimeVisibleTypeAnnotations", "RuntimeInvisibleTypeAnnotations",
  620. "MethodParameters", "Module", "ModulePackages", "ModuleMainClass"
  621. };
  622. /**
  623. * Constants used in the StackMap attribute.
  624. */
  625. public static final byte ITEM_Bogus = 0;
  626. public static final byte ITEM_Integer = 1;
  627. public static final byte ITEM_Float = 2;
  628. public static final byte ITEM_Double = 3;
  629. public static final byte ITEM_Long = 4;
  630. public static final byte ITEM_Null = 5;
  631. public static final byte ITEM_InitObject = 6;
  632. public static final byte ITEM_Object = 7;
  633. public static final byte ITEM_NewObject = 8;
  634. public static final String[] ITEM_NAMES = { "Bogus", "Integer", "Float", "Double", "Long", "Null", "InitObject", "Object",
  635. "NewObject" };
  636. }