001: /*
002: * @(#)CVMConst.java 1.19 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: package consts;
028:
029: public interface CVMConst {
030:
031: /*
032: * Class, field, and method access and modifier flags. Some of these
033: * values are different from the red book so they'll fit in one byte
034: */
035:
036: public static final int CVM_CLASS_ACC_PUBLIC = 0x01; /* visible to everyone */
037: public static final int CVM_CLASS_ACC_PRIMITIVE = 0x02; /* primitive type class */
038: public static final int CVM_CLASS_ACC_FINALIZABLE = 0x04; /* has non-trivial finalizer */
039: public static final int CVM_CLASS_ACC_REFERENCE = 0x08; /* is a flavor of weak reference */
040: public static final int CVM_CLASS_ACC_FINAL = 0x10; /* no further subclassing */
041: public static final int CVM_CLASS_ACC_SUPER = 0x20; /* funky handling of invokespecial */
042: public static final int CVM_CLASS_ACC_INTERFACE = 0x200; /* class is an interface */
043: public static final int CVM_CLASS_ACC_ABSTRACT = 0x400; /* may not be instantiated */
044: public static final int CVM_CLASS_ACC_SYNTHETIC = 0x1000; /* Not in source */
045: public static final int CVM_CLASS_ACC_ANNOTATION = 0x2000; /* Declared as an annotation type */
046: public static final int CVM_CLASS_ACC_ENUM = 0x4000; /* Declared as an enum type */
047:
048: public static final int CVM_FIELD_ACC_PUBLIC = 0x01; /* visible to everyone */
049: public static final int CVM_FIELD_ACC_PRIVATE = 0x03; /* visible only to defining class */
050: public static final int CVM_FIELD_ACC_PROTECTED = 0x02; /* visible to subclasses */
051: public static final int CVM_FIELD_ACC_STATIC = 0x08; /* instance variable is static */
052: public static final int CVM_FIELD_ACC_FINAL = 0x10; /* no subclassing/overriding */
053: public static final int CVM_FIELD_ACC_VOLATILE = 0x40; /* cannot cache in registers */
054: public static final int CVM_FIELD_ACC_TRANSIENT = 0x80; /* not persistant */
055: public static final int CVM_FIELD_ACC_SYNTHETIC = 0x04; /* Not in source. */
056: public static final int CVM_FIELD_ACC_ENUM = 0x20; /* Declared as an enum type. */
057:
058: public static final int CVM_METHOD_ACC_PUBLIC = 0x01; /* visible to everyone */
059: public static final int CVM_METHOD_ACC_PRIVATE = 0x03; /* visible only to defining class */
060: public static final int CVM_METHOD_ACC_PROTECTED = 0x02; /* visible to subclasses */
061: public static final int CVM_METHOD_ACC_STATIC = 0x08; /* method is static */
062: public static final int CVM_METHOD_ACC_FINAL = 0x10; /* no further overriding */
063: public static final int CVM_METHOD_ACC_SYNCHRONIZED = 0x20; /* wrap method call in monitor lock */
064: public static final int CVM_METHOD_ACC_BRIDGE = 0x40; /* Bridge generated by javac. */
065: public static final int CVM_METHOD_ACC_VARARG = 0x80; /* Declared with varargs. */
066: public static final int CVM_METHOD_ACC_NATIVE = 0x100; /* implemented in C */
067: public static final int CVM_METHOD_ACC_ABSTRACT = 0x400; /* no definition provided */
068: public static final int CVM_METHOD_ACC_STRICT = 0x200; /* floating point is strict. */
069: public static final int CVM_METHOD_ACC_SYNTHETIC = 0x04; /* Not in source. */
070:
071: /*
072: * CVMConstantPoolType
073: * See the enum CVMConstantPoolEntryTypeEnum in
074: * javavm/include/constantpool.h
075: *
076: * The first set is right out of the class file.
077: */
078: public static final int CVM_CONSTANT_Utf8 = 1;
079: public static final int CVM_CONSTANT_Unicode = 2;
080: public static final int CVM_CONSTANT_Integer = 3;
081: public static final int CVM_CONSTANT_Float = 4;
082: public static final int CVM_CONSTANT_Long = 5;
083: public static final int CVM_CONSTANT_Double = 6;
084: public static final int CVM_CONSTANT_Class = 7;
085: public static final int CVM_CONSTANT_String = 8;
086: public static final int CVM_CONSTANT_Fieldref = 9;
087: public static final int CVM_CONSTANT_Methodref = 10;
088: public static final int CVM_CONSTANT_InterfaceMethodref = 11;
089: public static final int CVM_CONSTANT_NameAndType = 12;
090:
091: /*
092: * These are the unresolved types (already processed into
093: * typeID's, but not into pointers).
094: */
095: public static final int CVM_CONSTANT_ClassTypeID = 13;
096: public static final int CVM_CONSTANT_MethodTypeID = 14;
097: public static final int CVM_CONSTANT_FieldTypeID = 15;
098:
099: /*
100: * These are fully resolved into pointers to the
101: * appropriate data structures. You should always see these
102: * with the CVM_CONSTANT_POOL_ENTRY_RESOLVED bit set.
103: * The scalar numbers, such as Integer, Float, Long, are also
104: * considered as resolved, and should have that bit set.
105: */
106: public static final int CVM_CONSTANT_ClassBlock = 19;
107: public static final int CVM_CONSTANT_FieldBlock = 20;
108: public static final int CVM_CONSTANT_MethodBlock = 21;
109: public static final int CVM_CONSTANT_StringObj = 22; /* ROM string */
110: public static final int CVM_CONSTANT_StringICell = 23; /* classloaded string */
111: public static final int CVM_CONSTANT_Invalid = 24;
112:
113: public static final int CVM_CONSTANT_POOL_ENTRY_RESOLVED = 0x80;
114: public static final int CVM_CONSTANT_POOL_ENTRY_RESOLVING = 0x40;
115: public static final int CVM_CONSTANT_POOL_ENTRY_TYPEMASK = 0x3F;
116:
117: /*
118: * Implementation details we must know to compute
119: * field offsets.
120: * Note that header size is the minimum. Alternative GC's
121: * might require more, so will require a change here!!!!!
122: */
123: public static final int ObjHeaderWords = 2;
124: public static final int BytesPerWord = 4;
125:
126: }
|