ij-16.png   inspectorJ -- JavaTM Profiler
sf project site browse source checkout source
SourceForge.net Logo



src/inspectorj/agent/classfile_constants.h

00001 /*
00002  * @(#)classfile_constants.h    1.3 05/01/04
00003  * 
00004  * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
00005  * 
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  * 
00009  * -Redistribution of source code must retain the above copyright notice, this
00010  *  list of conditions and the following disclaimer.
00011  * 
00012  * -Redistribution in binary form must reproduce the above copyright notice, 
00013  *  this list of conditions and the following disclaimer in the documentation
00014  *  and/or other materials provided with the distribution.
00015  * 
00016  * Neither the name of Sun Microsystems, Inc. or the names of contributors may 
00017  * be used to endorse or promote products derived from this software without 
00018  * specific prior written permission.
00019  * 
00020  * This software is provided "AS IS," without a warranty of any kind. ALL 
00021  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
00022  * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00023  * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN")
00024  * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
00025  * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
00026  * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST 
00027  * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, 
00028  * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY 
00029  * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, 
00030  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
00031  * 
00032  * You acknowledge that this software is not designed, licensed or intended
00033  * for use in the design, construction, operation or maintenance of any
00034  * nuclear facility.
00035  */
00036 
00037 #ifndef CLASSFILE_CONSTANTS_H
00038 #define CLASSFILE_CONSTANTS_H
00039 
00040 /* Flags */
00041 
00042 #define JVM_ACC_PUBLIC        0x0001  
00043 #define JVM_ACC_PRIVATE       0x0002  
00044 #define JVM_ACC_PROTECTED     0x0004  
00045 #define JVM_ACC_STATIC        0x0008  
00046 #define JVM_ACC_FINAL         0x0010  
00047 #define JVM_ACC_SYNCHRONIZED  0x0020  
00048 #define JVM_ACC_SUPER         0x0020  
00049 #define JVM_ACC_VOLATILE      0x0040  
00050 #define JVM_ACC_TRANSIENT     0x0080  
00051 #define JVM_ACC_VARARGS       0x0080  
00052 #define JVM_ACC_NATIVE        0x0100  
00053 #define JVM_ACC_INTERFACE     0x0200  
00054 #define JVM_ACC_ABSTRACT      0x0400  
00055 #define JVM_ACC_STRICT        0x0800  
00056 #define JVM_ACC_SYNTHETIC     0x1000  
00057 #define JVM_ACC_ANNOTATION    0x2000  
00058 #define JVM_ACC_ENUM          0x4000  
00059 
00060 enum {
00061     JVM_CONSTANT_Utf8                   = 1,
00062     JVM_CONSTANT_Unicode                = 2, /* unused */
00063     JVM_CONSTANT_Integer                = 3,
00064     JVM_CONSTANT_Float                  = 4,
00065     JVM_CONSTANT_Long                   = 5,      
00066     JVM_CONSTANT_Double                 = 6,
00067     JVM_CONSTANT_Class                  = 7,
00068     JVM_CONSTANT_String                 = 8,
00069     JVM_CONSTANT_Fieldref               = 9,
00070     JVM_CONSTANT_Methodref              = 10,
00071     JVM_CONSTANT_InterfaceMethodref     = 11,
00072     JVM_CONSTANT_NameAndType            = 12
00073 };
00074 
00075 /* Type signatures */
00076 
00077 #define JVM_SIGNATURE_ARRAY             '['
00078 #define JVM_SIGNATURE_BYTE              'B'
00079 #define JVM_SIGNATURE_CHAR              'C'
00080 #define JVM_SIGNATURE_CLASS             'L'
00081 #define JVM_SIGNATURE_ENDCLASS          ';'
00082 #define JVM_SIGNATURE_ENUM              'E'
00083 #define JVM_SIGNATURE_FLOAT             'F'
00084 #define JVM_SIGNATURE_DOUBLE             'D'
00085 #define JVM_SIGNATURE_FUNC              '('
00086 #define JVM_SIGNATURE_ENDFUNC           ')'
00087 #define JVM_SIGNATURE_INT               'I'
00088 #define JVM_SIGNATURE_LONG              'J'
00089 #define JVM_SIGNATURE_SHORT             'S'
00090 #define JVM_SIGNATURE_VOID              'V'
00091 #define JVM_SIGNATURE_BOOLEAN           'Z'
00092 
00093 /* Opcodes */
00094 
00095 enum {
00096   opc_nop               = 0,
00097   opc_aconst_null       = 1,
00098   opc_iconst_m1         = 2,
00099   opc_iconst_0          = 3,
00100   opc_iconst_1          = 4,
00101   opc_iconst_2          = 5,
00102   opc_iconst_3          = 6,
00103   opc_iconst_4          = 7,
00104   opc_iconst_5          = 8,
00105   opc_lconst_0          = 9,
00106   opc_lconst_1          = 10,
00107   opc_fconst_0          = 11,
00108   opc_fconst_1          = 12,
00109   opc_fconst_2          = 13,
00110   opc_dconst_0          = 14,
00111   opc_dconst_1          = 15,
00112   opc_bipush            = 16,
00113   opc_sipush            = 17,
00114   opc_ldc               = 18,
00115   opc_ldc_w             = 19,
00116   opc_ldc2_w            = 20,
00117   opc_iload             = 21,
00118   opc_lload             = 22,
00119   opc_fload             = 23,
00120   opc_dload             = 24,
00121   opc_aload             = 25,
00122   opc_iload_0           = 26,
00123   opc_iload_1           = 27,
00124   opc_iload_2           = 28,
00125   opc_iload_3           = 29,
00126   opc_lload_0           = 30,
00127   opc_lload_1           = 31,
00128   opc_lload_2           = 32,
00129   opc_lload_3           = 33,
00130   opc_fload_0           = 34,
00131   opc_fload_1           = 35,
00132   opc_fload_2           = 36,
00133   opc_fload_3           = 37,
00134   opc_dload_0           = 38,
00135   opc_dload_1           = 39,
00136   opc_dload_2           = 40,
00137   opc_dload_3           = 41,
00138   opc_aload_0           = 42,
00139   opc_aload_1           = 43,
00140   opc_aload_2           = 44,
00141   opc_aload_3           = 45,
00142   opc_iaload            = 46,
00143   opc_laload            = 47,
00144   opc_faload            = 48,
00145   opc_daload            = 49,
00146   opc_aaload            = 50,
00147   opc_baload            = 51,
00148   opc_caload            = 52,
00149   opc_saload            = 53,
00150   opc_istore            = 54,
00151   opc_lstore            = 55,
00152   opc_fstore            = 56,
00153   opc_dstore            = 57,
00154   opc_astore            = 58,
00155   opc_istore_0          = 59,
00156   opc_istore_1          = 60,
00157   opc_istore_2          = 61,
00158   opc_istore_3          = 62,
00159   opc_lstore_0          = 63,
00160   opc_lstore_1          = 64,
00161   opc_lstore_2          = 65,
00162   opc_lstore_3          = 66,
00163   opc_fstore_0          = 67,
00164   opc_fstore_1          = 68,
00165   opc_fstore_2          = 69,
00166   opc_fstore_3          = 70,
00167   opc_dstore_0          = 71,
00168   opc_dstore_1          = 72,
00169   opc_dstore_2          = 73,
00170   opc_dstore_3          = 74,
00171   opc_astore_0          = 75,
00172   opc_astore_1          = 76,
00173   opc_astore_2          = 77,
00174   opc_astore_3          = 78,
00175   opc_iastore           = 79,
00176   opc_lastore           = 80,
00177   opc_fastore           = 81,
00178   opc_dastore           = 82,
00179   opc_aastore           = 83,
00180   opc_bastore           = 84,
00181   opc_castore           = 85,
00182   opc_sastore           = 86,
00183   opc_pop               = 87,
00184   opc_pop2              = 88,
00185   opc_dup               = 89,
00186   opc_dup_x1            = 90,
00187   opc_dup_x2            = 91,
00188   opc_dup2              = 92,
00189   opc_dup2_x1           = 93,
00190   opc_dup2_x2           = 94,
00191   opc_swap              = 95,
00192   opc_iadd              = 96,
00193   opc_ladd              = 97,
00194   opc_fadd              = 98,
00195   opc_dadd              = 99,
00196   opc_isub              = 100,
00197   opc_lsub              = 101,
00198   opc_fsub              = 102,
00199   opc_dsub              = 103,
00200   opc_imul              = 104,
00201   opc_lmul              = 105,
00202   opc_fmul              = 106,
00203   opc_dmul              = 107,
00204   opc_idiv              = 108,
00205   opc_ldiv              = 109,
00206   opc_fdiv              = 110,
00207   opc_ddiv              = 111,
00208   opc_irem              = 112,
00209   opc_lrem              = 113,
00210   opc_frem              = 114,
00211   opc_drem              = 115,
00212   opc_ineg              = 116,
00213   opc_lneg              = 117,
00214   opc_fneg              = 118,
00215   opc_dneg              = 119,
00216   opc_ishl              = 120,
00217   opc_lshl              = 121,
00218   opc_ishr              = 122,
00219   opc_lshr              = 123,
00220   opc_iushr             = 124,
00221   opc_lushr             = 125,
00222   opc_iand              = 126,
00223   opc_land              = 127,
00224   opc_ior               = 128,
00225   opc_lor               = 129,
00226   opc_ixor              = 130,
00227   opc_lxor              = 131,
00228   opc_iinc              = 132,
00229   opc_i2l               = 133,
00230   opc_i2f               = 134,
00231   opc_i2d               = 135,
00232   opc_l2i               = 136,
00233   opc_l2f               = 137,
00234   opc_l2d               = 138,
00235   opc_f2i               = 139,
00236   opc_f2l               = 140,
00237   opc_f2d               = 141,
00238   opc_d2i               = 142,
00239   opc_d2l               = 143,
00240   opc_d2f               = 144,
00241   opc_i2b               = 145,
00242   opc_i2c               = 146,
00243   opc_i2s               = 147,
00244   opc_lcmp              = 148,
00245   opc_fcmpl             = 149,
00246   opc_fcmpg             = 150,
00247   opc_dcmpl             = 151,
00248   opc_dcmpg             = 152,
00249   opc_ifeq              = 153,
00250   opc_ifne              = 154,
00251   opc_iflt              = 155,
00252   opc_ifge              = 156,
00253   opc_ifgt              = 157,
00254   opc_ifle              = 158,
00255   opc_if_icmpeq         = 159,
00256   opc_if_icmpne         = 160,
00257   opc_if_icmplt         = 161,
00258   opc_if_icmpge         = 162,
00259   opc_if_icmpgt         = 163,
00260   opc_if_icmple         = 164,
00261   opc_if_acmpeq         = 165,
00262   opc_if_acmpne         = 166,
00263   opc_goto              = 167,
00264   opc_jsr               = 168,
00265   opc_ret               = 169,
00266   opc_tableswitch       = 170,
00267   opc_lookupswitch      = 171,
00268   opc_ireturn           = 172,
00269   opc_lreturn           = 173,
00270   opc_freturn           = 174,
00271   opc_dreturn           = 175,
00272   opc_areturn           = 176,
00273   opc_return            = 177,
00274   opc_getstatic         = 178,
00275   opc_putstatic         = 179,
00276   opc_getfield          = 180,
00277   opc_putfield          = 181,
00278   opc_invokevirtual     = 182,
00279   opc_invokespecial     = 183,
00280   opc_invokestatic      = 184,
00281   opc_invokeinterface   = 185,
00282   opc_xxxunusedxxx      = 186,
00283   opc_new               = 187,
00284   opc_newarray          = 188,
00285   opc_anewarray         = 189,
00286   opc_arraylength       = 190,
00287   opc_athrow            = 191,
00288   opc_checkcast         = 192,
00289   opc_instanceof        = 193,
00290   opc_monitorenter      = 194,
00291   opc_monitorexit       = 195,
00292   opc_wide              = 196,
00293   opc_multianewarray    = 197,
00294   opc_ifnull            = 198,
00295   opc_ifnonnull         = 199,
00296   opc_goto_w            = 200,
00297   opc_jsr_w             = 201,
00298   opc_MAX               = 201
00299 };
00300 
00301 /* Opcode length initializer, use with something like:
00302  *   unsigned char opcode_length[opc_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
00303  */
00304 #define JVM_OPCODE_LENGTH_INITIALIZER {         \
00305    1,   /* nop */                       \
00306    1,   /* aconst_null */               \
00307    1,   /* iconst_m1 */                 \
00308    1,   /* iconst_0 */                  \
00309    1,   /* iconst_1 */                  \
00310    1,   /* iconst_2 */                  \
00311    1,   /* iconst_3 */                  \
00312    1,   /* iconst_4 */                  \
00313    1,   /* iconst_5 */                  \
00314    1,   /* lconst_0 */                  \
00315    1,   /* lconst_1 */                  \
00316    1,   /* fconst_0 */                  \
00317    1,   /* fconst_1 */                  \
00318    1,   /* fconst_2 */                  \
00319    1,   /* dconst_0 */                  \
00320    1,   /* dconst_1 */                  \
00321    2,   /* bipush */                    \
00322    3,   /* sipush */                    \
00323    2,   /* ldc */                       \
00324    3,   /* ldc_w */                     \
00325    3,   /* ldc2_w */                    \
00326    2,   /* iload */                     \
00327    2,   /* lload */                     \
00328    2,   /* fload */                     \
00329    2,   /* dload */                     \
00330    2,   /* aload */                     \
00331    1,   /* iload_0 */                   \
00332    1,   /* iload_1 */                   \
00333    1,   /* iload_2 */                   \
00334    1,   /* iload_3 */                   \
00335    1,   /* lload_0 */                   \
00336    1,   /* lload_1 */                   \
00337    1,   /* lload_2 */                   \
00338    1,   /* lload_3 */                   \
00339    1,   /* fload_0 */                   \
00340    1,   /* fload_1 */                   \
00341    1,   /* fload_2 */                   \
00342    1,   /* fload_3 */                   \
00343    1,   /* dload_0 */                   \
00344    1,   /* dload_1 */                   \
00345    1,   /* dload_2 */                   \
00346    1,   /* dload_3 */                   \
00347    1,   /* aload_0 */                   \
00348    1,   /* aload_1 */                   \
00349    1,   /* aload_2 */                   \
00350    1,   /* aload_3 */                   \
00351    1,   /* iaload */                    \
00352    1,   /* laload */                    \
00353    1,   /* faload */                    \
00354    1,   /* daload */                    \
00355    1,   /* aaload */                    \
00356    1,   /* baload */                    \
00357    1,   /* caload */                    \
00358    1,   /* saload */                    \
00359    2,   /* istore */                    \
00360    2,   /* lstore */                    \
00361    2,   /* fstore */                    \
00362    2,   /* dstore */                    \
00363    2,   /* astore */                    \
00364    1,   /* istore_0 */                  \
00365    1,   /* istore_1 */                  \
00366    1,   /* istore_2 */                  \
00367    1,   /* istore_3 */                  \
00368    1,   /* lstore_0 */                  \
00369    1,   /* lstore_1 */                  \
00370    1,   /* lstore_2 */                  \
00371    1,   /* lstore_3 */                  \
00372    1,   /* fstore_0 */                  \
00373    1,   /* fstore_1 */                  \
00374    1,   /* fstore_2 */                  \
00375    1,   /* fstore_3 */                  \
00376    1,   /* dstore_0 */                  \
00377    1,   /* dstore_1 */                  \
00378    1,   /* dstore_2 */                  \
00379    1,   /* dstore_3 */                  \
00380    1,   /* astore_0 */                  \
00381    1,   /* astore_1 */                  \
00382    1,   /* astore_2 */                  \
00383    1,   /* astore_3 */                  \
00384    1,   /* iastore */                   \
00385    1,   /* lastore */                   \
00386    1,   /* fastore */                   \
00387    1,   /* dastore */                   \
00388    1,   /* aastore */                   \
00389    1,   /* bastore */                   \
00390    1,   /* castore */                   \
00391    1,   /* sastore */                   \
00392    1,   /* pop */                       \
00393    1,   /* pop2 */                      \
00394    1,   /* dup */                       \
00395    1,   /* dup_x1 */                    \
00396    1,   /* dup_x2 */                    \
00397    1,   /* dup2 */                      \
00398    1,   /* dup2_x1 */                   \
00399    1,   /* dup2_x2 */                   \
00400    1,   /* swap */                      \
00401    1,   /* iadd */                      \
00402    1,   /* ladd */                      \
00403    1,   /* fadd */                      \
00404    1,   /* dadd */                      \
00405    1,   /* isub */                      \
00406    1,   /* lsub */                      \
00407    1,   /* fsub */                      \
00408    1,   /* dsub */                      \
00409    1,   /* imul */                      \
00410    1,   /* lmul */                      \
00411    1,   /* fmul */                      \
00412    1,   /* dmul */                      \
00413    1,   /* idiv */                      \
00414    1,   /* ldiv */                      \
00415    1,   /* fdiv */                      \
00416    1,   /* ddiv */                      \
00417    1,   /* irem */                      \
00418    1,   /* lrem */                      \
00419    1,   /* frem */                      \
00420    1,   /* drem */                      \
00421    1,   /* ineg */                      \
00422    1,   /* lneg */                      \
00423    1,   /* fneg */                      \
00424    1,   /* dneg */                      \
00425    1,   /* ishl */                      \
00426    1,   /* lshl */                      \
00427    1,   /* ishr */                      \
00428    1,   /* lshr */                      \
00429    1,   /* iushr */                     \
00430    1,   /* lushr */                     \
00431    1,   /* iand */                      \
00432    1,   /* land */                      \
00433    1,   /* ior */                       \
00434    1,   /* lor */                       \
00435    1,   /* ixor */                      \
00436    1,   /* lxor */                      \
00437    3,   /* iinc */                      \
00438    1,   /* i2l */                       \
00439    1,   /* i2f */                       \
00440    1,   /* i2d */                       \
00441    1,   /* l2i */                       \
00442    1,   /* l2f */                       \
00443    1,   /* l2d */                       \
00444    1,   /* f2i */                       \
00445    1,   /* f2l */                       \
00446    1,   /* f2d */                       \
00447    1,   /* d2i */                       \
00448    1,   /* d2l */                       \
00449    1,   /* d2f */                       \
00450    1,   /* i2b */                       \
00451    1,   /* i2c */                       \
00452    1,   /* i2s */                       \
00453    1,   /* lcmp */                      \
00454    1,   /* fcmpl */                     \
00455    1,   /* fcmpg */                     \
00456    1,   /* dcmpl */                     \
00457    1,   /* dcmpg */                     \
00458    3,   /* ifeq */                      \
00459    3,   /* ifne */                      \
00460    3,   /* iflt */                      \
00461    3,   /* ifge */                      \
00462    3,   /* ifgt */                      \
00463    3,   /* ifle */                      \
00464    3,   /* if_icmpeq */                 \
00465    3,   /* if_icmpne */                 \
00466    3,   /* if_icmplt */                 \
00467    3,   /* if_icmpge */                 \
00468    3,   /* if_icmpgt */                 \
00469    3,   /* if_icmple */                 \
00470    3,   /* if_acmpeq */                 \
00471    3,   /* if_acmpne */                 \
00472    3,   /* goto */                      \
00473    3,   /* jsr */                       \
00474    2,   /* ret */                       \
00475    99,  /* tableswitch */               \
00476    99,  /* lookupswitch */              \
00477    1,   /* ireturn */                   \
00478    1,   /* lreturn */                   \
00479    1,   /* freturn */                   \
00480    1,   /* dreturn */                   \
00481    1,   /* areturn */                   \
00482    1,   /* return */                    \
00483    3,   /* getstatic */                 \
00484    3,   /* putstatic */                 \
00485    3,   /* getfield */                  \
00486    3,   /* putfield */                  \
00487    3,   /* invokevirtual */             \
00488    3,   /* invokespecial */             \
00489    3,   /* invokestatic */              \
00490    5,   /* invokeinterface */           \
00491    0,   /* xxxunusedxxx */              \
00492    3,   /* new */                       \
00493    2,   /* newarray */                  \
00494    3,   /* anewarray */                 \
00495    1,   /* arraylength */               \
00496    1,   /* athrow */                    \
00497    3,   /* checkcast */                 \
00498    3,   /* instanceof */                \
00499    1,   /* monitorenter */              \
00500    1,   /* monitorexit */               \
00501    0,   /* wide */                      \
00502    4,   /* multianewarray */            \
00503    3,   /* ifnull */                    \
00504    3,   /* ifnonnull */                 \
00505    5,   /* goto_w */                    \
00506    5    /* jsr_w */                     \
00507 }
00508 
00509 #endif
00510 

Generated on Sun Aug 19 17:07:53 2007 for inspectorJ by  doxygen 1.5.1