Path: blob/master/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
41161 views
/*1* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324package sun.jvm.hotspot.runtime;2526public interface ClassConstants27{28// constant pool constant types - from JVM spec.2930public static final int JVM_CONSTANT_Utf8 = 1;31public static final int JVM_CONSTANT_Unicode = 2; // unused32public static final int JVM_CONSTANT_Integer = 3;33public static final int JVM_CONSTANT_Float = 4;34public static final int JVM_CONSTANT_Long = 5;35public static final int JVM_CONSTANT_Double = 6;36public static final int JVM_CONSTANT_Class = 7;37public static final int JVM_CONSTANT_String = 8;38public static final int JVM_CONSTANT_Fieldref = 9;39public static final int JVM_CONSTANT_Methodref = 10;40public static final int JVM_CONSTANT_InterfaceMethodref = 11;41public static final int JVM_CONSTANT_NameAndType = 12;42public static final int JVM_CONSTANT_MethodHandle = 15;43public static final int JVM_CONSTANT_MethodType = 16;44public static final int JVM_CONSTANT_Dynamic = 17;45public static final int JVM_CONSTANT_InvokeDynamic = 18;46public static final int JVM_CONSTANT_Module = 19;47public static final int JVM_CONSTANT_Package = 20;4849// JVM_CONSTANT_MethodHandle subtypes50public static final int JVM_REF_getField = 1;51public static final int JVM_REF_getStatic = 2;52public static final int JVM_REF_putField = 3;53public static final int JVM_REF_putStatic = 4;54public static final int JVM_REF_invokeVirtual = 5;55public static final int JVM_REF_invokeStatic = 6;56public static final int JVM_REF_invokeSpecial = 7;57public static final int JVM_REF_newInvokeSpecial = 8;58public static final int JVM_REF_invokeInterface = 9;5960// HotSpot specific constant pool constant types.6162// For bad value initialization63public static final int JVM_CONSTANT_Invalid = 0;6465public static final int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use66public static final int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool67public static final int JVM_CONSTANT_StringIndex = 102; // Temporary tag while constructing constant pool68public static final int JVM_CONSTANT_UnresolvedClassInError = 103; // Error tag due to resolution error69public static final int JVM_CONSTANT_MethodHandleInError = 104; // Error tag due to resolution error70public static final int JVM_CONSTANT_MethodTypeInError = 105; // Error tag due to resolution error7172// 1.5 major/minor version numbers from JVM spec. 3rd edition73public static final short MAJOR_VERSION = 49;74public static final short MINOR_VERSION = 0;7576public static final short MAJOR_VERSION_OLD = 46;77public static final short MINOR_VERSION_OLD = 0;7879// From jvm.h80public static final long JVM_ACC_PUBLIC = 0x0001; /* visible to everyone */81public static final long JVM_ACC_PRIVATE = 0x0002; /* visible only to the defining class */82public static final long JVM_ACC_PROTECTED = 0x0004; /* visible to subclasses */83public static final long JVM_ACC_STATIC = 0x0008; /* instance variable is static */84public static final long JVM_ACC_FINAL = 0x0010; /* no further subclassing, overriding */85public static final long JVM_ACC_SYNCHRONIZED = 0x0020; /* wrap method call in monitor lock */86public static final long JVM_ACC_SUPER = 0x0020; /* funky handling of invokespecial */87public static final long JVM_ACC_VOLATILE = 0x0040; /* can not cache in registers */88public static final long JVM_ACC_BRIDGE = 0x0040; /* bridge method generated by compiler */89public static final long JVM_ACC_TRANSIENT = 0x0080; /* not persistant */90public static final long JVM_ACC_VARARGS = 0x0080; /* method declared with variable number of args */91public static final long JVM_ACC_NATIVE = 0x0100; /* implemented in C */92public static final long JVM_ACC_INTERFACE = 0x0200; /* class is an interface */93public static final long JVM_ACC_ABSTRACT = 0x0400; /* no definition provided */94public static final long JVM_ACC_STRICT = 0x0800; /* strict floating point */95public static final long JVM_ACC_SYNTHETIC = 0x1000; /* compiler-generated class, method or field */96public static final long JVM_ACC_ANNOTATION = 0x2000; /* annotation type */97public static final long JVM_ACC_ENUM = 0x4000; /* field is declared as element of enum */9899100// from accessFlags.hpp - hotspot internal flags101102// flags actually put in .class file103public static final long JVM_ACC_WRITTEN_FLAGS = 0x00007FFF;104105// Method* flags106// monitorenter/monitorexit bytecodes match107public static final long JVM_ACC_MONITOR_MATCH = 0x10000000;108// Method contains monitorenter/monitorexit bytecodes109public static final long JVM_ACC_HAS_MONITOR_BYTECODES = 0x20000000;110// Method has loops111public static final long JVM_ACC_HAS_LOOPS = 0x40000000;112// The loop flag has been initialized113public static final long JVM_ACC_LOOPS_FLAG_INIT = (int)0x80000000;114// Queued for compilation115public static final long JVM_ACC_QUEUED = 0x01000000;116// TEMPORARY: currently on stack replacement compilation is not built into the117// invocation counter machinery. Until it is, we will keep track of methods which118// cannot be on stack replaced in the access flags.119public static final long JVM_ACC_NOT_OSR_COMPILABLE = 0x08000000;120public static final long JVM_ACC_HAS_LINE_NUMBER_TABLE = 0x00100000;121public static final long JVM_ACC_HAS_CHECKED_EXCEPTIONS = 0x00400000;122public static final long JVM_ACC_HAS_JSRS = 0x00800000;123// RedefineClasses() has made method obsolete124public static final long JVM_ACC_IS_OBSOLETE = 0x00010000;125126// Klass* flags127// True if this class has miranda methods in it's vtable128public static final long JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000;129// True if klass has a vanilla default constructor130public static final long JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000;131// True if klass has a non-empty finalize() method132public static final long JVM_ACC_HAS_FINALIZER = 0x40000000;133// True if klass supports the Clonable interface134public static final long JVM_ACC_IS_CLONEABLE = 0x80000000;135136// Klass* and Method* flags137public static final long JVM_ACC_HAS_LOCAL_VARIABLE_TABLE = 0x00200000;138// flags promoted from methods to the holding klass139public static final long JVM_ACC_PROMOTED_FLAGS = 0x00200000;140141// field flags142// Note: these flags must be defined in the low order 16 bits because143// InstanceKlass only stores a ushort worth of information from the144// AccessFlags value.145// field access is watched by JVMTI146public static final long JVM_ACC_FIELD_ACCESS_WATCHED = 0x00002000;147// field modification is watched by JVMTI148public static final long JVM_ACC_FIELD_MODIFICATION_WATCHED = 0x00008000;149// field has generic signature150public static final long JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE = 0x00000800;151152// flags accepted by set_field_flags153public static final long JVM_ACC_FIELD_FLAGS = 0x00008000 | JVM_ACC_WRITTEN_FLAGS;154155// from jvm.h156157public static final long JVM_RECOGNIZED_CLASS_MODIFIERS = (JVM_ACC_PUBLIC |158JVM_ACC_FINAL |159JVM_ACC_SUPER |160JVM_ACC_INTERFACE |161JVM_ACC_ABSTRACT |162JVM_ACC_ANNOTATION |163JVM_ACC_ENUM |164JVM_ACC_SYNTHETIC);165166167public static final long JVM_RECOGNIZED_FIELD_MODIFIERS = (JVM_ACC_PUBLIC |168JVM_ACC_PRIVATE |169JVM_ACC_PROTECTED |170JVM_ACC_STATIC |171JVM_ACC_FINAL |172JVM_ACC_VOLATILE |173JVM_ACC_TRANSIENT |174JVM_ACC_ENUM |175JVM_ACC_SYNTHETIC);176177public static final long JVM_RECOGNIZED_METHOD_MODIFIERS = (JVM_ACC_PUBLIC |178JVM_ACC_PRIVATE |179JVM_ACC_PROTECTED |180JVM_ACC_STATIC |181JVM_ACC_FINAL |182JVM_ACC_SYNCHRONIZED |183JVM_ACC_BRIDGE |184JVM_ACC_VARARGS |185JVM_ACC_NATIVE |186JVM_ACC_ABSTRACT |187JVM_ACC_STRICT |188JVM_ACC_SYNTHETIC);189}190191192