annotate src/share/vm/runtime/jniHandles.hpp @ 2368:dde920245681

6896099: Integrate CMS heap ergo with default heap sizing ergo 6627787: CMS: JVM refuses to start up with -Xms16m -Xmx16m 7000125: CMS: Anti-monotone young gen sizing with respect to maximum whole heap size specification 7027529: CMS: retire CMSUseOldDefaults flag Summary: Simplify CMS heap sizing code, relying on ergonomic initial sizing consistent with other collectors for the most part, controlling only young gen sizing to rein in pause times. Make CMS young gen sizing default statically cpu-dependant. Remove inconsistencies wrt generation sizing and policy code, allowing for the fixing for 6627787 and 7000125. For 7027529, retire the flag CMSUseOldDefaults which had been introduced as a bridge from JDK 5 to JDK 6 a number of years ago. Reviewed-by: brutisso, poonam
author ysr
date Wed, 16 Mar 2011 10:37:08 -0700
parents f95d63e2154a
children d2a62e0f25eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1536
diff changeset
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1536
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1536
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1536
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_RUNTIME_JNIHANDLES_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_RUNTIME_JNIHANDLES_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "runtime/handles.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "utilities/top.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 class JNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // Interface for creating and resolving local/global JNI handles
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class JNIHandles : AllStatic {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 friend class VMStructs;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
39 static JNIHandleBlock* _global_handles; // First global handle block
a61af66fc99e Initial load
duke
parents:
diff changeset
40 static JNIHandleBlock* _weak_global_handles; // First weak global handle block
a61af66fc99e Initial load
duke
parents:
diff changeset
41 static oop _deleted_handle; // Sentinel marking deleted handles
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // Resolve handle into oop
a61af66fc99e Initial load
duke
parents:
diff changeset
45 inline static oop resolve(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // Resolve externally provided handle into oop with some guards
a61af66fc99e Initial load
duke
parents:
diff changeset
47 inline static oop resolve_external_guard(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // Resolve handle into oop, result guaranteed not to be null
a61af66fc99e Initial load
duke
parents:
diff changeset
49 inline static oop resolve_non_null(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // Local handles
a61af66fc99e Initial load
duke
parents:
diff changeset
52 static jobject make_local(oop obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
53 static jobject make_local(JNIEnv* env, oop obj); // Fast version when env is known
a61af66fc99e Initial load
duke
parents:
diff changeset
54 static jobject make_local(Thread* thread, oop obj); // Even faster version when current thread is known
a61af66fc99e Initial load
duke
parents:
diff changeset
55 inline static void destroy_local(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // Global handles
a61af66fc99e Initial load
duke
parents:
diff changeset
58 static jobject make_global(Handle obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static void destroy_global(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // Weak global handles
a61af66fc99e Initial load
duke
parents:
diff changeset
62 static jobject make_weak_global(Handle obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static void destroy_weak_global(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // jmethodID handling (as Weak global handles).
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // Because the useful life-span of a jmethodID cannot be determined, once created they are
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // never reclaimed. The methods to which they refer, however, can be GC'ed away if the class
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // is unloaded or if the method is made obsolete or deleted -- in these cases, the jmethodID
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // refers to NULL (as is the case for any weak reference).
a61af66fc99e Initial load
duke
parents:
diff changeset
70 static jmethodID make_jmethod_id(methodHandle mh);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 static void destroy_jmethod_id(jmethodID mid);
1535
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
72 // Use resolve_jmethod_id() in situations where the caller is expected
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
73 // to provide a valid jmethodID; the only sanity checks are in asserts;
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
74 // result guaranteed not to be NULL.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
75 inline static methodOop resolve_jmethod_id(jmethodID mid);
1535
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
76 // Use checked_resolve_jmethod_id() in situations where the caller
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
77 // should provide a valid jmethodID, but might not. NULL is returned
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
78 // when the jmethodID does not refer to a valid method.
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
79 inline static methodOop checked_resolve_jmethod_id(jmethodID mid);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
80 static void change_method_associated_with_jmethod_id(jmethodID jmid, methodHandle mh);
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // Sentinel marking deleted handles in block. Note that we cannot store NULL as
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // the sentinel, since clearing weak global JNI refs are done by storing NULL in
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // the handle. The handle may not be reused before destroy_weak_global is called.
a61af66fc99e Initial load
duke
parents:
diff changeset
85 static oop deleted_handle() { return _deleted_handle; }
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // Initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
88 static void initialize();
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
91 static void print_on(outputStream* st);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 static void print() { print_on(tty); }
a61af66fc99e Initial load
duke
parents:
diff changeset
93 static void verify();
a61af66fc99e Initial load
duke
parents:
diff changeset
94 static bool is_local_handle(Thread* thread, jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
95 static bool is_frame_handle(JavaThread* thr, jobject obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 static bool is_global_handle(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 static bool is_weak_global_handle(jobject handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
98 static long global_handle_memory_usage();
a61af66fc99e Initial load
duke
parents:
diff changeset
99 static long weak_global_handle_memory_usage();
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // Garbage collection support(global handles only, local handles are traversed from thread)
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // Traversal of regular global handles
a61af66fc99e Initial load
duke
parents:
diff changeset
103 static void oops_do(OopClosure* f);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 // Traversal of weak global handles. Unreachable oops are cleared.
a61af66fc99e Initial load
duke
parents:
diff changeset
105 static void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
a61af66fc99e Initial load
duke
parents:
diff changeset
106 };
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // JNI handle blocks holding local/global JNI handles
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 class JNIHandleBlock : public CHeapObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
113 friend class VMStructs;
1010
354d3184f6b2 6890308: integrate zero assembler hotspot changes
never
parents: 917
diff changeset
114 friend class CppInterpreter;
354d3184f6b2 6890308: integrate zero assembler hotspot changes
never
parents: 917
diff changeset
115
0
a61af66fc99e Initial load
duke
parents:
diff changeset
116 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
117 enum SomeConstants {
a61af66fc99e Initial load
duke
parents:
diff changeset
118 block_size_in_oops = 32 // Number of handles per handle block
a61af66fc99e Initial load
duke
parents:
diff changeset
119 };
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 oop _handles[block_size_in_oops]; // The handles
a61af66fc99e Initial load
duke
parents:
diff changeset
122 int _top; // Index of next unused handle
a61af66fc99e Initial load
duke
parents:
diff changeset
123 JNIHandleBlock* _next; // Link to next block
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // The following instance variables are only used by the first block in a chain.
a61af66fc99e Initial load
duke
parents:
diff changeset
126 // Having two types of blocks complicates the code and the space overhead in negligble.
a61af66fc99e Initial load
duke
parents:
diff changeset
127 JNIHandleBlock* _last; // Last block in use
a61af66fc99e Initial load
duke
parents:
diff changeset
128 JNIHandleBlock* _pop_frame_link; // Block to restore on PopLocalFrame call
a61af66fc99e Initial load
duke
parents:
diff changeset
129 oop* _free_list; // Handle free list
a61af66fc99e Initial load
duke
parents:
diff changeset
130 int _allocate_before_rebuild; // Number of blocks to allocate before rebuilding free list
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
133 JNIHandleBlock* _block_list_link; // Link for list below
a61af66fc99e Initial load
duke
parents:
diff changeset
134 static JNIHandleBlock* _block_list; // List of all allocated blocks (for debugging only)
a61af66fc99e Initial load
duke
parents:
diff changeset
135 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 static JNIHandleBlock* _block_free_list; // Free list of currently unused blocks
a61af66fc99e Initial load
duke
parents:
diff changeset
138 static int _blocks_allocated; // For debugging/printing
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // Fill block with bad_handle values
a61af66fc99e Initial load
duke
parents:
diff changeset
141 void zap();
a61af66fc99e Initial load
duke
parents:
diff changeset
142
1010
354d3184f6b2 6890308: integrate zero assembler hotspot changes
never
parents: 917
diff changeset
143 protected:
0
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // No more handles in the both the current and following blocks
a61af66fc99e Initial load
duke
parents:
diff changeset
145 void clear() { _top = 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
146
1010
354d3184f6b2 6890308: integrate zero assembler hotspot changes
never
parents: 917
diff changeset
147 private:
0
a61af66fc99e Initial load
duke
parents:
diff changeset
148 // Free list computation
a61af66fc99e Initial load
duke
parents:
diff changeset
149 void rebuild_free_list();
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // Handle allocation
a61af66fc99e Initial load
duke
parents:
diff changeset
153 jobject allocate_handle(oop obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // Block allocation and block free list management
a61af66fc99e Initial load
duke
parents:
diff changeset
156 static JNIHandleBlock* allocate_block(Thread* thread = NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
157 static void release_block(JNIHandleBlock* block, Thread* thread = NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 // JNI PushLocalFrame/PopLocalFrame support
a61af66fc99e Initial load
duke
parents:
diff changeset
160 JNIHandleBlock* pop_frame_link() const { return _pop_frame_link; }
a61af66fc99e Initial load
duke
parents:
diff changeset
161 void set_pop_frame_link(JNIHandleBlock* block) { _pop_frame_link = block; }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // Stub generator support
a61af66fc99e Initial load
duke
parents:
diff changeset
164 static int top_offset_in_bytes() { return offset_of(JNIHandleBlock, _top); }
a61af66fc99e Initial load
duke
parents:
diff changeset
165
a61af66fc99e Initial load
duke
parents:
diff changeset
166 // Garbage collection support
a61af66fc99e Initial load
duke
parents:
diff changeset
167 // Traversal of regular handles
a61af66fc99e Initial load
duke
parents:
diff changeset
168 void oops_do(OopClosure* f);
a61af66fc99e Initial load
duke
parents:
diff changeset
169 // Traversal of weak handles. Unreachable oops are cleared.
a61af66fc99e Initial load
duke
parents:
diff changeset
170 void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
173 bool chain_contains(jobject handle) const; // Does this block or following blocks contain handle
a61af66fc99e Initial load
duke
parents:
diff changeset
174 bool contains(jobject handle) const; // Does this block contain handle
a61af66fc99e Initial load
duke
parents:
diff changeset
175 int length() const; // Length of chain starting with this block
a61af66fc99e Initial load
duke
parents:
diff changeset
176 long memory_usage() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
177 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
178 static bool any_contains(jobject handle); // Does any block currently in use contain handle
a61af66fc99e Initial load
duke
parents:
diff changeset
179 static void print_statistics();
a61af66fc99e Initial load
duke
parents:
diff changeset
180 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
181 };
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 inline oop JNIHandles::resolve(jobject handle) {
a61af66fc99e Initial load
duke
parents:
diff changeset
185 oop result = (handle == NULL ? (oop)NULL : *(oop*)handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
186 assert(result != NULL || (handle == NULL || !CheckJNICalls || is_weak_global_handle(handle)), "Invalid value read from jni handle");
a61af66fc99e Initial load
duke
parents:
diff changeset
187 assert(result != badJNIHandle, "Pointing to zapped jni handle area");
a61af66fc99e Initial load
duke
parents:
diff changeset
188 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
189 };
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 inline oop JNIHandles::resolve_external_guard(jobject handle) {
a61af66fc99e Initial load
duke
parents:
diff changeset
193 if (handle == NULL) return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 oop result = *(oop*)handle;
a61af66fc99e Initial load
duke
parents:
diff changeset
195 if (result == NULL || result == badJNIHandle) return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
196 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
197 };
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199
a61af66fc99e Initial load
duke
parents:
diff changeset
200 inline oop JNIHandles::resolve_non_null(jobject handle) {
a61af66fc99e Initial load
duke
parents:
diff changeset
201 assert(handle != NULL, "JNI handle should not be null");
a61af66fc99e Initial load
duke
parents:
diff changeset
202 oop result = *(oop*)handle;
a61af66fc99e Initial load
duke
parents:
diff changeset
203 assert(result != NULL, "Invalid value read from jni handle");
a61af66fc99e Initial load
duke
parents:
diff changeset
204 assert(result != badJNIHandle, "Pointing to zapped jni handle area");
a61af66fc99e Initial load
duke
parents:
diff changeset
205 // Don't let that private _deleted_handle object escape into the wild.
a61af66fc99e Initial load
duke
parents:
diff changeset
206 assert(result != deleted_handle(), "Used a deleted global handle.");
a61af66fc99e Initial load
duke
parents:
diff changeset
207 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
208 };
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 inline methodOop JNIHandles::resolve_jmethod_id(jmethodID mid) {
a61af66fc99e Initial load
duke
parents:
diff changeset
211 return (methodOop) resolve_non_null((jobject)mid);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 };
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) {
1535
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
215 oop o = resolve_external_guard((jobject) mid);
d3562366cbfd 6949515: 3/3 VM crash when calling GetMethodDeclaringClass
dcubed
parents: 917
diff changeset
216 if (o == NULL || !o->is_method()) {
917
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 0
diff changeset
217 return (methodOop) NULL;
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 0
diff changeset
218 }
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 0
diff changeset
219
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 0
diff changeset
220 return (methodOop) o;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
221 };
a61af66fc99e Initial load
duke
parents:
diff changeset
222
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 inline void JNIHandles::destroy_local(jobject handle) {
a61af66fc99e Initial load
duke
parents:
diff changeset
225 if (handle != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
226 *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it
a61af66fc99e Initial load
duke
parents:
diff changeset
227 }
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
229
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
230 #endif // SHARE_VM_RUNTIME_JNIHANDLES_HPP