You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Constants.java 28KB

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