001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.jikesrvm.classloader;
014    
015    public interface ClassLoaderConstants {
016      // Attribute modifiers for class-, method-, and field- descriptions.
017      //
018      //                                      applicability
019      //           name        value       class  field  method
020      //    ---------------   --------     -----  -----  ------
021      short ACC_PUBLIC       = 0x0001;  //   X      X      X
022      short ACC_PRIVATE      = 0x0002;  //   X      X      X (applicable to inner classes)
023      short ACC_PROTECTED    = 0x0004;  //   X      X      X (applicable to inner classes)
024      short ACC_STATIC       = 0x0008;  //   X      X      X (applicable to inner classes)
025      short ACC_FINAL        = 0x0010;  //   X      X      X
026      short ACC_SYNCHRONIZED = 0x0020;  //   -      -      X  <- same value as ACC_SUPER
027      short ACC_SUPER        = 0x0020;  //   X      -      -  <- same value as ACC_SYNCHRONIZED
028      short ACC_VOLATILE     = 0x0040;  //   -      X      -
029      short BRIDGE           = 0x0040;  //   -      -      X  <- same value as ACC_VOLATILE
030      short ACC_TRANSIENT    = 0x0080;  //   -      X      -
031      short VARARGS          = 0x0080;  //   -      -      X  <- same value as ACC_TRANSIENT
032      short ACC_NATIVE       = 0x0100;  //   -      -      X
033      short ACC_INTERFACE    = 0x0200;  //   X      -      -
034      short ACC_ABSTRACT     = 0x0400;  //   X      -      X
035      short ACC_STRICT       = 0x0800;  //   -      -      X
036      short ACC_SYNTHETIC    = 0x1000;  //   X      X      X
037      short ACC_ANNOTATION   = 0x2000;  //   X      -      -
038      short ACC_ENUM         = 0x4000;  //   X      X      -
039    
040      short APPLICABLE_TO_FIELDS =
041          (ACC_PUBLIC |
042           ACC_PRIVATE |
043           ACC_PROTECTED |
044           ACC_STATIC |
045           ACC_FINAL |
046           ACC_VOLATILE |
047           ACC_TRANSIENT |
048           ACC_SYNTHETIC |
049           ACC_ENUM);
050    
051      short APPLICABLE_TO_METHODS =
052          (ACC_PUBLIC |
053           ACC_PRIVATE |
054           ACC_PROTECTED |
055           ACC_STATIC |
056           ACC_FINAL |
057           ACC_SYNCHRONIZED |
058           BRIDGE |
059           VARARGS |
060           ACC_NATIVE |
061           ACC_ABSTRACT |
062           ACC_STRICT |
063           ACC_SYNTHETIC);
064    
065      short APPLICABLE_TO_CLASSES =
066          (ACC_PUBLIC |
067           ACC_PRIVATE |
068           ACC_STATIC |
069           ACC_FINAL |
070           ACC_SUPER |
071           ACC_INTERFACE |
072           ACC_ABSTRACT |
073           ACC_SYNTHETIC |
074           ACC_ANNOTATION |
075           ACC_ENUM);
076    
077      /* Possible states of a class description. */
078      /** nothing present yet */
079      byte CLASS_VACANT = 0;
080      /** .class file contents read successfully */
081      byte CLASS_LOADED = 1;
082      /** fields &amp; methods laid out, tib &amp; statics allocated */
083      byte CLASS_RESOLVED = 2;
084      /** tib and jtoc populated */
085      byte CLASS_INSTANTIATED = 3;
086      /** &lt;clinit&gt; running (allocations possible) */
087      byte CLASS_INITIALIZING = 4;
088      /** exception occurred while running &lt;clinit&gt; class cannot be initialized successfully */
089      byte CLASS_INITIALIZER_FAILED = 5;
090      /** statics initialized */
091      byte CLASS_INITIALIZED = 6;
092    
093      // Constant pool entry tags.
094      //
095      byte TAG_UTF = 1;
096      byte TAG_UNUSED = 2;
097      byte TAG_INT = 3;
098      byte TAG_FLOAT = 4;
099      byte TAG_LONG = 5;
100      byte TAG_DOUBLE = 6;
101      byte TAG_TYPEREF = 7;
102      byte TAG_STRING = 8;
103      byte TAG_FIELDREF = 9;
104      byte TAG_METHODREF = 10;
105      byte TAG_INTERFACE_METHODREF = 11;
106      byte TAG_MEMBERNAME_AND_DESCRIPTOR = 12;
107    
108      // Type codes for class, array, and primitive types.
109      //
110      byte ClassTypeCode = (byte) 'L';
111      byte ArrayTypeCode = (byte) '[';
112      byte VoidTypeCode = (byte) 'V';
113      byte BooleanTypeCode = (byte) 'Z';
114      byte ByteTypeCode = (byte) 'B';
115      byte ShortTypeCode = (byte) 'S';
116      byte IntTypeCode = (byte) 'I';
117      byte LongTypeCode = (byte) 'J';
118      byte FloatTypeCode = (byte) 'F';
119      byte DoubleTypeCode = (byte) 'D';
120      byte CharTypeCode = (byte) 'C';
121    
122      // Constants for our internal encoding of constant pools.
123      /** Constant pool entry for a UTF-8 encoded atom */
124      byte CP_UTF = 0;
125      /** Constant pool entry for int literal */
126      byte CP_INT = 1;
127      /** Constant pool entry for long literal */
128      byte CP_LONG = 2;
129      /** Constant pool entry for float literal */
130      byte CP_FLOAT = 3;
131      /** Constant pool entry for double literal */
132      byte CP_DOUBLE = 4;
133      /** Constant pool entry for string literal (for annotations, may be other objects) */
134      byte CP_STRING = 5;
135      /** Constant pool entry for member (field or method) reference */
136      byte CP_MEMBER = 6;
137      /** Constant pool entry for type reference or class literal */
138      byte CP_CLASS = 7;
139    }