001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: * The Original Software is NetBeans. The Initial Developer of the Original
026: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
027: * Microsystems, Inc. All Rights Reserved.
028: *
029: * If you wish your version of this file to be governed by only the CDDL
030: * or only the GPL Version 2, indicate your decision by adding
031: * "[Contributor] elects to include this software in this distribution
032: * under the [CDDL or GPL Version 2] license." If you do not indicate a
033: * single choice of license, a recipient has the option to distribute
034: * your version of this file under either the CDDL, the GPL Version 2 or
035: * to extend the choice of license to its licensees as provided above.
036: * However, if you add GPL Version 2 code and therefore, elected the GPL
037: * Version 2 license, then the option applies only if the new code is
038: * made subject to such option by the copyright holder.
039: */
040:
041: package org.netbeans.lib.profiler.instrumentation;
042:
043: /**
044: * Various constants that may be used in a binary class file.
045: *
046: * @author Misha Dmitriev
047: */
048: public interface JavaClassConstants {
049: //~ Static fields/initializers -----------------------------------------------------------------------------------------------
050:
051: /* Class file constants */
052: public static final int JAVA_MAGIC = -889275714;
053: public static final int JAVA_MAJOR_VERSION = 48;
054: public static final int JAVA_MINOR_VERSION = 0;
055: public static final int JAVA_MIN_MAJOR_VERSION = 45;
056: public static final int JAVA_MIN_MINOR_VERSION = 3;
057: public static final int DEFAULT_MAJOR_VERSION = 46;
058: public static final int DEFAULT_MINOR_VERSION = 0;
059:
060: /* Constant pool entries tag constants */
061: public static final int CONSTANT_Utf8 = 1;
062: public static final int CONSTANT_Unicode = 2;
063: public static final int CONSTANT_Integer = 3;
064: public static final int CONSTANT_Float = 4;
065: public static final int CONSTANT_Long = 5;
066: public static final int CONSTANT_Double = 6;
067: public static final int CONSTANT_Class = 7;
068: public static final int CONSTANT_String = 8;
069: public static final int CONSTANT_Fieldref = 9;
070: public static final int CONSTANT_Methodref = 10;
071: public static final int CONSTANT_InterfaceMethodref = 11;
072: public static final int CONSTANT_NameAndType = 12;
073:
074: /* Opcodes */
075: static final int opc_try = -3;
076: static final int opc_dead = -2;
077: static final int opc_label = -1;
078: static final int opc_nop = 0;
079: static final int opc_aconst_null = 1;
080: static final int opc_iconst_m1 = 2;
081: static final int opc_iconst_0 = 3;
082: static final int opc_iconst_1 = 4;
083: static final int opc_iconst_2 = 5;
084: static final int opc_iconst_3 = 6;
085: static final int opc_iconst_4 = 7;
086: static final int opc_iconst_5 = 8;
087: static final int opc_lconst_0 = 9;
088: static final int opc_lconst_1 = 10;
089: static final int opc_fconst_0 = 11;
090: static final int opc_fconst_1 = 12;
091: static final int opc_fconst_2 = 13;
092: static final int opc_dconst_0 = 14;
093: static final int opc_dconst_1 = 15;
094: static final int opc_bipush = 16;
095: static final int opc_sipush = 17;
096: static final int opc_ldc = 18;
097: static final int opc_ldc_w = 19;
098: static final int opc_ldc2_w = 20;
099: static final int opc_iload = 21;
100: static final int opc_lload = 22;
101: static final int opc_fload = 23;
102: static final int opc_dload = 24;
103: static final int opc_aload = 25;
104: static final int opc_iload_0 = 26;
105: static final int opc_iload_1 = 27;
106: static final int opc_iload_2 = 28;
107: static final int opc_iload_3 = 29;
108: static final int opc_lload_0 = 30;
109: static final int opc_lload_1 = 31;
110: static final int opc_lload_2 = 32;
111: static final int opc_lload_3 = 33;
112: static final int opc_fload_0 = 34;
113: static final int opc_fload_1 = 35;
114: static final int opc_fload_2 = 36;
115: static final int opc_fload_3 = 37;
116: static final int opc_dload_0 = 38;
117: static final int opc_dload_1 = 39;
118: static final int opc_dload_2 = 40;
119: static final int opc_dload_3 = 41;
120: static final int opc_aload_0 = 42;
121: static final int opc_aload_1 = 43;
122: static final int opc_aload_2 = 44;
123: static final int opc_aload_3 = 45;
124: static final int opc_iaload = 46;
125: static final int opc_laload = 47;
126: static final int opc_faload = 48;
127: static final int opc_daload = 49;
128: static final int opc_aaload = 50;
129: static final int opc_baload = 51;
130: static final int opc_caload = 52;
131: static final int opc_saload = 53;
132: static final int opc_istore = 54;
133: static final int opc_lstore = 55;
134: static final int opc_fstore = 56;
135: static final int opc_dstore = 57;
136: static final int opc_astore = 58;
137: static final int opc_istore_0 = 59;
138: static final int opc_istore_1 = 60;
139: static final int opc_istore_2 = 61;
140: static final int opc_istore_3 = 62;
141: static final int opc_lstore_0 = 63;
142: static final int opc_lstore_1 = 64;
143: static final int opc_lstore_2 = 65;
144: static final int opc_lstore_3 = 66;
145: static final int opc_fstore_0 = 67;
146: static final int opc_fstore_1 = 68;
147: static final int opc_fstore_2 = 69;
148: static final int opc_fstore_3 = 70;
149: static final int opc_dstore_0 = 71;
150: static final int opc_dstore_1 = 72;
151: static final int opc_dstore_2 = 73;
152: static final int opc_dstore_3 = 74;
153: static final int opc_astore_0 = 75;
154: static final int opc_astore_1 = 76;
155: static final int opc_astore_2 = 77;
156: static final int opc_astore_3 = 78;
157: static final int opc_iastore = 79;
158: static final int opc_lastore = 80;
159: static final int opc_fastore = 81;
160: static final int opc_dastore = 82;
161: static final int opc_aastore = 83;
162: static final int opc_bastore = 84;
163: static final int opc_castore = 85;
164: static final int opc_sastore = 86;
165: static final int opc_pop = 87;
166: static final int opc_pop2 = 88;
167: static final int opc_dup = 89;
168: static final int opc_dup_x1 = 90;
169: static final int opc_dup_x2 = 91;
170: static final int opc_dup2 = 92;
171: static final int opc_dup2_x1 = 93;
172: static final int opc_dup2_x2 = 94;
173: static final int opc_swap = 95;
174: static final int opc_iadd = 96;
175: static final int opc_ladd = 97;
176: static final int opc_fadd = 98;
177: static final int opc_dadd = 99;
178: static final int opc_isub = 100;
179: static final int opc_lsub = 101;
180: static final int opc_fsub = 102;
181: static final int opc_dsub = 103;
182: static final int opc_imul = 104;
183: static final int opc_lmul = 105;
184: static final int opc_fmul = 106;
185: static final int opc_dmul = 107;
186: static final int opc_idiv = 108;
187: static final int opc_ldiv = 109;
188: static final int opc_fdiv = 110;
189: static final int opc_ddiv = 111;
190: static final int opc_irem = 112;
191: static final int opc_lrem = 113;
192: static final int opc_frem = 114;
193: static final int opc_drem = 115;
194: static final int opc_ineg = 116;
195: static final int opc_lneg = 117;
196: static final int opc_fneg = 118;
197: static final int opc_dneg = 119;
198: static final int opc_ishl = 120;
199: static final int opc_lshl = 121;
200: static final int opc_ishr = 122;
201: static final int opc_lshr = 123;
202: static final int opc_iushr = 124;
203: static final int opc_lushr = 125;
204: static final int opc_iand = 126;
205: static final int opc_land = 127;
206: static final int opc_ior = 128;
207: static final int opc_lor = 129;
208: static final int opc_ixor = 130;
209: static final int opc_lxor = 131;
210: static final int opc_iinc = 132;
211: static final int opc_i2l = 133;
212: static final int opc_i2f = 134;
213: static final int opc_i2d = 135;
214: static final int opc_l2i = 136;
215: static final int opc_l2f = 137;
216: static final int opc_l2d = 138;
217: static final int opc_f2i = 139;
218: static final int opc_f2l = 140;
219: static final int opc_f2d = 141;
220: static final int opc_d2i = 142;
221: static final int opc_d2l = 143;
222: static final int opc_d2f = 144;
223: static final int opc_i2b = 145;
224: static final int opc_i2c = 146;
225: static final int opc_i2s = 147;
226: static final int opc_lcmp = 148;
227: static final int opc_fcmpl = 149;
228: static final int opc_fcmpg = 150;
229: static final int opc_dcmpl = 151;
230: static final int opc_dcmpg = 152;
231: static final int opc_ifeq = 153;
232: static final int opc_ifne = 154;
233: static final int opc_iflt = 155;
234: static final int opc_ifge = 156;
235: static final int opc_ifgt = 157;
236: static final int opc_ifle = 158;
237: static final int opc_if_icmpeq = 159;
238: static final int opc_if_icmpne = 160;
239: static final int opc_if_icmplt = 161;
240: static final int opc_if_icmpge = 162;
241: static final int opc_if_icmpgt = 163;
242: static final int opc_if_icmple = 164;
243: static final int opc_if_acmpeq = 165;
244: static final int opc_if_acmpne = 166;
245: static final int opc_goto = 167;
246: static final int opc_jsr = 168;
247: static final int opc_ret = 169;
248: static final int opc_tableswitch = 170;
249: static final int opc_lookupswitch = 171;
250: static final int opc_ireturn = 172;
251: static final int opc_lreturn = 173;
252: static final int opc_freturn = 174;
253: static final int opc_dreturn = 175;
254: static final int opc_areturn = 176;
255: static final int opc_return = 177;
256: static final int opc_getstatic = 178;
257: static final int opc_putstatic = 179;
258: static final int opc_getfield = 180;
259: static final int opc_putfield = 181;
260: static final int opc_invokevirtual = 182;
261: static final int opc_invokespecial = 183;
262: static final int opc_invokestatic = 184;
263: static final int opc_invokeinterface = 185;
264: static final int opc_xxxunusedxxx = 186;
265: static final int opc_new = 187;
266: static final int opc_newarray = 188;
267: static final int opc_anewarray = 189;
268: static final int opc_arraylength = 190;
269: static final int opc_athrow = 191;
270: static final int opc_checkcast = 192;
271: static final int opc_instanceof = 193;
272: static final int opc_monitorenter = 194;
273: static final int opc_monitorexit = 195;
274: static final int opc_wide = 196;
275: static final int opc_multianewarray = 197;
276: static final int opc_ifnull = 198;
277: static final int opc_ifnonnull = 199;
278: static final int opc_goto_w = 200;
279: static final int opc_jsr_w = 201;
280: static final int opc_breakpoint = 202;
281: public static final int[] opc_length = { 1, // opc_nop
282: 1, // opc_aconst_null = 1;
283: 1, // opc_iconst_m1 = 2;
284: 1, // opc_iconst_0 = 3;
285: 1, // opc_iconst_1 = 4;
286: 1, // opc_iconst_2 = 5;
287: 1, // opc_iconst_3 = 6;
288: 1, // opc_iconst_4 = 7;
289: 1, // opc_iconst_5 = 8;
290: 1, // opc_lconst_0 = 9;
291: 1, // opc_lconst_1 = 10;
292: 1, // opc_fconst_0 = 11;
293: 1, // opc_fconst_1 = 12;
294: 1, // opc_fconst_2 = 13;
295: 1, // opc_dconst_0 = 14;
296: 1, // opc_dconst_1 = 15;
297: 2, // opc_bipush
298: 3, // opc_sipush
299: 2, // opc_ldc
300: 3, // opc_ldc_w
301: 3, // opc_ldc2_w
302: 2, // opc_iload
303: 2, // opc_lload
304: 2, // opc_fload
305: 2, // opc_dload
306: 2, // opc_aload
307: 1, // opc_iload_0 = 26;
308: 1, // opc_iload_1 = 27;
309: 1, // opc_iload_2 = 28;
310: 1, // opc_iload_3 = 29;
311: 1, // opc_lload_0 = 30;
312: 1, // opc_lload_1 = 31;
313: 1, // opc_lload_2 = 32;
314: 1, // opc_lload_3 = 33;
315: 1, // opc_fload_0 = 34;
316: 1, // opc_fload_1 = 35;
317: 1, // opc_fload_2 = 36;
318: 1, // opc_fload_3 = 37;
319: 1, // opc_dload_0 = 38;
320: 1, // opc_dload_1 = 39;
321: 1, // opc_dload_2 = 40;
322: 1, // opc_dload_3 = 41;
323: 1, // opc_aload_0 = 42;
324: 1, // opc_aload_1 = 43;
325: 1, // opc_aload_2 = 44;
326: 1, // opc_aload_3 = 45;
327: 1, // opc_iaload = 46;
328: 1, // opc_laload = 47;
329: 1, // opc_faload = 48;
330: 1, // opc_daload = 49;
331: 1, // opc_aaload = 50;
332: 1, // opc_baload = 51;
333: 1, // opc_caload = 52;
334: 1, // opc_saload = 53;
335: 2, // opc_istore
336: 2, // opc_lstore
337: 2, // opc_fstore
338: 2, // opc_dstore
339: 2, // opc_astore
340: 1, // opc_istore_0 = 59;
341: 1, // opc_istore_1 = 60;
342: 1, // opc_istore_2 = 61;
343: 1, // opc_istore_3 = 62;
344: 1, // opc_lstore_0 = 63;
345: 1, // opc_lstore_1 = 64;
346: 1, // opc_lstore_2 = 65;
347: 1, // opc_lstore_3 = 66;
348: 1, // opc_fstore_0 = 67;
349: 1, // opc_fstore_1 = 68;
350: 1, // opc_fstore_2 = 69;
351: 1, // opc_fstore_3 = 70;
352: 1, // opc_dstore_0 = 71;
353: 1, // opc_dstore_1 = 72;
354: 1, // opc_dstore_2 = 73;
355: 1, // opc_dstore_3 = 74;
356: 1, // opc_astore_0 = 75;
357: 1, // opc_astore_1 = 76;
358: 1, // opc_astore_2 = 77;
359: 1, // opc_astore_3 = 78;
360: 1, // opc_iastore = 79;
361: 1, // opc_lastore = 80;
362: 1, // opc_fastore = 81;
363: 1, // opc_dastore = 82;
364: 1, // opc_aastore = 83;
365: 1, // opc_bastore = 84;
366: 1, // opc_castore = 85;
367: 1, // opc_sastore = 86;
368: 1, // opc_pop = 87;
369: 1, // opc_pop2 = 88;
370: 1, // opc_dup = 89;
371: 1, // opc_dup_x1 = 90;
372: 1, // opc_dup_x2 = 91;
373: 1, // opc_dup2 = 92;
374: 1, // opc_dup2_x1 = 93;
375: 1, // opc_dup2_x2 = 94;
376: 1, // opc_swap = 95;
377: 1, // opc_iadd = 96;
378: 1, // opc_ladd = 97;
379: 1, // opc_fadd = 98;
380: 1, // opc_dadd = 99;
381: 1, // opc_isub = 100;
382: 1, // opc_lsub = 101;
383: 1, // opc_fsub = 102;
384: 1, // opc_dsub = 103;
385: 1, // opc_imul = 104;
386: 1, // opc_lmul = 105;
387: 1, // opc_fmul = 106;
388: 1, // opc_dmul = 107;
389: 1, // opc_idiv = 108;
390: 1, // opc_ldiv = 109;
391: 1, // opc_fdiv = 110;
392: 1, // opc_ddiv = 111;
393: 1, // opc_irem = 112;
394: 1, // opc_lrem = 113;
395: 1, // opc_frem = 114;
396: 1, // opc_drem = 115;
397: 1, // opc_ineg = 116;
398: 1, // opc_lneg = 117;
399: 1, // opc_fneg = 118;
400: 1, // opc_dneg = 119;
401: 1, // opc_ishl = 120;
402: 1, // opc_lshl = 121;
403: 1, // opc_ishr = 122;
404: 1, // opc_lshr = 123;
405: 1, // opc_iushr = 124;
406: 1, // opc_lushr = 125;
407: 1, // opc_iand = 126;
408: 1, // opc_land = 127;
409: 1, // opc_ior = 128;
410: 1, // opc_lor = 129;
411: 1, // opc_ixor = 130;
412: 1, // opc_lxor = 131;
413: 3, // opc_iinc
414: 1, // opc_i2l = 133;
415: 1, // opc_i2f = 134;
416: 1, // opc_i2d = 135;
417: 1, // opc_l2i = 136;
418: 1, // opc_l2f = 137;
419: 1, // opc_l2d = 138;
420: 1, // opc_f2i = 139;
421: 1, // opc_f2l = 140;
422: 1, // opc_f2d = 141;
423: 1, // opc_d2i = 142;
424: 1, // opc_d2l = 143;
425: 1, // opc_d2f = 144;
426: 1, // opc_i2b = 145;
427: 1, // opc_i2c = 146;
428: 1, // opc_i2s = 147;
429: 1, // opc_lcmp = 148;
430: 1, // opc_fcmpl = 149;
431: 1, // opc_fcmpg = 150;
432: 1, // opc_dcmpl = 151;
433: 1, // opc_dcmpg = 152;
434: 3, // opc_ifeq
435: 3, // opc_ifne
436: 3, // opc_iflt
437: 3, // opc_ifge
438: 3, // opc_ifgt
439: 3, // opc_ifle
440: 3, // opc_if_icmpeq
441: 3, // opc_if_icmpne
442: 3, // opc_if_icmplt
443: 3, // opc_if_icmpge
444: 3, // opc_if_icmpgt
445: 3, // opc_if_icmple
446: 3, // opc_if_acmpeq
447: 3, // opc_if_acmpne
448: 3, // opc_goto
449: 3, // opc_jsr
450: 2, // opc_ret
451: 0, // opc_tableswitch - variable length, handled specially
452: 0, // opc_lookupswitch - variable length, handled specially
453: 1, // opc_ireturn = 172;
454: 1, // opc_lreturn = 173;
455: 1, // opc_freturn = 174;
456: 1, // opc_dreturn = 175;
457: 1, // opc_areturn = 176;
458: 1, // opc_return = 177;
459: 3, // opc_getstatic
460: 3, // opc_putstatic
461: 3, // opc_getfield
462: 3, // opc_putfield
463: 3, // opc_invokevirtual
464: 3, // opc_invokespecial
465: 3, // opc_invokestatic
466: 5, // opc_invokeinterface
467: 0, // opc_xxxunusedxxx
468: 3, // opc_new
469: 2, // opc_newarray
470: 3, // opc_anewarray
471: 1, // opc_arraylength = 190;
472: 1, // opc_athrow = 191;
473: 3, // opc_checkcast
474: 3, // opc_instanceof
475: 1, // opc_monitorenter = 194;
476: 1, // opc_monitorexit = 195;
477: 0, // opc_wide - special handling
478: 4, // opc_multianewarray
479: 3, // opc_ifnull
480: 3, // opc_ifnonnull
481: 5, // opc_goto_w
482: 5, // opc_jsr_w
483: 0, // opc_breakpoint
484: };
485:
486: /* Primitive type array codes (used by opc_newarray opcode) */
487: public static final int T_BOOLEAN = 4; // Z
488: public static final int T_CHAR = 5; // C
489: public static final int T_FLOAT = 6; // F
490: public static final int T_DOUBLE = 7; // D
491: public static final int T_BYTE = 8; // B
492: public static final int T_SHORT = 9; // S
493: public static final int T_INT = 10; // I
494: public static final int T_LONG = 11; // J
495: public static final String[] PRIMITIVE_ARRAY_TYPE_NAMES = { null,
496: null, null, null, "[Z", // NOI18N
497: "[C", // NOI18N
498: "[F", // NOI18N
499: "[D", // NOI18N
500: "[B", // NOI18N
501: "[S", // NOI18N
502: "[I", // NOI18N
503: "[J" // NOI18N
504: };
505: }
|