annotate agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 3e8fbc61cee8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1748
diff changeset
2 * Copyright (c) 2000, 2012, 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: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
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: 0
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
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.utilities;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import java.io.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 import sun.jvm.hotspot.code.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
29 import sun.jvm.hotspot.debugger.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
30 import sun.jvm.hotspot.gc_interface.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
31 import sun.jvm.hotspot.interpreter.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 import sun.jvm.hotspot.runtime.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 import sun.jvm.hotspot.memory.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 /** This class attempts to describe possible locations of pointers in
a61af66fc99e Initial load
duke
parents:
diff changeset
36 the VM. */
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 public class PointerLocation {
a61af66fc99e Initial load
duke
parents:
diff changeset
39 //////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // //
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // These are package private to simplify the implementation and //
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // interaction with PointerFinder //
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // //
a61af66fc99e Initial load
duke
parents:
diff changeset
44 //////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 Address addr;
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 CollectedHeap heap;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 Generation gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // If UseTLAB was enabled and the pointer was found in a
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // currently-active TLAB, these will be set
a61af66fc99e Initial load
duke
parents:
diff changeset
53 boolean inTLAB;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 JavaThread tlabThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 ThreadLocalAllocBuffer tlab;
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // Generated code locations
a61af66fc99e Initial load
duke
parents:
diff changeset
58 boolean inInterpreter;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 boolean inCodeCache;
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // FIXME: add other locations like VTableStubs, StubRoutines, maybe
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // even "on thread x's stack"
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 InterpreterCodelet interpreterCodelet;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 CodeBlob blob;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // FIXME: add more detail about CodeBlob
1748
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1552
diff changeset
67 boolean inBlobCode;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
68 boolean inBlobData;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 boolean inBlobOops;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 boolean inBlobUnknownLocation;
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 boolean inStrongGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 boolean inWeakGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 boolean inLocalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 JNIHandleBlock handleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 sun.jvm.hotspot.runtime.Thread handleThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public PointerLocation(Address addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
79 this.addr = addr;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 }
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 public boolean isInHeap() {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1748
diff changeset
83 return (heap != null || (gen != null));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
84 }
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 public boolean isInNewGen() {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 return ((gen != null) && (gen.level() == 0));
a61af66fc99e Initial load
duke
parents:
diff changeset
88 }
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 public boolean isInOldGen() {
a61af66fc99e Initial load
duke
parents:
diff changeset
91 return ((gen != null) && (gen.level() == 1));
a61af66fc99e Initial load
duke
parents:
diff changeset
92 }
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 public boolean inOtherGen() {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1748
diff changeset
95 return (!isInNewGen() && !isInOldGen());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
96 }
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 /** Only valid if isInHeap() */
a61af66fc99e Initial load
duke
parents:
diff changeset
99 public Generation getGeneration() {
a61af66fc99e Initial load
duke
parents:
diff changeset
100 return gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
101 }
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 /** This may be true if isInNewGen is also true */
a61af66fc99e Initial load
duke
parents:
diff changeset
104 public boolean isInTLAB() {
a61af66fc99e Initial load
duke
parents:
diff changeset
105 return inTLAB;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 /** Only valid if isInTLAB() returns true */
a61af66fc99e Initial load
duke
parents:
diff changeset
109 public JavaThread getTLABThread() {
a61af66fc99e Initial load
duke
parents:
diff changeset
110 return tlabThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
111 }
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 /** Only valid if isInTLAB() returns true */
a61af66fc99e Initial load
duke
parents:
diff changeset
114 public ThreadLocalAllocBuffer getTLAB() {
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return tlab;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 public boolean isInInterpreter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return inInterpreter;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 /** For now, only valid if isInInterpreter is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
123 public InterpreterCodelet getInterpreterCodelet() {
a61af66fc99e Initial load
duke
parents:
diff changeset
124 return interpreterCodelet;
a61af66fc99e Initial load
duke
parents:
diff changeset
125 }
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 public boolean isInCodeCache() {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 return inCodeCache;
a61af66fc99e Initial load
duke
parents:
diff changeset
129 }
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 /** For now, only valid if isInCodeCache is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
132 public CodeBlob getCodeBlob() {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 return blob;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }
a61af66fc99e Initial load
duke
parents:
diff changeset
135
1748
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1552
diff changeset
136 public boolean isInBlobCode() {
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1552
diff changeset
137 return inBlobCode;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 public boolean isInBlobData() {
a61af66fc99e Initial load
duke
parents:
diff changeset
141 return inBlobData;
a61af66fc99e Initial load
duke
parents:
diff changeset
142 }
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 public boolean isInBlobOops() {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 return inBlobOops;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 }
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 public boolean isInBlobUnknownLocation() {
a61af66fc99e Initial load
duke
parents:
diff changeset
149 return inBlobUnknownLocation;
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 public boolean isInStrongGlobalJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
153 return inStrongGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
154 }
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 public boolean isInWeakGlobalJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 return inWeakGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
158 }
a61af66fc99e Initial load
duke
parents:
diff changeset
159
a61af66fc99e Initial load
duke
parents:
diff changeset
160 public boolean isInLocalJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
161 return inLocalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
162 }
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 /** Only valid if isInStrongGlobalJNIHandleBlock,
a61af66fc99e Initial load
duke
parents:
diff changeset
165 isInWeakGlobalJNIHandleBlock, or isInLocalJNIHandleBlock is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
166 public JNIHandleBlock getJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 return handleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
168 }
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 /** Only valid if isInLocalJNIHandleBlock is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
171 public sun.jvm.hotspot.runtime.Thread getJNIHandleThread() {
a61af66fc99e Initial load
duke
parents:
diff changeset
172 return handleThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 public boolean isUnknown() {
a61af66fc99e Initial load
duke
parents:
diff changeset
176 return (!(isInHeap() || isInInterpreter() || isInCodeCache() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
177 isInStrongGlobalJNIHandleBlock() || isInWeakGlobalJNIHandleBlock() || isInLocalJNIHandleBlock()));
a61af66fc99e Initial load
duke
parents:
diff changeset
178 }
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 public String toString() {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 ByteArrayOutputStream bos = new ByteArrayOutputStream();
a61af66fc99e Initial load
duke
parents:
diff changeset
182 printOn(new PrintStream(bos));
a61af66fc99e Initial load
duke
parents:
diff changeset
183 return bos.toString();
a61af66fc99e Initial load
duke
parents:
diff changeset
184 }
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 public void print() {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 printOn(System.out);
a61af66fc99e Initial load
duke
parents:
diff changeset
188 }
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 public void printOn(PrintStream tty) {
a61af66fc99e Initial load
duke
parents:
diff changeset
191 tty.print("Address ");
a61af66fc99e Initial load
duke
parents:
diff changeset
192 if (addr == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
193 tty.print("0x0");
a61af66fc99e Initial load
duke
parents:
diff changeset
194 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
195 tty.print(addr.toString());
a61af66fc99e Initial load
duke
parents:
diff changeset
196 }
a61af66fc99e Initial load
duke
parents:
diff changeset
197 tty.print(": ");
a61af66fc99e Initial load
duke
parents:
diff changeset
198 if (isInHeap()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
199 if (isInTLAB()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 tty.print("In thread-local allocation buffer for thread \"" +
a61af66fc99e Initial load
duke
parents:
diff changeset
201 getTLABThread().getThreadName() + "\" (");
a61af66fc99e Initial load
duke
parents:
diff changeset
202 getTLABThread().printThreadIDOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
203 tty.print(") ");
a61af66fc99e Initial load
duke
parents:
diff changeset
204 getTLAB().printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
205 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
206 if (isInNewGen()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
207 tty.print("In new generation ");
a61af66fc99e Initial load
duke
parents:
diff changeset
208 } else if (isInOldGen()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
209 tty.print("In old generation ");
a61af66fc99e Initial load
duke
parents:
diff changeset
210 } else if (gen != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
211 tty.print("In Generation " + getGeneration().level());
a61af66fc99e Initial load
duke
parents:
diff changeset
212 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
213 tty.print("In unknown section of Java heap");
a61af66fc99e Initial load
duke
parents:
diff changeset
214 }
a61af66fc99e Initial load
duke
parents:
diff changeset
215 if (getGeneration() != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 getGeneration().printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
217 }
a61af66fc99e Initial load
duke
parents:
diff changeset
218 }
a61af66fc99e Initial load
duke
parents:
diff changeset
219 } else if (isInInterpreter()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 tty.println("In interpreter codelet \"" + interpreterCodelet.getDescription() + "\"");
a61af66fc99e Initial load
duke
parents:
diff changeset
221 interpreterCodelet.printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
222 } else if (isInCodeCache()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 CodeBlob b = getCodeBlob();
a61af66fc99e Initial load
duke
parents:
diff changeset
224 tty.print("In ");
1748
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1552
diff changeset
225 if (isInBlobCode()) {
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1552
diff changeset
226 tty.print("code");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
227 } else if (isInBlobData()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 tty.print("data");
a61af66fc99e Initial load
duke
parents:
diff changeset
229 } else if (isInBlobOops()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 tty.print("oops");
a61af66fc99e Initial load
duke
parents:
diff changeset
231 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
233 Assert.that(isInBlobUnknownLocation(), "Should have known location in CodeBlob");
a61af66fc99e Initial load
duke
parents:
diff changeset
234 }
a61af66fc99e Initial load
duke
parents:
diff changeset
235 tty.print("unknown location");
a61af66fc99e Initial load
duke
parents:
diff changeset
236 }
a61af66fc99e Initial load
duke
parents:
diff changeset
237 tty.print(" in ");
a61af66fc99e Initial load
duke
parents:
diff changeset
238 b.printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 // FIXME: add more detail
a61af66fc99e Initial load
duke
parents:
diff changeset
241 } else if (isInStrongGlobalJNIHandleBlock() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
242 isInWeakGlobalJNIHandleBlock() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
243 isInLocalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
244 tty.print("In ");
a61af66fc99e Initial load
duke
parents:
diff changeset
245 if (isInStrongGlobalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
246 tty.print("strong global");
a61af66fc99e Initial load
duke
parents:
diff changeset
247 } else if (isInWeakGlobalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
248 tty.print("weak global");
a61af66fc99e Initial load
duke
parents:
diff changeset
249 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
250 tty.print("thread-local");
a61af66fc99e Initial load
duke
parents:
diff changeset
251 }
a61af66fc99e Initial load
duke
parents:
diff changeset
252 tty.print(" JNI handle block (" + handleBlock.top() + " handle slots present)");
a61af66fc99e Initial load
duke
parents:
diff changeset
253 if (isInLocalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
254 if (handleThread.isJavaThread()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
255 tty.print(" for JavaThread ");
a61af66fc99e Initial load
duke
parents:
diff changeset
256 ((JavaThread) handleThread).printThreadIDOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
257 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
258 tty.print("for a non-Java Thread");
a61af66fc99e Initial load
duke
parents:
diff changeset
259 }
a61af66fc99e Initial load
duke
parents:
diff changeset
260 }
a61af66fc99e Initial load
duke
parents:
diff changeset
261 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
262 // This must be last
a61af66fc99e Initial load
duke
parents:
diff changeset
263 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
264 Assert.that(isUnknown(), "Should have unknown location");
a61af66fc99e Initial load
duke
parents:
diff changeset
265 }
a61af66fc99e Initial load
duke
parents:
diff changeset
266 tty.print("In unknown location");
a61af66fc99e Initial load
duke
parents:
diff changeset
267 }
a61af66fc99e Initial load
duke
parents:
diff changeset
268 }
a61af66fc99e Initial load
duke
parents:
diff changeset
269 }