author | iklam |
Sat, 30 Mar 2019 08:26:20 -0700 | |
changeset 54347 | 235883996bc7 |
parent 54102 | fab8496eb541 |
child 54439 | d9b46b7de028 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53212
bccff579c2ff
8216302: StackTraceElement::fill_in can use cached Class.name
shade
parents:
52781
diff
changeset
|
2 |
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5420
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5420
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5420
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
53212
diff
changeset
|
25 |
#ifndef SHARE_CLASSFILE_JAVACLASSES_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
53212
diff
changeset
|
26 |
#define SHARE_CLASSFILE_JAVACLASSES_HPP |
7397 | 27 |
|
28 |
#include "classfile/systemDictionary.hpp" |
|
29 |
#include "jvmtifiles/jvmti.h" |
|
30 |
#include "oops/oop.hpp" |
|
31 |
#include "runtime/os.hpp" |
|
32 |
||
1 | 33 |
// Interface for manipulating the basic Java classes. |
34 |
// |
|
35 |
// All dependencies on layout of actual Java classes should be kept here. |
|
36 |
// If the layout of any of the classes above changes the offsets must be adjusted. |
|
37 |
// |
|
38 |
// For most classes we hardwire the offsets for performance reasons. In certain |
|
39 |
// cases (e.g. java.security.AccessControlContext) we compute the offsets at |
|
40 |
// startup since the layout here differs between JDK1.2 and JDK1.3. |
|
41 |
// |
|
42 |
// Note that fields (static and non-static) are arranged with oops before non-oops |
|
43 |
// on a per class basis. The offsets below have to reflect this ordering. |
|
44 |
// |
|
45 |
// When editing the layouts please update the check_offset verification code |
|
46 |
// correspondingly. The names in the enums must be identical to the actual field |
|
47 |
// names in order for the verification code to work. |
|
48 |
||
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
49 |
#define BASIC_JAVA_CLASSES_DO_PART1(f) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
50 |
f(java_lang_Class) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
51 |
f(java_lang_String) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
52 |
//end |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
53 |
|
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
54 |
#define BASIC_JAVA_CLASSES_DO_PART2(f) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
55 |
f(java_lang_System) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
56 |
f(java_lang_ClassLoader) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
57 |
f(java_lang_Throwable) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
58 |
f(java_lang_Thread) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
59 |
f(java_lang_ThreadGroup) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
60 |
f(java_lang_AssertionStatusDirectives) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
61 |
f(java_lang_ref_SoftReference) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
62 |
f(java_lang_invoke_MethodHandle) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
63 |
f(java_lang_invoke_DirectMethodHandle) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
64 |
f(java_lang_invoke_MemberName) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
65 |
f(java_lang_invoke_ResolvedMethodName) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
66 |
f(java_lang_invoke_LambdaForm) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
67 |
f(java_lang_invoke_MethodType) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
68 |
f(java_lang_invoke_CallSite) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
69 |
f(java_lang_invoke_MethodHandleNatives_CallSiteContext) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
70 |
f(java_security_AccessControlContext) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
71 |
f(java_lang_reflect_AccessibleObject) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
72 |
f(java_lang_reflect_Method) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
73 |
f(java_lang_reflect_Constructor) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
74 |
f(java_lang_reflect_Field) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
75 |
f(java_nio_Buffer) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
76 |
f(reflect_ConstantPool) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
77 |
f(reflect_UnsafeStaticFieldAccessorImpl) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
78 |
f(java_lang_reflect_Parameter) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
79 |
f(java_lang_Module) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
80 |
f(java_lang_StackTraceElement) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
81 |
f(java_lang_StackFrameInfo) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
82 |
f(java_lang_LiveStackFrameInfo) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
83 |
f(java_util_concurrent_locks_AbstractOwnableSynchronizer) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
84 |
//end |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
85 |
|
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
86 |
#define BASIC_JAVA_CLASSES_DO(f) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
87 |
BASIC_JAVA_CLASSES_DO_PART1(f) \ |
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
88 |
BASIC_JAVA_CLASSES_DO_PART2(f) |
1 | 89 |
|
90 |
// Interface to java.lang.String objects |
|
91 |
||
92 |
class java_lang_String : AllStatic { |
|
93 |
private: |
|
94 |
static int value_offset; |
|
95 |
static int hash_offset; |
|
33628 | 96 |
static int coder_offset; |
1 | 97 |
|
12623 | 98 |
static bool initialized; |
99 |
||
33628 | 100 |
static Handle basic_create(int length, bool byte_arr, TRAPS); |
1 | 101 |
|
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
102 |
static inline void set_coder(oop string, jbyte coder); |
1 | 103 |
|
104 |
public: |
|
33628 | 105 |
|
106 |
// Coders |
|
107 |
enum Coder { |
|
108 |
CODER_LATIN1 = 0, |
|
109 |
CODER_UTF16 = 1 |
|
110 |
}; |
|
111 |
||
12623 | 112 |
static void compute_offsets(); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
113 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
12623 | 114 |
|
1 | 115 |
// Instance creation |
51823 | 116 |
static Handle create_from_unicode(const jchar* unicode, int len, TRAPS); |
117 |
static oop create_oop_from_unicode(const jchar* unicode, int len, TRAPS); |
|
1 | 118 |
static Handle create_from_str(const char* utf8_str, TRAPS); |
119 |
static oop create_oop_from_str(const char* utf8_str, TRAPS); |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7414
diff
changeset
|
120 |
static Handle create_from_symbol(Symbol* symbol, TRAPS); |
1 | 121 |
static Handle create_from_platform_dependent_str(const char* str, TRAPS); |
122 |
static Handle char_converter(Handle java_string, jchar from_char, jchar to_char, TRAPS); |
|
123 |
||
33628 | 124 |
static void set_compact_strings(bool value); |
12623 | 125 |
|
126 |
static int value_offset_in_bytes() { |
|
127 |
assert(initialized && (value_offset > 0), "Must be initialized"); |
|
128 |
return value_offset; |
|
129 |
} |
|
130 |
static int hash_offset_in_bytes() { |
|
131 |
assert(initialized && (hash_offset > 0), "Must be initialized"); |
|
132 |
return hash_offset; |
|
133 |
} |
|
33628 | 134 |
static int coder_offset_in_bytes() { |
135 |
assert(initialized && (coder_offset > 0), "Must be initialized"); |
|
136 |
return coder_offset; |
|
137 |
} |
|
1 | 138 |
|
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
139 |
static inline void set_value_raw(oop string, typeArrayOop buffer); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
140 |
static inline void set_value(oop string, typeArrayOop buffer); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
141 |
static inline void set_hash(oop string, unsigned int hash); |
23472 | 142 |
|
1 | 143 |
// Accessors |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
144 |
static inline typeArrayOop value(oop java_string); |
48618
688e5cbd0b91
8192003: Refactor weak references in StringTable to use the Access API
eosterlund
parents:
47998
diff
changeset
|
145 |
static inline typeArrayOop value_no_keepalive(oop java_string); |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
146 |
static inline unsigned int hash(oop java_string); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
147 |
static inline bool is_latin1(oop java_string); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
148 |
static inline int length(oop java_string); |
53418
bc2bb4eee477
8217442: Optimize native accesses to String.value
redestad
parents:
53274
diff
changeset
|
149 |
static inline int length(oop java_string, typeArrayOop string_value); |
1 | 150 |
static int utf8_length(oop java_string); |
53418
bc2bb4eee477
8217442: Optimize native accesses to String.value
redestad
parents:
53274
diff
changeset
|
151 |
static int utf8_length(oop java_string, typeArrayOop string_value); |
1 | 152 |
|
153 |
// String converters |
|
154 |
static char* as_utf8_string(oop java_string); |
|
7414
940d84ca7fca
6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents:
7397
diff
changeset
|
155 |
static char* as_utf8_string(oop java_string, char* buf, int buflen); |
1 | 156 |
static char* as_utf8_string(oop java_string, int start, int len); |
53418
bc2bb4eee477
8217442: Optimize native accesses to String.value
redestad
parents:
53274
diff
changeset
|
157 |
static char* as_utf8_string(oop java_string, typeArrayOop value, char* buf, int buflen); |
bc2bb4eee477
8217442: Optimize native accesses to String.value
redestad
parents:
53274
diff
changeset
|
158 |
static char* as_utf8_string(oop java_string, typeArrayOop value, int start, int len, char* buf, int buflen); |
195
9193828514c4
6646946: Kernel installation failed on Japanese and Chinese XP SP2 (VM part)
coleenp
parents:
1
diff
changeset
|
159 |
static char* as_platform_dependent_str(Handle java_string, TRAPS); |
17081
cf52c2bc3f8c
8011773: Some tests on Interned String crashed JVM with OOM
hseigel
parents:
17029
diff
changeset
|
160 |
static jchar* as_unicode_string(oop java_string, int& length, TRAPS); |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
161 |
// produce an ascii string with all other values quoted using \u#### |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
162 |
static char* as_quoted_ascii(oop java_string); |
1 | 163 |
|
8885
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
164 |
// Compute the hash value for a java.lang.String object which would |
13087 | 165 |
// contain the characters passed in. |
8885
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
166 |
// |
13087 | 167 |
// As the hash value used by the String object itself, in |
168 |
// String.hashCode(). This value is normally calculated in Java code |
|
169 |
// in the String.hashCode method(), but is precomputed for String |
|
170 |
// objects in the shared archive file. |
|
171 |
// hash P(31) from Kernighan & Ritchie |
|
8885
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
172 |
// |
14742
b2a47eb99404
8004661: Comment and function name java_lang_String::toHash is wrong
brutisso
parents:
14588
diff
changeset
|
173 |
// For this reason, THIS ALGORITHM MUST MATCH String.hashCode(). |
33628 | 174 |
static unsigned int hash_code(const jchar* s, int len) { |
8885
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
175 |
unsigned int h = 0; |
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
176 |
while (len-- > 0) { |
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
177 |
h = 31*h + (unsigned int) *s; |
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
178 |
s++; |
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
179 |
} |
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
180 |
return h; |
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
181 |
} |
33628 | 182 |
|
183 |
static unsigned int hash_code(const jbyte* s, int len) { |
|
184 |
unsigned int h = 0; |
|
185 |
while (len-- > 0) { |
|
186 |
h = 31*h + (((unsigned int) *s) & 0xFF); |
|
187 |
s++; |
|
188 |
} |
|
189 |
return h; |
|
190 |
} |
|
191 |
||
14742
b2a47eb99404
8004661: Comment and function name java_lang_String::toHash is wrong
brutisso
parents:
14588
diff
changeset
|
192 |
static unsigned int hash_code(oop java_string); |
8885
eed0ba1d011b
7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests
never
parents:
8725
diff
changeset
|
193 |
|
51823 | 194 |
static bool equals(oop java_string, const jchar* chars, int len); |
20053
a12bd7991794
8019835: Strings interned in different threads equal but does not ==
dcubed
parents:
19266
diff
changeset
|
195 |
static bool equals(oop str1, oop str2); |
54102
fab8496eb541
8220496: Race in java_lang_String::length() when deduplicating
redestad
parents:
53418
diff
changeset
|
196 |
static inline bool value_equals(typeArrayOop str_value1, typeArrayOop str_value2); |
1 | 197 |
|
198 |
// Conversion between '.' and '/' formats |
|
199 |
static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); } |
|
200 |
static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); } |
|
201 |
||
202 |
// Conversion |
|
46271
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
46257
diff
changeset
|
203 |
static Symbol* as_symbol(oop java_string, TRAPS); |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7414
diff
changeset
|
204 |
static Symbol* as_symbol_or_null(oop java_string); |
1 | 205 |
|
206 |
// Testers |
|
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
207 |
static bool is_instance(oop obj); |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
208 |
static inline bool is_instance_inlined(oop obj); |
1 | 209 |
|
210 |
// Debugging |
|
22907
f978a4a64728
8035648: Don't use Handle in java_lang_String::print
stefank
parents:
20053
diff
changeset
|
211 |
static void print(oop java_string, outputStream* st); |
1 | 212 |
friend class JavaClasses; |
31345
1bba15125d8d
8015086: add interned strings to the shared archive.
jiangli
parents:
31046
diff
changeset
|
213 |
friend class StringTable; |
1 | 214 |
}; |
215 |
||
216 |
||
217 |
// Interface to java.lang.Class objects |
|
218 |
||
10546 | 219 |
#define CLASS_INJECTED_FIELDS(macro) \ |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
220 |
macro(java_lang_Class, klass, intptr_signature, false) \ |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
221 |
macro(java_lang_Class, array_klass, intptr_signature, false) \ |
10546 | 222 |
macro(java_lang_Class, oop_size, int_signature, false) \ |
17826
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
223 |
macro(java_lang_Class, static_oop_field_count, int_signature, false) \ |
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
224 |
macro(java_lang_Class, protection_domain, object_signature, false) \ |
53274
cf80666df79a
8216308: StackTraceElement::fill_in can use injected Class source-file
shade
parents:
53244
diff
changeset
|
225 |
macro(java_lang_Class, signers, object_signature, false) \ |
cf80666df79a
8216308: StackTraceElement::fill_in can use injected Class source-file
shade
parents:
53244
diff
changeset
|
226 |
macro(java_lang_Class, source_file, object_signature, false) \ |
10546 | 227 |
|
1 | 228 |
class java_lang_Class : AllStatic { |
10546 | 229 |
friend class VMStructs; |
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
34317
diff
changeset
|
230 |
friend class JVMCIVMStructs; |
10546 | 231 |
|
1 | 232 |
private: |
233 |
// The fake offsets are added by the class loader when java.lang.Class is loaded |
|
234 |
||
10546 | 235 |
static int _klass_offset; |
236 |
static int _array_klass_offset; |
|
1 | 237 |
|
10546 | 238 |
static int _oop_size_offset; |
239 |
static int _static_oop_field_count_offset; |
|
1 | 240 |
|
17826
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
241 |
static int _protection_domain_offset; |
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
242 |
static int _init_lock_offset; |
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
243 |
static int _signers_offset; |
25326
85b2f2e63e3e
6642881: Improve performance of Class.getClassLoader()
coleenp
parents:
24831
diff
changeset
|
244 |
static int _class_loader_offset; |
36508 | 245 |
static int _module_offset; |
25465
17a6bddcfa5d
8047737: Move array component mirror to instance of java/lang/Class
coleenp
parents:
25326
diff
changeset
|
246 |
static int _component_mirror_offset; |
53212
bccff579c2ff
8216302: StackTraceElement::fill_in can use cached Class.name
shade
parents:
52781
diff
changeset
|
247 |
static int _name_offset; |
53274
cf80666df79a
8216308: StackTraceElement::fill_in can use injected Class source-file
shade
parents:
53244
diff
changeset
|
248 |
static int _source_file_offset; |
17826
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
249 |
|
1 | 250 |
static bool offsets_computed; |
251 |
static int classRedefinedCount_offset; |
|
25326
85b2f2e63e3e
6642881: Improve performance of Class.getClassLoader()
coleenp
parents:
24831
diff
changeset
|
252 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
253 |
static GrowableArray<Klass*>* _fixup_mirror_list; |
36508 | 254 |
static GrowableArray<Klass*>* _fixup_module_field_list; |
1 | 255 |
|
17826
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
256 |
static void set_init_lock(oop java_class, oop init_lock); |
18690
e3a2db7d95b0
8014399: Remove JVM_SetProtectionDomain from hotspot
hseigel
parents:
18065
diff
changeset
|
257 |
static void set_protection_domain(oop java_class, oop protection_domain); |
25326
85b2f2e63e3e
6642881: Improve performance of Class.getClassLoader()
coleenp
parents:
24831
diff
changeset
|
258 |
static void set_class_loader(oop java_class, oop class_loader); |
25465
17a6bddcfa5d
8047737: Move array component mirror to instance of java/lang/Class
coleenp
parents:
25326
diff
changeset
|
259 |
static void set_component_mirror(oop java_class, oop comp_mirror); |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
260 |
static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain, TRAPS); |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
261 |
static void set_mirror_module_field(Klass* K, Handle mirror, Handle module, TRAPS); |
1 | 262 |
public: |
46772
902c68ab7f57
8185103: TestThreadDumpMonitorContention.java crashed due to SIGSEGV in G1SATBCardTableModRefBS::write_ref_field_pre_work
hseigel
parents:
46722
diff
changeset
|
263 |
static void allocate_fixup_lists(); |
10546 | 264 |
static void compute_offsets(); |
265 |
||
1 | 266 |
// Instance creation |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
267 |
static void create_mirror(Klass* k, Handle class_loader, Handle module, |
25326
85b2f2e63e3e
6642881: Improve performance of Class.getClassLoader()
coleenp
parents:
24831
diff
changeset
|
268 |
Handle protection_domain, TRAPS); |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
269 |
static void fixup_mirror(Klass* k, TRAPS); |
1 | 270 |
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS); |
36508 | 271 |
|
49329 | 272 |
// Archiving |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
273 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 274 |
static void archive_basic_type_mirrors(TRAPS) NOT_CDS_JAVA_HEAP_RETURN; |
275 |
static oop archive_mirror(Klass* k, TRAPS) NOT_CDS_JAVA_HEAP_RETURN_(NULL); |
|
276 |
static oop process_archived_mirror(Klass* k, oop mirror, oop archived_mirror, Thread *THREAD) |
|
277 |
NOT_CDS_JAVA_HEAP_RETURN_(NULL); |
|
50532 | 278 |
static bool restore_archived_mirror(Klass *k, Handle class_loader, Handle module, |
279 |
Handle protection_domain, |
|
280 |
TRAPS) NOT_CDS_JAVA_HEAP_RETURN_(false); |
|
49329 | 281 |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
282 |
static void fixup_module_field(Klass* k, Handle module); |
36508 | 283 |
|
1 | 284 |
// Conversion |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
285 |
static Klass* as_Klass(oop java_class); |
51516
7c3891b9f1e0
8206457: Code paths from oop_iterate() must use barrier-free access
rkennke
parents:
51429
diff
changeset
|
286 |
static Klass* as_Klass_raw(oop java_class); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
287 |
static void set_klass(oop java_class, Klass* klass); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
288 |
static BasicType as_BasicType(oop java_class, Klass** reference_klass = NULL); |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7414
diff
changeset
|
289 |
static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS); |
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2105
diff
changeset
|
290 |
static void print_signature(oop java_class, outputStream *st); |
31970
4bb8e8a13f6a
8048353: jstack -l crashes VM when a Java mirror for a primitive type is locked
vkempik
parents:
31345
diff
changeset
|
291 |
static const char* as_external_name(oop java_class); |
1 | 292 |
// Testing |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
293 |
static bool is_instance(oop obj); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
294 |
|
1 | 295 |
static bool is_primitive(oop java_class); |
296 |
static BasicType primitive_type(oop java_class); |
|
297 |
static oop primitive_mirror(BasicType t); |
|
298 |
// JVM_NewArray support |
|
46722
ae2cfffe2e64
8185296: java_lang_Class::array_klass should be array_klass_acquire
coleenp
parents:
46710
diff
changeset
|
299 |
static Klass* array_klass_acquire(oop java_class); |
46710
941f16147746
8182397: Race in field updates when creating ArrayKlasses can lead to crash
coleenp
parents:
46505
diff
changeset
|
300 |
static void release_set_array_klass(oop java_class, Klass* klass); |
1 | 301 |
// compiler support for class operations |
10546 | 302 |
static int klass_offset_in_bytes() { return _klass_offset; } |
303 |
static int array_klass_offset_in_bytes() { return _array_klass_offset; } |
|
1 | 304 |
// Support for classRedefinedCount field |
305 |
static int classRedefinedCount(oop the_class_mirror); |
|
306 |
static void set_classRedefinedCount(oop the_class_mirror, int value); |
|
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8676
diff
changeset
|
307 |
|
17826
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
308 |
// Support for embedded per-class oops |
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
309 |
static oop protection_domain(oop java_class); |
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
310 |
static oop init_lock(oop java_class); |
25465
17a6bddcfa5d
8047737: Move array component mirror to instance of java/lang/Class
coleenp
parents:
25326
diff
changeset
|
311 |
static oop component_mirror(oop java_class); |
17826
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
312 |
static objArrayOop signers(oop java_class); |
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
313 |
static void set_signers(oop java_class, objArrayOop signers); |
9ad5cd464a75
8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents:
17081
diff
changeset
|
314 |
|
25326
85b2f2e63e3e
6642881: Improve performance of Class.getClassLoader()
coleenp
parents:
24831
diff
changeset
|
315 |
static oop class_loader(oop java_class); |
36508 | 316 |
static void set_module(oop java_class, oop module); |
317 |
static oop module(oop java_class); |
|
25326
85b2f2e63e3e
6642881: Improve performance of Class.getClassLoader()
coleenp
parents:
24831
diff
changeset
|
318 |
|
53212
bccff579c2ff
8216302: StackTraceElement::fill_in can use cached Class.name
shade
parents:
52781
diff
changeset
|
319 |
static oop name(Handle java_class, TRAPS); |
bccff579c2ff
8216302: StackTraceElement::fill_in can use cached Class.name
shade
parents:
52781
diff
changeset
|
320 |
|
53274
cf80666df79a
8216308: StackTraceElement::fill_in can use injected Class source-file
shade
parents:
53244
diff
changeset
|
321 |
static oop source_file(oop java_class); |
cf80666df79a
8216308: StackTraceElement::fill_in can use injected Class source-file
shade
parents:
53244
diff
changeset
|
322 |
static void set_source_file(oop java_class, oop source_file); |
cf80666df79a
8216308: StackTraceElement::fill_in can use injected Class source-file
shade
parents:
53244
diff
changeset
|
323 |
|
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8676
diff
changeset
|
324 |
static int oop_size(oop java_class); |
51516
7c3891b9f1e0
8206457: Code paths from oop_iterate() must use barrier-free access
rkennke
parents:
51429
diff
changeset
|
325 |
static int oop_size_raw(oop java_class); |
50882
80abf702eed8
8205683: Refactor heap allocation to separate concerns
eosterlund
parents:
50819
diff
changeset
|
326 |
static void set_oop_size(HeapWord* java_class, int size); |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8676
diff
changeset
|
327 |
static int static_oop_field_count(oop java_class); |
51516
7c3891b9f1e0
8206457: Code paths from oop_iterate() must use barrier-free access
rkennke
parents:
51429
diff
changeset
|
328 |
static int static_oop_field_count_raw(oop java_class); |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8676
diff
changeset
|
329 |
static void set_static_oop_field_count(oop java_class, int size); |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8676
diff
changeset
|
330 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
331 |
static GrowableArray<Klass*>* fixup_mirror_list() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
332 |
return _fixup_mirror_list; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
333 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
334 |
static void set_fixup_mirror_list(GrowableArray<Klass*>* v) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
335 |
_fixup_mirror_list = v; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
336 |
} |
36508 | 337 |
|
338 |
static GrowableArray<Klass*>* fixup_module_field_list() { |
|
339 |
return _fixup_module_field_list; |
|
340 |
} |
|
341 |
static void set_fixup_module_field_list(GrowableArray<Klass*>* v) { |
|
342 |
_fixup_module_field_list = v; |
|
343 |
} |
|
344 |
||
1 | 345 |
// Debugging |
346 |
friend class JavaClasses; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
347 |
friend class InstanceKlass; // verification code accesses offsets |
1 | 348 |
friend class ClassFileParser; // access to number_of_fake_fields |
349 |
}; |
|
350 |
||
351 |
// Interface to java.lang.Thread objects |
|
352 |
||
353 |
class java_lang_Thread : AllStatic { |
|
354 |
private: |
|
355 |
// Note that for this class the layout changed between JDK1.2 and JDK1.3, |
|
356 |
// so we compute the offsets at startup rather than hard-wiring them. |
|
357 |
static int _name_offset; |
|
358 |
static int _group_offset; |
|
359 |
static int _contextClassLoader_offset; |
|
360 |
static int _inheritedAccessControlContext_offset; |
|
361 |
static int _priority_offset; |
|
362 |
static int _eetop_offset; |
|
363 |
static int _daemon_offset; |
|
364 |
static int _stillborn_offset; |
|
365 |
static int _stackSize_offset; |
|
366 |
static int _tid_offset; |
|
367 |
static int _thread_status_offset; |
|
368 |
static int _park_blocker_offset; |
|
369 |
static int _park_event_offset ; |
|
370 |
||
371 |
static void compute_offsets(); |
|
372 |
||
373 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
374 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 375 |
|
1 | 376 |
// Instance creation |
377 |
static oop create(); |
|
378 |
// Returns the JavaThread associated with the thread obj |
|
379 |
static JavaThread* thread(oop java_thread); |
|
380 |
// Set JavaThread for instance |
|
381 |
static void set_thread(oop java_thread, JavaThread* thread); |
|
382 |
// Name |
|
27654 | 383 |
static oop name(oop java_thread); |
384 |
static void set_name(oop java_thread, oop name); |
|
1 | 385 |
// Priority |
386 |
static ThreadPriority priority(oop java_thread); |
|
387 |
static void set_priority(oop java_thread, ThreadPriority priority); |
|
388 |
// Thread group |
|
389 |
static oop threadGroup(oop java_thread); |
|
390 |
// Stillborn |
|
391 |
static bool is_stillborn(oop java_thread); |
|
392 |
static void set_stillborn(oop java_thread); |
|
393 |
// Alive (NOTE: this is not really a field, but provides the correct |
|
394 |
// definition without doing a Java call) |
|
395 |
static bool is_alive(oop java_thread); |
|
396 |
// Daemon |
|
397 |
static bool is_daemon(oop java_thread); |
|
398 |
static void set_daemon(oop java_thread); |
|
399 |
// Context ClassLoader |
|
400 |
static oop context_class_loader(oop java_thread); |
|
401 |
// Control context |
|
402 |
static oop inherited_access_control_context(oop java_thread); |
|
403 |
// Stack size hint |
|
404 |
static jlong stackSize(oop java_thread); |
|
405 |
// Thread ID |
|
406 |
static jlong thread_id(oop java_thread); |
|
407 |
||
408 |
// Blocker object responsible for thread parking |
|
409 |
static oop park_blocker(oop java_thread); |
|
410 |
||
411 |
// Pointer to type-stable park handler, encoded as jlong. |
|
412 |
// Should be set when apparently null |
|
413 |
// For details, see unsafe.cpp Unsafe_Unpark |
|
414 |
static jlong park_event(oop java_thread); |
|
415 |
static bool set_park_event(oop java_thread, jlong ptr); |
|
416 |
||
417 |
// Java Thread Status for JVMTI and M&M use. |
|
418 |
// This thread status info is saved in threadStatus field of |
|
419 |
// java.lang.Thread java class. |
|
420 |
enum ThreadStatus { |
|
421 |
NEW = 0, |
|
422 |
RUNNABLE = JVMTI_THREAD_STATE_ALIVE + // runnable / running |
|
423 |
JVMTI_THREAD_STATE_RUNNABLE, |
|
424 |
SLEEPING = JVMTI_THREAD_STATE_ALIVE + // Thread.sleep() |
|
425 |
JVMTI_THREAD_STATE_WAITING + |
|
426 |
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT + |
|
427 |
JVMTI_THREAD_STATE_SLEEPING, |
|
428 |
IN_OBJECT_WAIT = JVMTI_THREAD_STATE_ALIVE + // Object.wait() |
|
429 |
JVMTI_THREAD_STATE_WAITING + |
|
430 |
JVMTI_THREAD_STATE_WAITING_INDEFINITELY + |
|
431 |
JVMTI_THREAD_STATE_IN_OBJECT_WAIT, |
|
432 |
IN_OBJECT_WAIT_TIMED = JVMTI_THREAD_STATE_ALIVE + // Object.wait(long) |
|
433 |
JVMTI_THREAD_STATE_WAITING + |
|
434 |
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT + |
|
435 |
JVMTI_THREAD_STATE_IN_OBJECT_WAIT, |
|
436 |
PARKED = JVMTI_THREAD_STATE_ALIVE + // LockSupport.park() |
|
437 |
JVMTI_THREAD_STATE_WAITING + |
|
438 |
JVMTI_THREAD_STATE_WAITING_INDEFINITELY + |
|
439 |
JVMTI_THREAD_STATE_PARKED, |
|
440 |
PARKED_TIMED = JVMTI_THREAD_STATE_ALIVE + // LockSupport.park(long) |
|
441 |
JVMTI_THREAD_STATE_WAITING + |
|
442 |
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT + |
|
443 |
JVMTI_THREAD_STATE_PARKED, |
|
444 |
BLOCKED_ON_MONITOR_ENTER = JVMTI_THREAD_STATE_ALIVE + // (re-)entering a synchronization block |
|
445 |
JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER, |
|
446 |
TERMINATED = JVMTI_THREAD_STATE_TERMINATED |
|
447 |
}; |
|
448 |
// Write thread status info to threadStatus field of java.lang.Thread. |
|
449 |
static void set_thread_status(oop java_thread_oop, ThreadStatus status); |
|
450 |
// Read thread status info from threadStatus field of java.lang.Thread. |
|
451 |
static ThreadStatus get_thread_status(oop java_thread_oop); |
|
452 |
||
453 |
static const char* thread_status_name(oop java_thread_oop); |
|
454 |
||
455 |
// Debugging |
|
456 |
friend class JavaClasses; |
|
457 |
}; |
|
458 |
||
459 |
// Interface to java.lang.ThreadGroup objects |
|
460 |
||
461 |
class java_lang_ThreadGroup : AllStatic { |
|
462 |
private: |
|
463 |
static int _parent_offset; |
|
464 |
static int _name_offset; |
|
465 |
static int _threads_offset; |
|
466 |
static int _groups_offset; |
|
467 |
static int _maxPriority_offset; |
|
468 |
static int _destroyed_offset; |
|
469 |
static int _daemon_offset; |
|
470 |
static int _nthreads_offset; |
|
471 |
static int _ngroups_offset; |
|
472 |
||
473 |
static void compute_offsets(); |
|
474 |
||
475 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
476 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 477 |
|
1 | 478 |
// parent ThreadGroup |
479 |
static oop parent(oop java_thread_group); |
|
480 |
// name |
|
33628 | 481 |
static const char* name(oop java_thread_group); |
1 | 482 |
// ("name as oop" accessor is not necessary) |
483 |
// Number of threads in group |
|
484 |
static int nthreads(oop java_thread_group); |
|
485 |
// threads |
|
486 |
static objArrayOop threads(oop java_thread_group); |
|
487 |
// Number of threads in group |
|
488 |
static int ngroups(oop java_thread_group); |
|
489 |
// groups |
|
490 |
static objArrayOop groups(oop java_thread_group); |
|
491 |
// maxPriority in group |
|
492 |
static ThreadPriority maxPriority(oop java_thread_group); |
|
493 |
// Destroyed |
|
494 |
static bool is_destroyed(oop java_thread_group); |
|
495 |
// Daemon |
|
496 |
static bool is_daemon(oop java_thread_group); |
|
497 |
// Debugging |
|
498 |
friend class JavaClasses; |
|
499 |
}; |
|
500 |
||
501 |
||
502 |
||
503 |
// Interface to java.lang.Throwable objects |
|
504 |
||
505 |
class java_lang_Throwable: AllStatic { |
|
506 |
friend class BacktraceBuilder; |
|
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
507 |
friend class BacktraceIterator; |
1 | 508 |
|
509 |
private: |
|
510 |
// Offsets |
|
511 |
enum { |
|
512 |
hc_backtrace_offset = 0, |
|
513 |
hc_detailMessage_offset = 1, |
|
514 |
hc_cause_offset = 2, // New since 1.4 |
|
515 |
hc_stackTrace_offset = 3 // New since 1.4 |
|
516 |
}; |
|
517 |
// Trace constants |
|
518 |
enum { |
|
519 |
trace_methods_offset = 0, |
|
520 |
trace_bcis_offset = 1, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
521 |
trace_mirrors_offset = 2, |
46257
3e95288ce4ca
8140685: Fix backtrace building to not rely on constant pool merging
coleenp
parents:
42627
diff
changeset
|
522 |
trace_names_offset = 3, |
30107
e3d259b825a1
8067662: "java.lang.NullPointerException: Method name is null" from StackTraceElement.<init>
sspitsyn
parents:
29081
diff
changeset
|
523 |
trace_next_offset = 4, |
e3d259b825a1
8067662: "java.lang.NullPointerException: Method name is null" from StackTraceElement.<init>
sspitsyn
parents:
29081
diff
changeset
|
524 |
trace_size = 5, |
1 | 525 |
trace_chunk_size = 32 |
526 |
}; |
|
527 |
||
528 |
static int backtrace_offset; |
|
529 |
static int detailMessage_offset; |
|
530 |
static int stackTrace_offset; |
|
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
531 |
static int depth_offset; |
10233
b40fd2bd2fac
7046490: Preallocated OOME objects should obey Throwable stack trace protocol
dholmes
parents:
10008
diff
changeset
|
532 |
static int static_unassigned_stacktrace_offset; |
1 | 533 |
|
534 |
// StackTrace (programmatic access, new since 1.4) |
|
535 |
static void clear_stacktrace(oop throwable); |
|
10233
b40fd2bd2fac
7046490: Preallocated OOME objects should obey Throwable stack trace protocol
dholmes
parents:
10008
diff
changeset
|
536 |
// Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed) |
b40fd2bd2fac
7046490: Preallocated OOME objects should obey Throwable stack trace protocol
dholmes
parents:
10008
diff
changeset
|
537 |
static void set_stacktrace(oop throwable, oop st_element_array); |
b40fd2bd2fac
7046490: Preallocated OOME objects should obey Throwable stack trace protocol
dholmes
parents:
10008
diff
changeset
|
538 |
static oop unassigned_stacktrace(); |
1 | 539 |
|
540 |
public: |
|
541 |
// Backtrace |
|
542 |
static oop backtrace(oop throwable); |
|
543 |
static void set_backtrace(oop throwable, oop value); |
|
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
544 |
static int depth(oop throwable); |
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
545 |
static void set_depth(oop throwable, int value); |
1 | 546 |
// Needed by JVMTI to filter out this internal field. |
547 |
static int get_backtrace_offset() { return backtrace_offset;} |
|
548 |
static int get_detailMessage_offset() { return detailMessage_offset;} |
|
549 |
// Message |
|
46271
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
46257
diff
changeset
|
550 |
static oop message(oop throwable); |
1 | 551 |
static void set_message(oop throwable, oop value); |
25624
b3bd733f04e9
8048933: -XX:+TraceExceptions output should include the message
coleenp
parents:
25465
diff
changeset
|
552 |
static Symbol* detail_message(oop throwable); |
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
553 |
static void print_stack_element(outputStream *st, const methodHandle& method, int bci); |
1 | 554 |
static void print_stack_usage(Handle stream); |
555 |
||
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
556 |
static void compute_offsets(); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
557 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
558 |
|
1 | 559 |
// Allocate space for backtrace (created but stack trace not filled in) |
560 |
static void allocate_backtrace(Handle throwable, TRAPS); |
|
561 |
// Fill in current stack trace for throwable with preallocated backtrace (no GC) |
|
562 |
static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable); |
|
563 |
// Fill in current stack trace, can cause GC |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
564 |
static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS); |
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
565 |
static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle()); |
1 | 566 |
// Programmatic access to stack trace |
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
567 |
static void get_stack_trace_elements(Handle throwable, objArrayHandle stack_trace, TRAPS); |
1 | 568 |
// Printing |
46271
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
46257
diff
changeset
|
569 |
static void print(oop throwable, outputStream* st); |
35143
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
35123
diff
changeset
|
570 |
static void print_stack_trace(Handle throwable, outputStream* st); |
35557
029dcb9bfa8b
8146246: JVMCICompiler::abort_on_pending_exception: assert(!thread->owns_locks()) failed: must release all locks when leaving VM
twisti
parents:
35143
diff
changeset
|
571 |
static void java_printStackTrace(Handle throwable, TRAPS); |
1 | 572 |
// Debugging |
573 |
friend class JavaClasses; |
|
574 |
}; |
|
575 |
||
576 |
||
577 |
// Interface to java.lang.reflect.AccessibleObject objects |
|
578 |
||
579 |
class java_lang_reflect_AccessibleObject: AllStatic { |
|
580 |
private: |
|
581 |
// Note that to reduce dependencies on the JDK we compute these |
|
582 |
// offsets at run-time. |
|
583 |
static int override_offset; |
|
584 |
||
585 |
static void compute_offsets(); |
|
586 |
||
587 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
588 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 589 |
|
1 | 590 |
// Accessors |
591 |
static jboolean override(oop reflect); |
|
592 |
static void set_override(oop reflect, jboolean value); |
|
593 |
||
594 |
// Debugging |
|
595 |
friend class JavaClasses; |
|
596 |
}; |
|
597 |
||
598 |
||
599 |
// Interface to java.lang.reflect.Method objects |
|
600 |
||
601 |
class java_lang_reflect_Method : public java_lang_reflect_AccessibleObject { |
|
602 |
private: |
|
603 |
// Note that to reduce dependencies on the JDK we compute these |
|
604 |
// offsets at run-time. |
|
605 |
static int clazz_offset; |
|
606 |
static int name_offset; |
|
607 |
static int returnType_offset; |
|
608 |
static int parameterTypes_offset; |
|
609 |
static int exceptionTypes_offset; |
|
610 |
static int slot_offset; |
|
611 |
static int modifiers_offset; |
|
612 |
static int signature_offset; |
|
613 |
static int annotations_offset; |
|
614 |
static int parameter_annotations_offset; |
|
615 |
static int annotation_default_offset; |
|
616 |
||
617 |
static void compute_offsets(); |
|
618 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
619 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 620 |
|
1 | 621 |
// Allocation |
622 |
static Handle create(TRAPS); |
|
623 |
||
624 |
// Accessors |
|
625 |
static oop clazz(oop reflect); |
|
626 |
static void set_clazz(oop reflect, oop value); |
|
627 |
||
628 |
static void set_name(oop method, oop value); |
|
629 |
||
630 |
static oop return_type(oop method); |
|
631 |
static void set_return_type(oop method, oop value); |
|
632 |
||
633 |
static oop parameter_types(oop method); |
|
634 |
static void set_parameter_types(oop method, oop value); |
|
635 |
||
636 |
static int slot(oop reflect); |
|
637 |
static void set_slot(oop reflect, int value); |
|
638 |
||
51807 | 639 |
static void set_exception_types(oop method, oop value); |
1 | 640 |
static void set_modifiers(oop method, int value); |
641 |
static void set_signature(oop method, oop value); |
|
642 |
static void set_annotations(oop method, oop value); |
|
643 |
static void set_parameter_annotations(oop method, oop value); |
|
644 |
static void set_annotation_default(oop method, oop value); |
|
645 |
||
646 |
// Debugging |
|
647 |
friend class JavaClasses; |
|
648 |
}; |
|
649 |
||
650 |
||
651 |
// Interface to java.lang.reflect.Constructor objects |
|
652 |
||
653 |
class java_lang_reflect_Constructor : public java_lang_reflect_AccessibleObject { |
|
654 |
private: |
|
655 |
// Note that to reduce dependencies on the JDK we compute these |
|
656 |
// offsets at run-time. |
|
657 |
static int clazz_offset; |
|
658 |
static int parameterTypes_offset; |
|
659 |
static int exceptionTypes_offset; |
|
660 |
static int slot_offset; |
|
661 |
static int modifiers_offset; |
|
662 |
static int signature_offset; |
|
663 |
static int annotations_offset; |
|
664 |
static int parameter_annotations_offset; |
|
665 |
||
666 |
static void compute_offsets(); |
|
667 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
668 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 669 |
|
1 | 670 |
// Allocation |
671 |
static Handle create(TRAPS); |
|
672 |
||
673 |
// Accessors |
|
674 |
static oop clazz(oop reflect); |
|
675 |
static void set_clazz(oop reflect, oop value); |
|
676 |
||
677 |
static oop parameter_types(oop constructor); |
|
678 |
static void set_parameter_types(oop constructor, oop value); |
|
679 |
||
680 |
static int slot(oop reflect); |
|
681 |
static void set_slot(oop reflect, int value); |
|
682 |
||
51807 | 683 |
static void set_exception_types(oop constructor, oop value); |
1 | 684 |
static void set_modifiers(oop constructor, int value); |
685 |
static void set_signature(oop constructor, oop value); |
|
686 |
static void set_annotations(oop constructor, oop value); |
|
687 |
static void set_parameter_annotations(oop method, oop value); |
|
688 |
||
689 |
// Debugging |
|
690 |
friend class JavaClasses; |
|
691 |
}; |
|
692 |
||
693 |
||
694 |
// Interface to java.lang.reflect.Field objects |
|
695 |
||
696 |
class java_lang_reflect_Field : public java_lang_reflect_AccessibleObject { |
|
697 |
private: |
|
698 |
// Note that to reduce dependencies on the JDK we compute these |
|
699 |
// offsets at run-time. |
|
700 |
static int clazz_offset; |
|
701 |
static int name_offset; |
|
702 |
static int type_offset; |
|
703 |
static int slot_offset; |
|
704 |
static int modifiers_offset; |
|
705 |
static int signature_offset; |
|
706 |
static int annotations_offset; |
|
707 |
||
708 |
static void compute_offsets(); |
|
709 |
||
710 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
711 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 712 |
|
1 | 713 |
// Allocation |
714 |
static Handle create(TRAPS); |
|
715 |
||
716 |
// Accessors |
|
717 |
static oop clazz(oop reflect); |
|
718 |
static void set_clazz(oop reflect, oop value); |
|
719 |
||
720 |
static oop name(oop field); |
|
721 |
static void set_name(oop field, oop value); |
|
722 |
||
723 |
static oop type(oop field); |
|
724 |
static void set_type(oop field, oop value); |
|
725 |
||
726 |
static int slot(oop reflect); |
|
727 |
static void set_slot(oop reflect, int value); |
|
728 |
||
729 |
static int modifiers(oop field); |
|
730 |
static void set_modifiers(oop field, int value); |
|
731 |
||
732 |
static void set_signature(oop constructor, oop value); |
|
733 |
static void set_annotations(oop constructor, oop value); |
|
734 |
static void set_parameter_annotations(oop method, oop value); |
|
735 |
static void set_annotation_default(oop method, oop value); |
|
736 |
||
737 |
// Debugging |
|
738 |
friend class JavaClasses; |
|
739 |
}; |
|
740 |
||
15102
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
741 |
class java_lang_reflect_Parameter { |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
742 |
private: |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
743 |
// Note that to reduce dependencies on the JDK we compute these |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
744 |
// offsets at run-time. |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
745 |
static int name_offset; |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
746 |
static int modifiers_offset; |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
747 |
static int index_offset; |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
748 |
static int executable_offset; |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
749 |
|
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
750 |
static void compute_offsets(); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
751 |
|
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
752 |
public: |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
753 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 754 |
|
15102
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
755 |
// Allocation |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
756 |
static Handle create(TRAPS); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
757 |
|
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
758 |
// Accessors |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
759 |
static oop name(oop field); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
760 |
static void set_name(oop field, oop value); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
761 |
|
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
762 |
static int index(oop reflect); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
763 |
static void set_index(oop reflect, int value); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
764 |
|
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
765 |
static int modifiers(oop reflect); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
766 |
static void set_modifiers(oop reflect, int value); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
767 |
|
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
768 |
static oop executable(oop constructor); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
769 |
static void set_executable(oop constructor, oop value); |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
770 |
|
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
771 |
friend class JavaClasses; |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
772 |
}; |
0a86564e5f61
8004728: Add hotspot support for parameter reflection
coleenp
parents:
15098
diff
changeset
|
773 |
|
36508 | 774 |
#define MODULE_INJECTED_FIELDS(macro) \ |
44520
0553e129e0ec
8177530: Module system implementation refresh (4/2017)
alanb
parents:
43929
diff
changeset
|
775 |
macro(java_lang_Module, module_entry, intptr_signature, false) |
36508 | 776 |
|
44520
0553e129e0ec
8177530: Module system implementation refresh (4/2017)
alanb
parents:
43929
diff
changeset
|
777 |
class java_lang_Module { |
36508 | 778 |
private: |
779 |
static int loader_offset; |
|
780 |
static int name_offset; |
|
781 |
static int _module_entry_offset; |
|
782 |
static void compute_offsets(); |
|
783 |
||
784 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
785 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 786 |
|
36508 | 787 |
// Allocation |
788 |
static Handle create(Handle loader, Handle module_name, TRAPS); |
|
789 |
||
790 |
// Testers |
|
791 |
static bool is_instance(oop obj); |
|
792 |
||
793 |
// Accessors |
|
794 |
static oop loader(oop module); |
|
795 |
static void set_loader(oop module, oop value); |
|
796 |
||
797 |
static oop name(oop module); |
|
798 |
static void set_name(oop module, oop value); |
|
799 |
||
49348
fde3feaaa4ed
8198926: Move ClassLoaderData::_dependencies to ClassLoaderData::_handles
coleenp
parents:
49329
diff
changeset
|
800 |
static ModuleEntry* module_entry(oop module); |
36508 | 801 |
static void set_module_entry(oop module, ModuleEntry* module_entry); |
802 |
||
803 |
friend class JavaClasses; |
|
804 |
}; |
|
805 |
||
37301
a936b4e01afb
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
37179
diff
changeset
|
806 |
// Interface to jdk.internal.reflect.ConstantPool objects |
a936b4e01afb
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
37179
diff
changeset
|
807 |
class reflect_ConstantPool { |
1 | 808 |
private: |
809 |
// Note that to reduce dependencies on the JDK we compute these |
|
810 |
// offsets at run-time. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
811 |
static int _oop_offset; |
1 | 812 |
|
813 |
static void compute_offsets(); |
|
814 |
||
815 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
816 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 817 |
|
1 | 818 |
// Allocation |
819 |
static Handle create(TRAPS); |
|
820 |
||
821 |
// Accessors |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
822 |
static void set_cp(oop reflect, ConstantPool* value); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
823 |
static int oop_offset() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
824 |
return _oop_offset; |
1 | 825 |
} |
826 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
827 |
static ConstantPool* get_cp(oop reflect); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
828 |
|
1 | 829 |
// Debugging |
830 |
friend class JavaClasses; |
|
831 |
}; |
|
832 |
||
37301
a936b4e01afb
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
37179
diff
changeset
|
833 |
// Interface to jdk.internal.reflect.UnsafeStaticFieldAccessorImpl objects |
a936b4e01afb
8137058: Clear out all non-Critical APIs from sun.reflect
chegar
parents:
37179
diff
changeset
|
834 |
class reflect_UnsafeStaticFieldAccessorImpl { |
1 | 835 |
private: |
836 |
static int _base_offset; |
|
837 |
static void compute_offsets(); |
|
838 |
||
839 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
840 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 841 |
|
1 | 842 |
static int base_offset() { |
843 |
return _base_offset; |
|
844 |
} |
|
845 |
||
846 |
// Debugging |
|
847 |
friend class JavaClasses; |
|
848 |
}; |
|
849 |
||
850 |
// Interface to java.lang primitive type boxing objects: |
|
851 |
// - java.lang.Boolean |
|
852 |
// - java.lang.Character |
|
853 |
// - java.lang.Float |
|
854 |
// - java.lang.Double |
|
855 |
// - java.lang.Byte |
|
856 |
// - java.lang.Short |
|
857 |
// - java.lang.Integer |
|
858 |
// - java.lang.Long |
|
859 |
||
860 |
// This could be separated out into 8 individual classes. |
|
861 |
||
862 |
class java_lang_boxing_object: AllStatic { |
|
863 |
private: |
|
864 |
enum { |
|
865 |
hc_value_offset = 0 |
|
866 |
}; |
|
867 |
static int value_offset; |
|
591
04d2e26e6d69
6703888: Compressed Oops: use the 32-bits gap after klass in a object
kvn
parents:
379
diff
changeset
|
868 |
static int long_value_offset; |
1 | 869 |
|
379
10767ca40189
6652736: well known classes in system dictionary are inefficiently processed
jrose
parents:
360
diff
changeset
|
870 |
static oop initialize_and_allocate(BasicType type, TRAPS); |
1 | 871 |
public: |
872 |
// Allocation. Returns a boxed value, or NULL for invalid type. |
|
873 |
static oop create(BasicType type, jvalue* value, TRAPS); |
|
874 |
// Accessors. Returns the basic type being boxed, or T_ILLEGAL for invalid oop. |
|
875 |
static BasicType get_value(oop box, jvalue* value); |
|
876 |
static BasicType set_value(oop box, jvalue* value); |
|
379
10767ca40189
6652736: well known classes in system dictionary are inefficiently processed
jrose
parents:
360
diff
changeset
|
877 |
static BasicType basic_type(oop box); |
10767ca40189
6652736: well known classes in system dictionary are inefficiently processed
jrose
parents:
360
diff
changeset
|
878 |
static bool is_instance(oop box) { return basic_type(box) != T_ILLEGAL; } |
10767ca40189
6652736: well known classes in system dictionary are inefficiently processed
jrose
parents:
360
diff
changeset
|
879 |
static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; } |
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2105
diff
changeset
|
880 |
static void print(oop box, outputStream* st) { jvalue value; print(get_value(box, &value), &value, st); } |
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2105
diff
changeset
|
881 |
static void print(BasicType type, jvalue* value, outputStream* st); |
1 | 882 |
|
591
04d2e26e6d69
6703888: Compressed Oops: use the 32-bits gap after klass in a object
kvn
parents:
379
diff
changeset
|
883 |
static int value_offset_in_bytes(BasicType type) { |
04d2e26e6d69
6703888: Compressed Oops: use the 32-bits gap after klass in a object
kvn
parents:
379
diff
changeset
|
884 |
return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset : |
04d2e26e6d69
6703888: Compressed Oops: use the 32-bits gap after klass in a object
kvn
parents:
379
diff
changeset
|
885 |
value_offset; |
04d2e26e6d69
6703888: Compressed Oops: use the 32-bits gap after klass in a object
kvn
parents:
379
diff
changeset
|
886 |
} |
1 | 887 |
|
888 |
// Debugging |
|
889 |
friend class JavaClasses; |
|
890 |
}; |
|
891 |
||
892 |
||
893 |
||
894 |
// Interface to java.lang.ref.Reference objects |
|
895 |
||
896 |
class java_lang_ref_Reference: AllStatic { |
|
897 |
public: |
|
898 |
enum { |
|
899 |
hc_referent_offset = 0, |
|
900 |
hc_queue_offset = 1, |
|
901 |
hc_next_offset = 2, |
|
902 |
hc_discovered_offset = 3 // Is not last, see SoftRefs. |
|
903 |
}; |
|
904 |
||
905 |
static int referent_offset; |
|
906 |
static int queue_offset; |
|
907 |
static int next_offset; |
|
908 |
static int discovered_offset; |
|
909 |
||
910 |
// Accessors |
|
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
911 |
static inline oop referent(oop ref); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
912 |
static inline void set_referent(oop ref, oop value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
913 |
static inline void set_referent_raw(oop ref, oop value); |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48620
diff
changeset
|
914 |
static inline HeapWord* referent_addr_raw(oop ref); |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
915 |
static inline oop next(oop ref); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
916 |
static inline void set_next(oop ref, oop value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
917 |
static inline void set_next_raw(oop ref, oop value); |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48620
diff
changeset
|
918 |
static inline HeapWord* next_addr_raw(oop ref); |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
919 |
static inline oop discovered(oop ref); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
920 |
static inline void set_discovered(oop ref, oop value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
921 |
static inline void set_discovered_raw(oop ref, oop value); |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
48620
diff
changeset
|
922 |
static inline HeapWord* discovered_addr_raw(oop ref); |
49786 | 923 |
static inline oop queue(oop ref); |
924 |
static inline void set_queue(oop ref, oop value); |
|
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47818
diff
changeset
|
925 |
static bool is_referent_field(oop obj, ptrdiff_t offset); |
52383
71564a544d4c
8212184: Incorrect oop ref strength used for referents in FinalReference
pliden
parents:
51823
diff
changeset
|
926 |
static inline bool is_final(oop ref); |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47818
diff
changeset
|
927 |
static inline bool is_phantom(oop ref); |
1 | 928 |
}; |
929 |
||
930 |
||
931 |
// Interface to java.lang.ref.SoftReference objects |
|
932 |
||
933 |
class java_lang_ref_SoftReference: public java_lang_ref_Reference { |
|
934 |
public: |
|
935 |
static int timestamp_offset; |
|
936 |
static int static_clock_offset; |
|
937 |
||
938 |
// Accessors |
|
939 |
static jlong timestamp(oop ref); |
|
940 |
||
941 |
// Accessors for statics |
|
942 |
static jlong clock(); |
|
943 |
static void set_clock(jlong value); |
|
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
944 |
|
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
945 |
static void compute_offsets(); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
946 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
1 | 947 |
}; |
948 |
||
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
949 |
// Interface to java.lang.invoke.MethodHandle objects |
2534 | 950 |
|
951 |
class MethodHandleEntry; |
|
952 |
||
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
953 |
class java_lang_invoke_MethodHandle: AllStatic { |
2534 | 954 |
friend class JavaClasses; |
955 |
||
956 |
private: |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
957 |
static int _type_offset; // the MethodType of this MH |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
958 |
static int _form_offset; // the LambdaForm of this MH |
2534 | 959 |
|
960 |
static void compute_offsets(); |
|
961 |
||
962 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
963 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 964 |
|
2534 | 965 |
// Accessors |
966 |
static oop type(oop mh); |
|
967 |
static void set_type(oop mh, oop mtype); |
|
968 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
969 |
static oop form(oop mh); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
970 |
static void set_form(oop mh, oop lform); |
2534 | 971 |
|
972 |
// Testers |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
973 |
static bool is_subclass(Klass* klass) { |
14488 | 974 |
return klass->is_subclass_of(SystemDictionary::MethodHandle_klass()); |
2534 | 975 |
} |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
976 |
static bool is_instance(oop obj); |
2534 | 977 |
|
978 |
// Accessors for code generation: |
|
979 |
static int type_offset_in_bytes() { return _type_offset; } |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
980 |
static int form_offset_in_bytes() { return _form_offset; } |
2534 | 981 |
}; |
982 |
||
19266
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
983 |
// Interface to java.lang.invoke.DirectMethodHandle objects |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
984 |
|
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
985 |
class java_lang_invoke_DirectMethodHandle: AllStatic { |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
986 |
friend class JavaClasses; |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
987 |
|
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
988 |
private: |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
989 |
static int _member_offset; // the MemberName of this DMH |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
990 |
|
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
991 |
static void compute_offsets(); |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
992 |
|
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
993 |
public: |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
994 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 995 |
|
19266
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
996 |
// Accessors |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
997 |
static oop member(oop mh); |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
998 |
|
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
999 |
// Testers |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1000 |
static bool is_subclass(Klass* klass) { |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1001 |
return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass()); |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1002 |
} |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
1003 |
static bool is_instance(oop obj); |
19266
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1004 |
|
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1005 |
// Accessors for code generation: |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1006 |
static int member_offset_in_bytes() { return _member_offset; } |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1007 |
}; |
bb0324cbe0aa
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
sspitsyn
parents:
18690
diff
changeset
|
1008 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1009 |
// Interface to java.lang.invoke.LambdaForm objects |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1010 |
// (These are a private interface for managing adapter code generation.) |
10546 | 1011 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1012 |
class java_lang_invoke_LambdaForm: AllStatic { |
2534 | 1013 |
friend class JavaClasses; |
1014 |
||
1015 |
private: |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1016 |
static int _vmentry_offset; // type is MemberName |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1017 |
|
2534 | 1018 |
static void compute_offsets(); |
1019 |
||
1020 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1021 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 1022 |
|
2534 | 1023 |
// Accessors |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1024 |
static oop vmentry(oop lform); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1025 |
static void set_vmentry(oop lform, oop invoker); |
2534 | 1026 |
|
1027 |
// Testers |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1028 |
static bool is_subclass(Klass* klass) { |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1029 |
return SystemDictionary::LambdaForm_klass() != NULL && |
14488 | 1030 |
klass->is_subclass_of(SystemDictionary::LambdaForm_klass()); |
2534 | 1031 |
} |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
1032 |
static bool is_instance(oop obj); |
2534 | 1033 |
|
1034 |
// Accessors for code generation: |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1035 |
static int vmentry_offset_in_bytes() { return _vmentry_offset; } |
2534 | 1036 |
}; |
1037 |
||
10514
e229a19078cf
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
10233
diff
changeset
|
1038 |
|
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
1039 |
// Interface to java.lang.invoke.MemberName objects |
2534 | 1040 |
// (These are a private interface for Java code to query the class hierarchy.) |
1041 |
||
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1042 |
#define RESOLVEDMETHOD_INJECTED_FIELDS(macro) \ |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1043 |
macro(java_lang_invoke_ResolvedMethodName, vmholder, object_signature, false) \ |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1044 |
macro(java_lang_invoke_ResolvedMethodName, vmtarget, intptr_signature, false) |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1045 |
|
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1046 |
class java_lang_invoke_ResolvedMethodName : AllStatic { |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1047 |
friend class JavaClasses; |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1048 |
|
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1049 |
static int _vmtarget_offset; |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1050 |
static int _vmholder_offset; |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1051 |
|
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1052 |
static void compute_offsets(); |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1053 |
public: |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1054 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
49329 | 1055 |
|
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1056 |
static int vmtarget_offset_in_bytes() { return _vmtarget_offset; } |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1057 |
|
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1058 |
static Method* vmtarget(oop resolved_method); |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1059 |
static void set_vmtarget(oop resolved_method, Method* method); |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1060 |
|
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1061 |
// find or create resolved member name |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1062 |
static oop find_resolved_method(const methodHandle& m, TRAPS); |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1063 |
|
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1064 |
static bool is_instance(oop resolved_method); |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1065 |
}; |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1066 |
|
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1067 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1068 |
#define MEMBERNAME_INJECTED_FIELDS(macro) \ |
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1069 |
macro(java_lang_invoke_MemberName, vmindex, intptr_signature, false) |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1070 |
|
10546 | 1071 |
|
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
1072 |
class java_lang_invoke_MemberName: AllStatic { |
2534 | 1073 |
friend class JavaClasses; |
1074 |
||
1075 |
private: |
|
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
1076 |
// From java.lang.invoke.MemberName: |
2534 | 1077 |
// private Class<?> clazz; // class in which the method is defined |
1078 |
// private String name; // may be null if not yet materialized |
|
1079 |
// private Object type; // may be null if not yet materialized |
|
1080 |
// private int flags; // modifier bits; see reflect.Modifier |
|
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1081 |
// private ResolvedMethodName method; // holds VM-specific target value |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1082 |
// private intptr_t vmindex; // member index within class or interface |
2534 | 1083 |
static int _clazz_offset; |
1084 |
static int _name_offset; |
|
1085 |
static int _type_offset; |
|
1086 |
static int _flags_offset; |
|
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1087 |
static int _method_offset; |
2534 | 1088 |
static int _vmindex_offset; |
1089 |
||
1090 |
static void compute_offsets(); |
|
1091 |
||
1092 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1093 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
2534 | 1094 |
// Accessors |
1095 |
static oop clazz(oop mname); |
|
1096 |
static void set_clazz(oop mname, oop clazz); |
|
1097 |
||
1098 |
static oop type(oop mname); |
|
1099 |
static void set_type(oop mname, oop type); |
|
1100 |
||
1101 |
static oop name(oop mname); |
|
1102 |
static void set_name(oop mname, oop name); |
|
1103 |
||
1104 |
static int flags(oop mname); |
|
1105 |
static void set_flags(oop mname, int flags); |
|
1106 |
||
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1107 |
// Link through ResolvedMethodName field to get Method* |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1108 |
static Method* vmtarget(oop mname); |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1109 |
static void set_method(oop mname, oop method); |
2534 | 1110 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1111 |
static intptr_t vmindex(oop mname); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1112 |
static void set_vmindex(oop mname, intptr_t index); |
2534 | 1113 |
|
1114 |
// Testers |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1115 |
static bool is_subclass(Klass* klass) { |
14488 | 1116 |
return klass->is_subclass_of(SystemDictionary::MemberName_klass()); |
2534 | 1117 |
} |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
1118 |
static bool is_instance(oop obj); |
2534 | 1119 |
|
27674
00cabfc45357
8042235: redefining method used by multiple MethodHandles crashes VM
coleenp
parents:
27654
diff
changeset
|
1120 |
static bool is_method(oop obj); |
00cabfc45357
8042235: redefining method used by multiple MethodHandles crashes VM
coleenp
parents:
27654
diff
changeset
|
1121 |
|
2534 | 1122 |
// Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants): |
1123 |
enum { |
|
16617
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1124 |
MN_IS_METHOD = 0x00010000, // method (not constructor) |
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1125 |
MN_IS_CONSTRUCTOR = 0x00020000, // constructor |
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1126 |
MN_IS_FIELD = 0x00040000, // field |
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1127 |
MN_IS_TYPE = 0x00080000, // nested type |
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1128 |
MN_CALLER_SENSITIVE = 0x00100000, // @CallerSensitive annotation detected |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1129 |
MN_REFERENCE_KIND_SHIFT = 24, // refKind |
16617
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1130 |
MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT, |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1131 |
// The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers: |
16617
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1132 |
MN_SEARCH_SUPERCLASSES = 0x00100000, // walk super classes |
6235d2c7549f
7198429: need checked categorization of caller-sensitive methods in the JDK
twisti
parents:
15232
diff
changeset
|
1133 |
MN_SEARCH_INTERFACES = 0x00200000 // walk implemented interfaces |
2534 | 1134 |
}; |
1135 |
||
1136 |
// Accessors for code generation: |
|
1137 |
static int clazz_offset_in_bytes() { return _clazz_offset; } |
|
1138 |
static int type_offset_in_bytes() { return _type_offset; } |
|
1139 |
static int name_offset_in_bytes() { return _name_offset; } |
|
1140 |
static int flags_offset_in_bytes() { return _flags_offset; } |
|
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1141 |
static int method_offset_in_bytes() { return _method_offset; } |
2534 | 1142 |
static int vmindex_offset_in_bytes() { return _vmindex_offset; } |
1143 |
}; |
|
1144 |
||
1145 |
||
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
1146 |
// Interface to java.lang.invoke.MethodType objects |
2534 | 1147 |
|
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
1148 |
class java_lang_invoke_MethodType: AllStatic { |
2534 | 1149 |
friend class JavaClasses; |
1150 |
||
1151 |
private: |
|
1152 |
static int _rtype_offset; |
|
1153 |
static int _ptypes_offset; |
|
1154 |
||
1155 |
static void compute_offsets(); |
|
1156 |
||
1157 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1158 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
2534 | 1159 |
// Accessors |
1160 |
static oop rtype(oop mt); |
|
1161 |
static objArrayOop ptypes(oop mt); |
|
1162 |
||
1163 |
static oop ptype(oop mt, int index); |
|
4562
5d93cb2d2090
6894206: JVM needs a way to traverse method handle structures
twisti
parents:
4429
diff
changeset
|
1164 |
static int ptype_count(oop mt); |
2534 | 1165 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1166 |
static int ptype_slot_count(oop mt); // extra counts for long/double |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1167 |
static int rtype_slot_count(oop mt); // extra counts for long/double |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1168 |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7414
diff
changeset
|
1169 |
static Symbol* as_signature(oop mt, bool intern_if_not_found, TRAPS); |
2534 | 1170 |
static void print_signature(oop mt, outputStream* st); |
1171 |
||
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
1172 |
static bool is_instance(oop obj); |
2534 | 1173 |
|
10008
d84de97ad847
7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents:
9630
diff
changeset
|
1174 |
static bool equals(oop mt1, oop mt2); |
d84de97ad847
7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents:
9630
diff
changeset
|
1175 |
|
2534 | 1176 |
// Accessors for code generation: |
1177 |
static int rtype_offset_in_bytes() { return _rtype_offset; } |
|
1178 |
static int ptypes_offset_in_bytes() { return _ptypes_offset; } |
|
1179 |
}; |
|
1180 |
||
1181 |
||
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
1182 |
// Interface to java.lang.invoke.CallSite objects |
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1183 |
|
8676
9098d4e927e1
7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents:
8076
diff
changeset
|
1184 |
class java_lang_invoke_CallSite: AllStatic { |
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1185 |
friend class JavaClasses; |
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1186 |
|
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1187 |
private: |
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1188 |
static int _target_offset; |
30296
95baefac8485
8057967: CallSite dependency tracking scales devastatingly poorly
vlivanov
parents:
29081
diff
changeset
|
1189 |
static int _context_offset; |
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1190 |
|
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1191 |
static void compute_offsets(); |
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1192 |
|
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1193 |
public: |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1194 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1195 |
// Accessors |
30296
95baefac8485
8057967: CallSite dependency tracking scales devastatingly poorly
vlivanov
parents:
29081
diff
changeset
|
1196 |
static oop target( oop site); |
95baefac8485
8057967: CallSite dependency tracking scales devastatingly poorly
vlivanov
parents:
29081
diff
changeset
|
1197 |
static void set_target( oop site, oop target); |
95baefac8485
8057967: CallSite dependency tracking scales devastatingly poorly
vlivanov
parents:
29081
diff
changeset
|
1198 |
static void set_target_volatile( oop site, oop target); |
10540
92d59dba2407
7085860: JSR 292: implement CallSite.setTargetNormal and setTargetVolatile as native methods
twisti
parents:
10514
diff
changeset
|
1199 |
|
52411
35ebea32a23c
8212996: Use AS_NO_KEEPALIVE when accessing dead java.lang.invoke.CallSites during nmethod unloading
eosterlund
parents:
52383
diff
changeset
|
1200 |
static oop context_no_keepalive(oop site); |
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1201 |
|
4564
55dfb20908d0
6893081: method handle & invokedynamic code needs additional cleanup (post 6815692, 6858164)
twisti
parents:
4562
diff
changeset
|
1202 |
// Testers |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1203 |
static bool is_subclass(Klass* klass) { |
14488 | 1204 |
return klass->is_subclass_of(SystemDictionary::CallSite_klass()); |
4564
55dfb20908d0
6893081: method handle & invokedynamic code needs additional cleanup (post 6815692, 6858164)
twisti
parents:
4562
diff
changeset
|
1205 |
} |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
1206 |
static bool is_instance(oop obj); |
4564
55dfb20908d0
6893081: method handle & invokedynamic code needs additional cleanup (post 6815692, 6858164)
twisti
parents:
4562
diff
changeset
|
1207 |
|
2570
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1208 |
// Accessors for code generation: |
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1209 |
static int target_offset_in_bytes() { return _target_offset; } |
ecc7862946d4
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
2534
diff
changeset
|
1210 |
}; |
2534 | 1211 |
|
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1212 |
// Interface to java.lang.invoke.MethodHandleNatives$CallSiteContext objects |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1213 |
|
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1214 |
#define CALLSITECONTEXT_INJECTED_FIELDS(macro) \ |
52781
436097b038a1
8213565: Crash in DependencyContext::remove_dependent_nmethod
eosterlund
parents:
52431
diff
changeset
|
1215 |
macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, vmdependencies, intptr_signature, false) \ |
436097b038a1
8213565: Crash in DependencyContext::remove_dependent_nmethod
eosterlund
parents:
52431
diff
changeset
|
1216 |
macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, last_cleanup, long_signature, false) |
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1217 |
|
34195
89011d12ebd3
8139595: MethodHandles::remove_dependent_nmethod is not MT safe
vlivanov
parents:
33638
diff
changeset
|
1218 |
class DependencyContext; |
89011d12ebd3
8139595: MethodHandles::remove_dependent_nmethod is not MT safe
vlivanov
parents:
33638
diff
changeset
|
1219 |
|
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1220 |
class java_lang_invoke_MethodHandleNatives_CallSiteContext : AllStatic { |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1221 |
friend class JavaClasses; |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1222 |
|
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1223 |
private: |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1224 |
static int _vmdependencies_offset; |
52781
436097b038a1
8213565: Crash in DependencyContext::remove_dependent_nmethod
eosterlund
parents:
52431
diff
changeset
|
1225 |
static int _last_cleanup_offset; |
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1226 |
|
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1227 |
static void compute_offsets(); |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1228 |
|
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1229 |
public: |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1230 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1231 |
// Accessors |
34195
89011d12ebd3
8139595: MethodHandles::remove_dependent_nmethod is not MT safe
vlivanov
parents:
33638
diff
changeset
|
1232 |
static DependencyContext vmdependencies(oop context); |
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1233 |
|
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1234 |
// Testers |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1235 |
static bool is_subclass(Klass* klass) { |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1236 |
return klass->is_subclass_of(SystemDictionary::Context_klass()); |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1237 |
} |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1238 |
static bool is_instance(oop obj); |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1239 |
}; |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1240 |
|
1 | 1241 |
// Interface to java.security.AccessControlContext objects |
1242 |
||
1243 |
class java_security_AccessControlContext: AllStatic { |
|
1244 |
private: |
|
1245 |
// Note that for this class the layout changed between JDK1.2 and JDK1.3, |
|
1246 |
// so we compute the offsets at startup rather than hard-wiring them. |
|
1247 |
static int _context_offset; |
|
1248 |
static int _privilegedContext_offset; |
|
1249 |
static int _isPrivileged_offset; |
|
18056 | 1250 |
static int _isAuthorized_offset; |
1 | 1251 |
|
1252 |
static void compute_offsets(); |
|
1253 |
public: |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1254 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
1 | 1255 |
static oop create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS); |
1256 |
||
1257 |
// Debugging/initialization |
|
1258 |
friend class JavaClasses; |
|
1259 |
}; |
|
1260 |
||
1261 |
||
1262 |
// Interface to java.lang.ClassLoader objects |
|
1263 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1264 |
#define CLASSLOADER_INJECTED_FIELDS(macro) \ |
14588
8ec26d2d9339
8000662: NPG: nashorn ant clean test262 out-of-memory with Java heap
coleenp
parents:
14490
diff
changeset
|
1265 |
macro(java_lang_ClassLoader, loader_data, intptr_signature, false) |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1266 |
|
1 | 1267 |
class java_lang_ClassLoader : AllStatic { |
1268 |
private: |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1269 |
static int _loader_data_offset; |
10546 | 1270 |
static bool offsets_computed; |
1 | 1271 |
static int parent_offset; |
10546 | 1272 |
static int parallelCapable_offset; |
41877 | 1273 |
static int name_offset; |
50634
c349d409262a
8202605: Standardize on ClassLoaderData::loader_name() throughout the VM to obtain a class loader's name
lfoltan
parents:
50532
diff
changeset
|
1274 |
static int nameAndId_offset; |
36508 | 1275 |
static int unnamedModule_offset; |
10546 | 1276 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1277 |
public: |
10546 | 1278 |
static void compute_offsets(); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1279 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
1 | 1280 |
|
51698
74dde8b66b7f
8210422: runtime/modules/ModuleStress/ExportModuleStressTest.java - assertion failed: address not aligned: 0x00000008baadbabe
coleenp
parents:
51516
diff
changeset
|
1281 |
static ClassLoaderData* loader_data_acquire(oop loader); |
51516
7c3891b9f1e0
8206457: Code paths from oop_iterate() must use barrier-free access
rkennke
parents:
51429
diff
changeset
|
1282 |
static ClassLoaderData* loader_data_raw(oop loader); |
51698
74dde8b66b7f
8210422: runtime/modules/ModuleStress/ExportModuleStressTest.java - assertion failed: address not aligned: 0x00000008baadbabe
coleenp
parents:
51516
diff
changeset
|
1283 |
static void release_set_loader_data(oop loader, ClassLoaderData* new_data); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1284 |
|
1 | 1285 |
static oop parent(oop loader); |
41877 | 1286 |
static oop name(oop loader); |
50634
c349d409262a
8202605: Standardize on ClassLoaderData::loader_name() throughout the VM to obtain a class loader's name
lfoltan
parents:
50532
diff
changeset
|
1287 |
static oop nameAndId(oop loader); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1288 |
static bool isAncestor(oop loader, oop cl); |
1 | 1289 |
|
10546 | 1290 |
// Support for parallelCapable field |
1291 |
static bool parallelCapable(oop the_class_mirror); |
|
1292 |
||
1 | 1293 |
static bool is_trusted_loader(oop loader); |
1294 |
||
42574
25ff9171b28b
8166304: Skipping access check for classes generated by core reflection
hseigel
parents:
41877
diff
changeset
|
1295 |
// Return true if this is one of the class loaders associated with |
25ff9171b28b
8166304: Skipping access check for classes generated by core reflection
hseigel
parents:
41877
diff
changeset
|
1296 |
// the generated bytecodes for reflection. |
25ff9171b28b
8166304: Skipping access check for classes generated by core reflection
hseigel
parents:
41877
diff
changeset
|
1297 |
static bool is_reflection_class_loader(oop loader); |
25ff9171b28b
8166304: Skipping access check for classes generated by core reflection
hseigel
parents:
41877
diff
changeset
|
1298 |
|
1 | 1299 |
// Fix for 4474172 |
1300 |
static oop non_reflection_class_loader(oop loader); |
|
1301 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1302 |
// Testers |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1303 |
static bool is_subclass(Klass* klass) { |
14488 | 1304 |
return klass->is_subclass_of(SystemDictionary::ClassLoader_klass()); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1305 |
} |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
27674
diff
changeset
|
1306 |
static bool is_instance(oop obj); |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13091
diff
changeset
|
1307 |
|
36508 | 1308 |
static oop unnamedModule(oop loader); |
1309 |
||
1 | 1310 |
// Debugging |
1311 |
friend class JavaClasses; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1312 |
friend class ClassFileParser; // access to number_of_fake_fields |
1 | 1313 |
}; |
1314 |
||
1315 |
||
1316 |
// Interface to java.lang.System objects |
|
1317 |
||
1318 |
class java_lang_System : AllStatic { |
|
1319 |
private: |
|
1320 |
static int static_in_offset; |
|
1321 |
static int static_out_offset; |
|
1322 |
static int static_err_offset; |
|
18056 | 1323 |
static int static_security_offset; |
1 | 1324 |
|
1325 |
public: |
|
1326 |
static int in_offset_in_bytes(); |
|
1327 |
static int out_offset_in_bytes(); |
|
1328 |
static int err_offset_in_bytes(); |
|
1329 |
||
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
1330 |
static void compute_offsets(); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1331 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
1332 |
|
1 | 1333 |
// Debugging |
1334 |
friend class JavaClasses; |
|
1335 |
}; |
|
1336 |
||
1337 |
||
1338 |
// Interface to java.lang.StackTraceElement objects |
|
1339 |
||
1340 |
class java_lang_StackTraceElement: AllStatic { |
|
1341 |
private: |
|
42541
308a256d545e
8169389: Use a bitmap to control StackTraceElement::toString format and save footprint
bchristi
parents:
41877
diff
changeset
|
1342 |
static int declaringClassObject_offset; |
41877 | 1343 |
static int classLoaderName_offset; |
36508 | 1344 |
static int moduleName_offset; |
1345 |
static int moduleVersion_offset; |
|
1 | 1346 |
static int declaringClass_offset; |
1347 |
static int methodName_offset; |
|
1348 |
static int fileName_offset; |
|
1349 |
static int lineNumber_offset; |
|
1350 |
||
1351 |
// Setters |
|
41877 | 1352 |
static void set_classLoaderName(oop element, oop value); |
36508 | 1353 |
static void set_moduleName(oop element, oop value); |
1354 |
static void set_moduleVersion(oop element, oop value); |
|
1 | 1355 |
static void set_declaringClass(oop element, oop value); |
1356 |
static void set_methodName(oop element, oop value); |
|
1357 |
static void set_fileName(oop element, oop value); |
|
1358 |
static void set_lineNumber(oop element, int value); |
|
41877 | 1359 |
static void set_declaringClassObject(oop element, oop value); |
1 | 1360 |
|
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
1361 |
public: |
1 | 1362 |
// Create an instance of StackTraceElement |
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
1363 |
static oop create(const methodHandle& method, int bci, TRAPS); |
1 | 1364 |
|
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
1365 |
static void fill_in(Handle element, InstanceKlass* holder, const methodHandle& method, |
46257
3e95288ce4ca
8140685: Fix backtrace building to not rely on constant pool merging
coleenp
parents:
42627
diff
changeset
|
1366 |
int version, int bci, Symbol* name, TRAPS); |
37064
5c82fa70d313
8150778: Reduce Throwable.getStackTrace() calls to the JVM
coleenp
parents:
35606
diff
changeset
|
1367 |
|
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
1368 |
static void compute_offsets(); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1369 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
1370 |
|
1 | 1371 |
// Debugging |
1372 |
friend class JavaClasses; |
|
1373 |
}; |
|
1374 |
||
1375 |
||
34280 | 1376 |
class Backtrace: AllStatic { |
1377 |
public: |
|
1378 |
// Helper backtrace functions to store bci|version together. |
|
1379 |
static int merge_bci_and_version(int bci, int version); |
|
1380 |
static int merge_mid_and_cpref(int mid, int cpref); |
|
1381 |
static int bci_at(unsigned int merged); |
|
1382 |
static int version_at(unsigned int merged); |
|
1383 |
static int mid_at(unsigned int merged); |
|
1384 |
static int cpref_at(unsigned int merged); |
|
1385 |
static int get_line_number(const methodHandle& method, int bci); |
|
1386 |
static Symbol* get_source_file_name(InstanceKlass* holder, int version); |
|
1387 |
||
1388 |
// Debugging |
|
1389 |
friend class JavaClasses; |
|
1390 |
}; |
|
1391 |
||
1392 |
// Interface to java.lang.StackFrameInfo objects |
|
1393 |
||
1394 |
#define STACKFRAMEINFO_INJECTED_FIELDS(macro) \ |
|
37438 | 1395 |
macro(java_lang_StackFrameInfo, version, short_signature, false) |
34280 | 1396 |
|
1397 |
class java_lang_StackFrameInfo: AllStatic { |
|
1398 |
private: |
|
1399 |
static int _memberName_offset; |
|
1400 |
static int _bci_offset; |
|
1401 |
static int _version_offset; |
|
1402 |
||
1403 |
static Method* get_method(Handle stackFrame, InstanceKlass* holder, TRAPS); |
|
1404 |
||
1405 |
public: |
|
1406 |
// Setters |
|
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1407 |
static void set_method_and_bci(Handle stackFrame, const methodHandle& method, int bci, TRAPS); |
34280 | 1408 |
static void set_bci(oop info, int value); |
1409 |
||
1410 |
static void set_version(oop info, short value); |
|
1411 |
||
1412 |
static void compute_offsets(); |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1413 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
34280 | 1414 |
|
37438 | 1415 |
static void to_stack_trace_element(Handle stackFrame, Handle stack_trace_element, TRAPS); |
1416 |
||
34280 | 1417 |
// Debugging |
1418 |
friend class JavaClasses; |
|
1419 |
}; |
|
1420 |
||
1421 |
class java_lang_LiveStackFrameInfo: AllStatic { |
|
1422 |
private: |
|
1423 |
static int _monitors_offset; |
|
1424 |
static int _locals_offset; |
|
1425 |
static int _operands_offset; |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
43422
diff
changeset
|
1426 |
static int _mode_offset; |
34280 | 1427 |
|
1428 |
public: |
|
1429 |
static void set_monitors(oop info, oop value); |
|
1430 |
static void set_locals(oop info, oop value); |
|
1431 |
static void set_operands(oop info, oop value); |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
43422
diff
changeset
|
1432 |
static void set_mode(oop info, int value); |
34280 | 1433 |
|
1434 |
static void compute_offsets(); |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1435 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
34280 | 1436 |
|
1437 |
// Debugging |
|
1438 |
friend class JavaClasses; |
|
1439 |
}; |
|
1440 |
||
1 | 1441 |
// Interface to java.lang.AssertionStatusDirectives objects |
1442 |
||
1443 |
class java_lang_AssertionStatusDirectives: AllStatic { |
|
1444 |
private: |
|
1445 |
static int classes_offset; |
|
1446 |
static int classEnabled_offset; |
|
1447 |
static int packages_offset; |
|
1448 |
static int packageEnabled_offset; |
|
1449 |
static int deflt_offset; |
|
1450 |
||
1451 |
public: |
|
1452 |
// Setters |
|
1453 |
static void set_classes(oop obj, oop val); |
|
1454 |
static void set_classEnabled(oop obj, oop val); |
|
1455 |
static void set_packages(oop obj, oop val); |
|
1456 |
static void set_packageEnabled(oop obj, oop val); |
|
1457 |
static void set_deflt(oop obj, bool val); |
|
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
1458 |
|
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
1459 |
static void compute_offsets(); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1460 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
1461 |
|
1 | 1462 |
// Debugging |
1463 |
friend class JavaClasses; |
|
1464 |
}; |
|
1465 |
||
1466 |
||
1467 |
class java_nio_Buffer: AllStatic { |
|
1468 |
private: |
|
1469 |
static int _limit_offset; |
|
1470 |
||
1471 |
public: |
|
1472 |
static int limit_offset(); |
|
1473 |
static void compute_offsets(); |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1474 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
1 | 1475 |
}; |
1476 |
||
1477 |
class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic { |
|
1478 |
private: |
|
1479 |
static int _owner_offset; |
|
1480 |
public: |
|
50419
146c60525d4a
8199882: compiler/uncommontrap/TestDeoptOOM.java failed w/ fatal error: ExceptionMark constructor expects no pending exceptions
dholmes
parents:
50063
diff
changeset
|
1481 |
static void compute_offsets(); |
1 | 1482 |
static oop get_owner_threadObj(oop obj); |
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1483 |
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN; |
1 | 1484 |
}; |
1485 |
||
10546 | 1486 |
// Use to declare fields that need to be injected into Java classes |
1487 |
// for the JVM to use. The name_index and signature_index are |
|
1488 |
// declared in vmSymbols. The may_be_java flag is used to declare |
|
1489 |
// fields that might already exist in Java but should be injected if |
|
1490 |
// they don't. Otherwise the field is unconditionally injected and |
|
1491 |
// the JVM uses the injected one. This is to ensure that name |
|
1492 |
// collisions don't occur. In general may_be_java should be false |
|
1493 |
// unless there's a good reason. |
|
1494 |
||
1495 |
class InjectedField { |
|
1496 |
public: |
|
1497 |
const SystemDictionary::WKID klass_id; |
|
1498 |
const vmSymbols::SID name_index; |
|
1499 |
const vmSymbols::SID signature_index; |
|
1500 |
const bool may_be_java; |
|
1501 |
||
1502 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1503 |
Klass* klass() const { return SystemDictionary::well_known_klass(klass_id); } |
10546 | 1504 |
Symbol* name() const { return lookup_symbol(name_index); } |
1505 |
Symbol* signature() const { return lookup_symbol(signature_index); } |
|
1506 |
||
1507 |
int compute_offset(); |
|
1508 |
||
1509 |
// Find the Symbol for this index |
|
1510 |
static Symbol* lookup_symbol(int symbol_index) { |
|
1511 |
return vmSymbols::symbol_at((vmSymbols::SID)symbol_index); |
|
1512 |
} |
|
1513 |
}; |
|
1514 |
||
1515 |
#define DECLARE_INJECTED_FIELD_ENUM(klass, name, signature, may_be_java) \ |
|
1516 |
klass##_##name##_enum, |
|
1517 |
||
1518 |
#define ALL_INJECTED_FIELDS(macro) \ |
|
1519 |
CLASS_INJECTED_FIELDS(macro) \ |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
1520 |
CLASSLOADER_INJECTED_FIELDS(macro) \ |
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46388
diff
changeset
|
1521 |
RESOLVEDMETHOD_INJECTED_FIELDS(macro) \ |
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30310
diff
changeset
|
1522 |
MEMBERNAME_INJECTED_FIELDS(macro) \ |
34280 | 1523 |
CALLSITECONTEXT_INJECTED_FIELDS(macro) \ |
36508 | 1524 |
STACKFRAMEINFO_INJECTED_FIELDS(macro) \ |
1525 |
MODULE_INJECTED_FIELDS(macro) |
|
10546 | 1526 |
|
1 | 1527 |
// Interface to hard-coded offset checking |
1528 |
||
1529 |
class JavaClasses : AllStatic { |
|
1530 |
private: |
|
10546 | 1531 |
|
1532 |
static InjectedField _injected_fields[]; |
|
1533 |
||
1 | 1534 |
static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0; |
1535 |
public: |
|
10546 | 1536 |
enum InjectedFieldID { |
1537 |
ALL_INJECTED_FIELDS(DECLARE_INJECTED_FIELD_ENUM) |
|
1538 |
MAX_enum |
|
1539 |
}; |
|
1540 |
||
1541 |
static int compute_injected_offset(InjectedFieldID id); |
|
1542 |
||
1 | 1543 |
static void compute_hard_coded_offsets(); |
1544 |
static void compute_offsets(); |
|
1545 |
static void check_offsets() PRODUCT_RETURN; |
|
51417
b08c2a94cce1
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
iklam
parents:
51388
diff
changeset
|
1546 |
static void serialize_offsets(SerializeClosure* soc) NOT_CDS_RETURN; |
10546 | 1547 |
static InjectedField* get_injected(Symbol* class_name, int* field_count); |
1 | 1548 |
}; |
7397 | 1549 |
|
10546 | 1550 |
#undef DECLARE_INJECTED_FIELD_ENUM |
1551 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
53212
diff
changeset
|
1552 |
#endif // SHARE_CLASSFILE_JAVACLASSES_HPP |