0
|
1 /*
|
|
2 * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 *
|
|
5 * This code is free software; you can redistribute it and/or modify it
|
|
6 * under the terms of the GNU General Public License version 2 only, as
|
|
7 * published by the Free Software Foundation.
|
|
8 *
|
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 * version 2 for more details (a copy is included in the LICENSE file that
|
|
13 * accompanied this code).
|
|
14 *
|
|
15 * You should have received a copy of the GNU General Public License version
|
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 *
|
|
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
20 * CA 95054 USA or visit www.sun.com if you need additional information or
|
|
21 * have any questions.
|
|
22 *
|
|
23 */
|
|
24
|
|
25 package sun.jvm.hotspot.runtime;
|
|
26
|
|
27 public interface ClassConstants
|
|
28 {
|
|
29 // constant pool constant types - from JVM spec.
|
|
30
|
|
31 public static final int JVM_CONSTANT_Utf8 = 1;
|
|
32 public static final int JVM_CONSTANT_Unicode = 2; // unused
|
|
33 public static final int JVM_CONSTANT_Integer = 3;
|
|
34 public static final int JVM_CONSTANT_Float = 4;
|
|
35 public static final int JVM_CONSTANT_Long = 5;
|
|
36 public static final int JVM_CONSTANT_Double = 6;
|
|
37 public static final int JVM_CONSTANT_Class = 7;
|
|
38 public static final int JVM_CONSTANT_String = 8;
|
|
39 public static final int JVM_CONSTANT_Fieldref = 9;
|
|
40 public static final int JVM_CONSTANT_Methodref = 10;
|
|
41 public static final int JVM_CONSTANT_InterfaceMethodref = 11;
|
|
42 public static final int JVM_CONSTANT_NameAndType = 12;
|
|
43
|
|
44 // HotSpot specific constant pool constant types.
|
|
45
|
|
46 // For bad value initialization
|
|
47 public static final int JVM_CONSTANT_Invalid = 0;
|
|
48
|
|
49 // Temporary tag until actual use
|
|
50 public static final int JVM_CONSTANT_UnresolvedClass = 100;
|
|
51
|
|
52 // Temporary tag while constructing constant pool
|
|
53 public static final int JVM_CONSTANT_ClassIndex = 101;
|
|
54
|
|
55 // Temporary tag until actual use
|
|
56 public static final int JVM_CONSTANT_UnresolvedString = 102;
|
|
57
|
|
58 // Temporary tag while constructing constant pool
|
|
59 public static final int JVM_CONSTANT_StringIndex = 103;
|
|
60
|
|
61 // 1.5 major/minor version numbers from JVM spec. 3rd edition
|
|
62 public static final short MAJOR_VERSION = 49;
|
|
63 public static final short MINOR_VERSION = 0;
|
|
64
|
|
65 public static final short MAJOR_VERSION_OLD = 46;
|
|
66 public static final short MINOR_VERSION_OLD = 0;
|
|
67
|
|
68 // From jvm.h
|
|
69 public static final long JVM_ACC_PUBLIC = 0x0001; /* visible to everyone */
|
|
70 public static final long JVM_ACC_PRIVATE = 0x0002; /* visible only to the defining class */
|
|
71 public static final long JVM_ACC_PROTECTED = 0x0004; /* visible to subclasses */
|
|
72 public static final long JVM_ACC_STATIC = 0x0008; /* instance variable is static */
|
|
73 public static final long JVM_ACC_FINAL = 0x0010; /* no further subclassing, overriding */
|
|
74 public static final long JVM_ACC_SYNCHRONIZED = 0x0020; /* wrap method call in monitor lock */
|
|
75 public static final long JVM_ACC_SUPER = 0x0020; /* funky handling of invokespecial */
|
|
76 public static final long JVM_ACC_VOLATILE = 0x0040; /* can not cache in registers */
|
|
77 public static final long JVM_ACC_BRIDGE = 0x0040; /* bridge method generated by compiler */
|
|
78 public static final long JVM_ACC_TRANSIENT = 0x0080; /* not persistant */
|
|
79 public static final long JVM_ACC_VARARGS = 0x0080; /* method declared with variable number of args */
|
|
80 public static final long JVM_ACC_NATIVE = 0x0100; /* implemented in C */
|
|
81 public static final long JVM_ACC_INTERFACE = 0x0200; /* class is an interface */
|
|
82 public static final long JVM_ACC_ABSTRACT = 0x0400; /* no definition provided */
|
|
83 public static final long JVM_ACC_STRICT = 0x0800; /* strict floating point */
|
|
84 public static final long JVM_ACC_SYNTHETIC = 0x1000; /* compiler-generated class, method or field */
|
|
85 public static final long JVM_ACC_ANNOTATION = 0x2000; /* annotation type */
|
|
86 public static final long JVM_ACC_ENUM = 0x4000; /* field is declared as element of enum */
|
|
87
|
|
88
|
|
89 // from accessFlags.hpp - hotspot internal flags
|
|
90
|
|
91 // flags actually put in .class file
|
|
92 public static final long JVM_ACC_WRITTEN_FLAGS = 0x00007FFF;
|
|
93
|
|
94 // methodOop flags
|
|
95 // monitorenter/monitorexit bytecodes match
|
|
96 public static final long JVM_ACC_MONITOR_MATCH = 0x10000000;
|
|
97 // Method contains monitorenter/monitorexit bytecodes
|
|
98 public static final long JVM_ACC_HAS_MONITOR_BYTECODES = 0x20000000;
|
|
99 // Method has loops
|
|
100 public static final long JVM_ACC_HAS_LOOPS = 0x40000000;
|
|
101 // The loop flag has been initialized
|
|
102 public static final long JVM_ACC_LOOPS_FLAG_INIT = (int)0x80000000;
|
|
103 // Queued for compilation
|
|
104 public static final long JVM_ACC_QUEUED = 0x01000000;
|
|
105 // TEMPORARY: currently on stack replacement compilation is not built into the
|
|
106 // invocation counter machinery. Until it is, we will keep track of methods which
|
|
107 // cannot be on stack replaced in the access flags.
|
|
108 public static final long JVM_ACC_NOT_OSR_COMPILABLE = 0x08000000;
|
|
109 public static final long JVM_ACC_HAS_LINE_NUMBER_TABLE = 0x00100000;
|
|
110 public static final long JVM_ACC_HAS_CHECKED_EXCEPTIONS = 0x00400000;
|
|
111 public static final long JVM_ACC_HAS_JSRS = 0x00800000;
|
|
112 // RedefineClasses() has made method obsolete
|
|
113 public static final long JVM_ACC_IS_OBSOLETE = 0x00010000;
|
|
114
|
|
115 // klassOop flags
|
|
116 // True if this class has miranda methods in it's vtable
|
|
117 public static final long JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000;
|
|
118 // True if klass has a vanilla default constructor
|
|
119 public static final long JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000;
|
|
120 // True if klass has a non-empty finalize() method
|
|
121 public static final long JVM_ACC_HAS_FINALIZER = 0x40000000;
|
|
122 // True if klass supports the Clonable interface
|
|
123 public static final long JVM_ACC_IS_CLONEABLE = 0x80000000;
|
|
124
|
|
125 // klassOop and methodOop flags
|
|
126 public static final long JVM_ACC_HAS_LOCAL_VARIABLE_TABLE = 0x00200000;
|
|
127 // flags promoted from methods to the holding klass
|
|
128 public static final long JVM_ACC_PROMOTED_FLAGS = 0x00200000;
|
|
129
|
|
130 // field flags
|
|
131 // Note: these flags must be defined in the low order 16 bits because
|
|
132 // instanceKlass only stores a ushort worth of information from the
|
|
133 // AccessFlags value.
|
|
134 // field access is watched by JVMTI
|
|
135 public static final long JVM_ACC_FIELD_ACCESS_WATCHED = 0x00002000;
|
|
136 // field modification is watched by JVMTI
|
|
137 public static final long JVM_ACC_FIELD_MODIFICATION_WATCHED = 0x00008000;
|
|
138
|
|
139 // flags accepted by set_field_flags
|
|
140 public static final long JVM_ACC_FIELD_FLAGS = 0x00008000 | JVM_ACC_WRITTEN_FLAGS;
|
|
141
|
|
142 // from jvm.h
|
|
143
|
|
144 public static final long JVM_RECOGNIZED_CLASS_MODIFIERS = (JVM_ACC_PUBLIC |
|
705
|
145 JVM_ACC_FINAL |
|
|
146 JVM_ACC_SUPER |
|
|
147 JVM_ACC_INTERFACE |
|
|
148 JVM_ACC_ABSTRACT |
|
|
149 JVM_ACC_ANNOTATION |
|
|
150 JVM_ACC_ENUM |
|
|
151 JVM_ACC_SYNTHETIC);
|
0
|
152
|
|
153
|
|
154 public static final long JVM_RECOGNIZED_FIELD_MODIFIERS = (JVM_ACC_PUBLIC |
|
705
|
155 JVM_ACC_PRIVATE |
|
|
156 JVM_ACC_PROTECTED |
|
|
157 JVM_ACC_STATIC |
|
|
158 JVM_ACC_FINAL |
|
|
159 JVM_ACC_VOLATILE |
|
|
160 JVM_ACC_TRANSIENT |
|
|
161 JVM_ACC_ENUM |
|
|
162 JVM_ACC_SYNTHETIC);
|
0
|
163
|
|
164 public static final long JVM_RECOGNIZED_METHOD_MODIFIERS = (JVM_ACC_PUBLIC |
|
705
|
165 JVM_ACC_PRIVATE |
|
|
166 JVM_ACC_PROTECTED |
|
|
167 JVM_ACC_STATIC |
|
|
168 JVM_ACC_FINAL |
|
|
169 JVM_ACC_SYNCHRONIZED |
|
|
170 JVM_ACC_BRIDGE |
|
|
171 JVM_ACC_VARARGS |
|
|
172 JVM_ACC_NATIVE |
|
|
173 JVM_ACC_ABSTRACT |
|
|
174 JVM_ACC_STRICT |
|
|
175 JVM_ACC_SYNTHETIC);
|
0
|
176 }
|