001: /*
002: *
003: *
004: * Copyright 1990-2007 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 jcc;
028:
029: public interface EVMConst {
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 EVM_CLASS_ACC_PUBLIC = 0x01; /* visible to everyone */
037: public static final int EVM_CLASS_ACC_FINAL = 0x10; /* no further subclassing */
038: public static final int EVM_CLASS_ACC_SUPER = 0x20; /* funky handling of invokespecial */
039: public static final int EVM_CLASS_ACC_INTERFACE = 0x40; /* class is an interface */
040: public static final int EVM_CLASS_ACC_ABSTRACT = 0x80; /* may not be instantiated */
041:
042: public static final int EVM_FIELD_ACC_PUBLIC = 0x01; /* visible to everyone */
043: public static final int EVM_FIELD_ACC_PRIVATE = 0x02; /* visible only to defining class */
044: public static final int EVM_FIELD_ACC_PROTECTED = 0x04; /* visible to subclasses */
045: public static final int EVM_FIELD_ACC_STATIC = 0x08; /* instance variable is static */
046: public static final int EVM_FIELD_ACC_FINAL = 0x10; /* no subclassing/overriding */
047: public static final int EVM_FIELD_ACC_VOLATILE = 0x40; /* cannot cache in registers */
048: public static final int EVM_FIELD_ACC_TRANSIENT = 0x80; /* not persistant */
049:
050: public static final int EVM_METHOD_ACC_PUBLIC = 0x01; /* visible to everyone */
051: public static final int EVM_METHOD_ACC_PRIVATE = 0x02; /* visible only to defining class */
052: public static final int EVM_METHOD_ACC_PROTECTED = 0x04; /* visible to subclasses */
053: public static final int EVM_METHOD_ACC_STATIC = 0x08; /* method is static */
054: public static final int EVM_METHOD_ACC_FINAL = 0x10; /* no further overriding */
055: public static final int EVM_METHOD_ACC_SYNCHRONIZED = 0x20; /* wrap method call in monitor lock */
056: public static final int EVM_METHOD_ACC_NATIVE = 0x40; /* implemented in C */
057: public static final int EVM_METHOD_ACC_ABSTRACT = 0x80; /* no definition provided */
058:
059: /* EVMConstantPoolType */
060: public static final int EVM_CONSTANT_Utf8 = 1;
061: public static final int EVM_CONSTANT_Unicode = 2;
062: public static final int EVM_CONSTANT_Integer = 3;
063: public static final int EVM_CONSTANT_Float = 4;
064: public static final int EVM_CONSTANT_Long = 5;
065: public static final int EVM_CONSTANT_Double = 6;
066: public static final int EVM_CONSTANT_Class = 7;
067: public static final int EVM_CONSTANT_String = 8;
068: public static final int EVM_CONSTANT_Fieldref = 9;
069: public static final int EVM_CONSTANT_Methodref = 10;
070: public static final int EVM_CONSTANT_InterfaceMethodref = 11;
071: public static final int EVM_CONSTANT_NameAndType = 12;
072:
073: public static final int EVM_CONSTANT_POOL_ENTRY_RESOLVED = 0x80;
074: public static final int EVM_CONSTANT_POOL_ENTRY_RESOLVING = 0x40;
075: public static final int EVM_CONSTANT_POOL_ENTRY_TYPEMASK = 0x3F;
076:
077: /*
078: * Method invoker indices. Stored in EVMMethodArray.invokerIdx field.
079: * Used to determine what code will handle a method's invocation.
080: *
081: * WARNING: The exact order and values of these macros may be important.
082: * [ see javavm/include/classes.h ]
083: */
084: public static final int EVM_INVOKE_JAVA_METHOD = 0;
085: public static final int EVM_INVOKE_JAVA_SYNC_METHOD = 1;
086: public static final int EVM_INVOKE_EVM_METHOD = 2;
087: public static final int EVM_INVOKE_JNI_METHOD = 3;
088: public static final int EVM_INVOKE_JNI_SYNC_METHOD = 4;
089: public static final int EVM_INVOKE_ABSTRACT_METHOD = 5;
090:
091: /*
092: * Implementation details we must know to compute
093: * field offsets.
094: * Note that header size is the minimum. Alternative GC's
095: * might require more, so will require a change here!!!!!
096: */
097: public static final int ObjHeaderWords = 2;
098: public static final int BytesPerWord = 4;
099:
100: }
|