001: /*
002: * @(#)RuntimeConstants.java 1.18 06/10/10
003: *
004: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: *
026: */
027:
028: package sun.tools.java;
029:
030: public interface RuntimeConstants {
031:
032: /* Signature Characters */
033: char SIGC_VOID = 'V';
034: String SIG_VOID = "V";
035: char SIGC_BOOLEAN = 'Z';
036: String SIG_BOOLEAN = "Z";
037: char SIGC_BYTE = 'B';
038: String SIG_BYTE = "B";
039: char SIGC_CHAR = 'C';
040: String SIG_CHAR = "C";
041: char SIGC_SHORT = 'S';
042: String SIG_SHORT = "S";
043: char SIGC_INT = 'I';
044: String SIG_INT = "I";
045: char SIGC_LONG = 'J';
046: String SIG_LONG = "J";
047: char SIGC_FLOAT = 'F';
048: String SIG_FLOAT = "F";
049: char SIGC_DOUBLE = 'D';
050: String SIG_DOUBLE = "D";
051: char SIGC_ARRAY = '[';
052: String SIG_ARRAY = "[";
053: char SIGC_CLASS = 'L';
054: String SIG_CLASS = "L";
055: char SIGC_METHOD = '(';
056: String SIG_METHOD = "(";
057: char SIGC_ENDCLASS = ';';
058: String SIG_ENDCLASS = ";";
059: char SIGC_ENDMETHOD = ')';
060: String SIG_ENDMETHOD = ")";
061: char SIGC_PACKAGE = '/';
062: String SIG_PACKAGE = "/";
063:
064: /* Class File Constants */
065: int JAVA_MAGIC = 0xcafebabe;
066: int JAVA_MIN_SUPPORTED_VERSION = 45;
067: int JAVA_MAX_SUPPORTED_VERSION = 48;
068: int JAVA_MAX_SUPPORTED_MINOR_VERSION = 0;
069:
070: /* Generate class file version for 1.1 by default */
071: int JAVA_DEFAULT_VERSION = 45;
072: int JAVA_DEFAULT_MINOR_VERSION = 3;
073:
074: /* Constant table */
075: int CONSTANT_UTF8 = 1;
076: int CONSTANT_UNICODE = 2;
077: int CONSTANT_INTEGER = 3;
078: int CONSTANT_FLOAT = 4;
079: int CONSTANT_LONG = 5;
080: int CONSTANT_DOUBLE = 6;
081: int CONSTANT_CLASS = 7;
082: int CONSTANT_STRING = 8;
083: int CONSTANT_FIELD = 9;
084: int CONSTANT_METHOD = 10;
085: int CONSTANT_INTERFACEMETHOD = 11;
086: int CONSTANT_NAMEANDTYPE = 12;
087:
088: /* Access and modifier flags */
089: int ACC_PUBLIC = 0x00000001;
090: int ACC_PRIVATE = 0x00000002;
091: int ACC_PROTECTED = 0x00000004;
092: int ACC_STATIC = 0x00000008;
093: int ACC_FINAL = 0x00000010;
094: int ACC_SYNCHRONIZED = 0x00000020;
095: int ACC_VOLATILE = 0x00000040;
096: int ACC_TRANSIENT = 0x00000080;
097: int ACC_NATIVE = 0x00000100;
098: int ACC_INTERFACE = 0x00000200;
099: int ACC_ABSTRACT = 0x00000400;
100: int ACC_SUPER = 0x00000020;
101: int ACC_STRICT = 0x00000800;
102:
103: /* Type codes */
104: int T_CLASS = 0x00000002;
105: int T_BOOLEAN = 0x00000004;
106: int T_CHAR = 0x00000005;
107: int T_FLOAT = 0x00000006;
108: int T_DOUBLE = 0x00000007;
109: int T_BYTE = 0x00000008;
110: int T_SHORT = 0x00000009;
111: int T_INT = 0x0000000a;
112: int T_LONG = 0x0000000b;
113:
114: /* Opcodes */
115: int opc_try = -3;
116: int opc_dead = -2;
117: int opc_label = -1;
118: int opc_nop = 0;
119: int opc_aconst_null = 1;
120: int opc_iconst_m1 = 2;
121: int opc_iconst_0 = 3;
122: int opc_iconst_1 = 4;
123: int opc_iconst_2 = 5;
124: int opc_iconst_3 = 6;
125: int opc_iconst_4 = 7;
126: int opc_iconst_5 = 8;
127: int opc_lconst_0 = 9;
128: int opc_lconst_1 = 10;
129: int opc_fconst_0 = 11;
130: int opc_fconst_1 = 12;
131: int opc_fconst_2 = 13;
132: int opc_dconst_0 = 14;
133: int opc_dconst_1 = 15;
134: int opc_bipush = 16;
135: int opc_sipush = 17;
136: int opc_ldc = 18;
137: int opc_ldc_w = 19;
138: int opc_ldc2_w = 20;
139: int opc_iload = 21;
140: int opc_lload = 22;
141: int opc_fload = 23;
142: int opc_dload = 24;
143: int opc_aload = 25;
144: int opc_iload_0 = 26;
145: int opc_iload_1 = 27;
146: int opc_iload_2 = 28;
147: int opc_iload_3 = 29;
148: int opc_lload_0 = 30;
149: int opc_lload_1 = 31;
150: int opc_lload_2 = 32;
151: int opc_lload_3 = 33;
152: int opc_fload_0 = 34;
153: int opc_fload_1 = 35;
154: int opc_fload_2 = 36;
155: int opc_fload_3 = 37;
156: int opc_dload_0 = 38;
157: int opc_dload_1 = 39;
158: int opc_dload_2 = 40;
159: int opc_dload_3 = 41;
160: int opc_aload_0 = 42;
161: int opc_aload_1 = 43;
162: int opc_aload_2 = 44;
163: int opc_aload_3 = 45;
164: int opc_iaload = 46;
165: int opc_laload = 47;
166: int opc_faload = 48;
167: int opc_daload = 49;
168: int opc_aaload = 50;
169: int opc_baload = 51;
170: int opc_caload = 52;
171: int opc_saload = 53;
172: int opc_istore = 54;
173: int opc_lstore = 55;
174: int opc_fstore = 56;
175: int opc_dstore = 57;
176: int opc_astore = 58;
177: int opc_istore_0 = 59;
178: int opc_istore_1 = 60;
179: int opc_istore_2 = 61;
180: int opc_istore_3 = 62;
181: int opc_lstore_0 = 63;
182: int opc_lstore_1 = 64;
183: int opc_lstore_2 = 65;
184: int opc_lstore_3 = 66;
185: int opc_fstore_0 = 67;
186: int opc_fstore_1 = 68;
187: int opc_fstore_2 = 69;
188: int opc_fstore_3 = 70;
189: int opc_dstore_0 = 71;
190: int opc_dstore_1 = 72;
191: int opc_dstore_2 = 73;
192: int opc_dstore_3 = 74;
193: int opc_astore_0 = 75;
194: int opc_astore_1 = 76;
195: int opc_astore_2 = 77;
196: int opc_astore_3 = 78;
197: int opc_iastore = 79;
198: int opc_lastore = 80;
199: int opc_fastore = 81;
200: int opc_dastore = 82;
201: int opc_aastore = 83;
202: int opc_bastore = 84;
203: int opc_castore = 85;
204: int opc_sastore = 86;
205: int opc_pop = 87;
206: int opc_pop2 = 88;
207: int opc_dup = 89;
208: int opc_dup_x1 = 90;
209: int opc_dup_x2 = 91;
210: int opc_dup2 = 92;
211: int opc_dup2_x1 = 93;
212: int opc_dup2_x2 = 94;
213: int opc_swap = 95;
214: int opc_iadd = 96;
215: int opc_ladd = 97;
216: int opc_fadd = 98;
217: int opc_dadd = 99;
218: int opc_isub = 100;
219: int opc_lsub = 101;
220: int opc_fsub = 102;
221: int opc_dsub = 103;
222: int opc_imul = 104;
223: int opc_lmul = 105;
224: int opc_fmul = 106;
225: int opc_dmul = 107;
226: int opc_idiv = 108;
227: int opc_ldiv = 109;
228: int opc_fdiv = 110;
229: int opc_ddiv = 111;
230: int opc_irem = 112;
231: int opc_lrem = 113;
232: int opc_frem = 114;
233: int opc_drem = 115;
234: int opc_ineg = 116;
235: int opc_lneg = 117;
236: int opc_fneg = 118;
237: int opc_dneg = 119;
238: int opc_ishl = 120;
239: int opc_lshl = 121;
240: int opc_ishr = 122;
241: int opc_lshr = 123;
242: int opc_iushr = 124;
243: int opc_lushr = 125;
244: int opc_iand = 126;
245: int opc_land = 127;
246: int opc_ior = 128;
247: int opc_lor = 129;
248: int opc_ixor = 130;
249: int opc_lxor = 131;
250: int opc_iinc = 132;
251: int opc_i2l = 133;
252: int opc_i2f = 134;
253: int opc_i2d = 135;
254: int opc_l2i = 136;
255: int opc_l2f = 137;
256: int opc_l2d = 138;
257: int opc_f2i = 139;
258: int opc_f2l = 140;
259: int opc_f2d = 141;
260: int opc_d2i = 142;
261: int opc_d2l = 143;
262: int opc_d2f = 144;
263: int opc_i2b = 145;
264: int opc_i2c = 146;
265: int opc_i2s = 147;
266: int opc_lcmp = 148;
267: int opc_fcmpl = 149;
268: int opc_fcmpg = 150;
269: int opc_dcmpl = 151;
270: int opc_dcmpg = 152;
271: int opc_ifeq = 153;
272: int opc_ifne = 154;
273: int opc_iflt = 155;
274: int opc_ifge = 156;
275: int opc_ifgt = 157;
276: int opc_ifle = 158;
277: int opc_if_icmpeq = 159;
278: int opc_if_icmpne = 160;
279: int opc_if_icmplt = 161;
280: int opc_if_icmpge = 162;
281: int opc_if_icmpgt = 163;
282: int opc_if_icmple = 164;
283: int opc_if_acmpeq = 165;
284: int opc_if_acmpne = 166;
285: int opc_goto = 167;
286: int opc_jsr = 168;
287: int opc_ret = 169;
288: int opc_tableswitch = 170;
289: int opc_lookupswitch = 171;
290: int opc_ireturn = 172;
291: int opc_lreturn = 173;
292: int opc_freturn = 174;
293: int opc_dreturn = 175;
294: int opc_areturn = 176;
295: int opc_return = 177;
296: int opc_getstatic = 178;
297: int opc_putstatic = 179;
298: int opc_getfield = 180;
299: int opc_putfield = 181;
300: int opc_invokevirtual = 182;
301: int opc_invokespecial = 183;
302: int opc_invokestatic = 184;
303: int opc_invokeinterface = 185;
304: int opc_xxxunusedxxx = 186;
305: int opc_new = 187;
306: int opc_newarray = 188;
307: int opc_anewarray = 189;
308: int opc_arraylength = 190;
309: int opc_athrow = 191;
310: int opc_checkcast = 192;
311: int opc_instanceof = 193;
312: int opc_monitorenter = 194;
313: int opc_monitorexit = 195;
314: int opc_wide = 196;
315: int opc_multianewarray = 197;
316: int opc_ifnull = 198;
317: int opc_ifnonnull = 199;
318: int opc_goto_w = 200;
319: int opc_jsr_w = 201;
320: int opc_breakpoint = 202;
321:
322: /* Opcode Names */
323: String opcNames[] = { "nop", "aconst_null", "iconst_m1",
324: "iconst_0", "iconst_1", "iconst_2", "iconst_3", "iconst_4",
325: "iconst_5", "lconst_0", "lconst_1", "fconst_0", "fconst_1",
326: "fconst_2", "dconst_0", "dconst_1", "bipush", "sipush",
327: "ldc", "ldc_w", "ldc2_w", "iload", "lload", "fload",
328: "dload", "aload", "iload_0", "iload_1", "iload_2",
329: "iload_3", "lload_0", "lload_1", "lload_2", "lload_3",
330: "fload_0", "fload_1", "fload_2", "fload_3", "dload_0",
331: "dload_1", "dload_2", "dload_3", "aload_0", "aload_1",
332: "aload_2", "aload_3", "iaload", "laload", "faload",
333: "daload", "aaload", "baload", "caload", "saload", "istore",
334: "lstore", "fstore", "dstore", "astore", "istore_0",
335: "istore_1", "istore_2", "istore_3", "lstore_0", "lstore_1",
336: "lstore_2", "lstore_3", "fstore_0", "fstore_1", "fstore_2",
337: "fstore_3", "dstore_0", "dstore_1", "dstore_2", "dstore_3",
338: "astore_0", "astore_1", "astore_2", "astore_3", "iastore",
339: "lastore", "fastore", "dastore", "aastore", "bastore",
340: "castore", "sastore", "pop", "pop2", "dup", "dup_x1",
341: "dup_x2", "dup2", "dup2_x1", "dup2_x2", "swap", "iadd",
342: "ladd", "fadd", "dadd", "isub", "lsub", "fsub", "dsub",
343: "imul", "lmul", "fmul", "dmul", "idiv", "ldiv", "fdiv",
344: "ddiv", "irem", "lrem", "frem", "drem", "ineg", "lneg",
345: "fneg", "dneg", "ishl", "lshl", "ishr", "lshr", "iushr",
346: "lushr", "iand", "land", "ior", "lor", "ixor", "lxor",
347: "iinc", "i2l", "i2f", "i2d", "l2i", "l2f", "l2d", "f2i",
348: "f2l", "f2d", "d2i", "d2l", "d2f", "i2b", "i2c", "i2s",
349: "lcmp", "fcmpl", "fcmpg", "dcmpl", "dcmpg", "ifeq", "ifne",
350: "iflt", "ifge", "ifgt", "ifle", "if_icmpeq", "if_icmpne",
351: "if_icmplt", "if_icmpge", "if_icmpgt", "if_icmple",
352: "if_acmpeq", "if_acmpne", "goto", "jsr", "ret",
353: "tableswitch", "lookupswitch", "ireturn", "lreturn",
354: "freturn", "dreturn", "areturn", "return", "getstatic",
355: "putstatic", "getfield", "putfield", "invokevirtual",
356: "invokespecial", "invokestatic", "invokeinterface",
357: "xxxunusedxxx", "new", "newarray", "anewarray",
358: "arraylength", "athrow", "checkcast", "instanceof",
359: "monitorenter", "monitorexit", "wide", "multianewarray",
360: "ifnull", "ifnonnull", "goto_w", "jsr_w", "breakpoint" };
361:
362: /* Opcode Lengths */
363: int opcLengths[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364: 1, 2, 3, 2, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
366: 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
367: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
369: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1,
370: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
371: 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 99, 99, 1, 1,
372: 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 5, 0, 3, 2, 3, 1, 1, 3, 3,
373: 1, 1, 0, 4, 3, 3, 5, 5, 1 };
374:
375: }
|