annotate agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java @ 0:a61af66fc99e jdk7-b24

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved.
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 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
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 Generation permGen;
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // If UseTLAB was enabled and the pointer was found in a
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // currently-active TLAB, these will be set
a61af66fc99e Initial load
duke
parents:
diff changeset
54 boolean inTLAB;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 JavaThread tlabThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 ThreadLocalAllocBuffer tlab;
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // Generated code locations
a61af66fc99e Initial load
duke
parents:
diff changeset
59 boolean inInterpreter;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 boolean inCodeCache;
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // FIXME: add other locations like VTableStubs, StubRoutines, maybe
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // even "on thread x's stack"
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 InterpreterCodelet interpreterCodelet;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 CodeBlob blob;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // FIXME: add more detail about CodeBlob
a61af66fc99e Initial load
duke
parents:
diff changeset
68 boolean inBlobInstructions;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 boolean inBlobData;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 boolean inBlobOops;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 boolean inBlobUnknownLocation;
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 boolean inStrongGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 boolean inWeakGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 boolean inLocalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 JNIHandleBlock handleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 sun.jvm.hotspot.runtime.Thread handleThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 public PointerLocation(Address addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
80 this.addr = addr;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 }
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 public boolean isInHeap() {
a61af66fc99e Initial load
duke
parents:
diff changeset
84 return (heap != null || (gen != null) || (permGen != null));
a61af66fc99e Initial load
duke
parents:
diff changeset
85 }
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 public boolean isInNewGen() {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 return ((gen != null) && (gen.level() == 0));
a61af66fc99e Initial load
duke
parents:
diff changeset
89 }
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 public boolean isInOldGen() {
a61af66fc99e Initial load
duke
parents:
diff changeset
92 return ((gen != null) && (gen.level() == 1));
a61af66fc99e Initial load
duke
parents:
diff changeset
93 }
a61af66fc99e Initial load
duke
parents:
diff changeset
94
a61af66fc99e Initial load
duke
parents:
diff changeset
95 public boolean isInPermGen() {
a61af66fc99e Initial load
duke
parents:
diff changeset
96 return (permGen != null);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 }
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 public boolean inOtherGen() {
a61af66fc99e Initial load
duke
parents:
diff changeset
100 return (!isInNewGen() && !isInOldGen() && !isInPermGen());
a61af66fc99e Initial load
duke
parents:
diff changeset
101 }
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 /** Only valid if isInHeap() */
a61af66fc99e Initial load
duke
parents:
diff changeset
104 public Generation getGeneration() {
a61af66fc99e Initial load
duke
parents:
diff changeset
105 if (gen != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 return gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
107 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
108 return permGen;
a61af66fc99e Initial load
duke
parents:
diff changeset
109 }
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 /** This may be true if isInNewGen is also true */
a61af66fc99e Initial load
duke
parents:
diff changeset
113 public boolean isInTLAB() {
a61af66fc99e Initial load
duke
parents:
diff changeset
114 return inTLAB;
a61af66fc99e Initial load
duke
parents:
diff changeset
115 }
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 /** Only valid if isInTLAB() returns true */
a61af66fc99e Initial load
duke
parents:
diff changeset
118 public JavaThread getTLABThread() {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return tlabThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 /** Only valid if isInTLAB() returns true */
a61af66fc99e Initial load
duke
parents:
diff changeset
123 public ThreadLocalAllocBuffer getTLAB() {
a61af66fc99e Initial load
duke
parents:
diff changeset
124 return tlab;
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 isInInterpreter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 return inInterpreter;
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 isInInterpreter is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
132 public InterpreterCodelet getInterpreterCodelet() {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 return interpreterCodelet;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 public boolean isInCodeCache() {
a61af66fc99e Initial load
duke
parents:
diff changeset
137 return inCodeCache;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 /** For now, only valid if isInCodeCache is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
141 public CodeBlob getCodeBlob() {
a61af66fc99e Initial load
duke
parents:
diff changeset
142 return blob;
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 public boolean isInBlobInstructions() {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 return inBlobInstructions;
a61af66fc99e Initial load
duke
parents:
diff changeset
147 }
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 public boolean isInBlobData() {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 return inBlobData;
a61af66fc99e Initial load
duke
parents:
diff changeset
151 }
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 public boolean isInBlobOops() {
a61af66fc99e Initial load
duke
parents:
diff changeset
154 return inBlobOops;
a61af66fc99e Initial load
duke
parents:
diff changeset
155 }
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 public boolean isInBlobUnknownLocation() {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 return inBlobUnknownLocation;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 }
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 public boolean isInStrongGlobalJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
162 return inStrongGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
163 }
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 public boolean isInWeakGlobalJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
166 return inWeakGlobalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
167 }
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 public boolean isInLocalJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 return inLocalJNIHandleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 /** Only valid if isInStrongGlobalJNIHandleBlock,
a61af66fc99e Initial load
duke
parents:
diff changeset
174 isInWeakGlobalJNIHandleBlock, or isInLocalJNIHandleBlock is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
175 public JNIHandleBlock getJNIHandleBlock() {
a61af66fc99e Initial load
duke
parents:
diff changeset
176 return handleBlock;
a61af66fc99e Initial load
duke
parents:
diff changeset
177 }
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 /** Only valid if isInLocalJNIHandleBlock is true */
a61af66fc99e Initial load
duke
parents:
diff changeset
180 public sun.jvm.hotspot.runtime.Thread getJNIHandleThread() {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 return handleThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
182 }
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 public boolean isUnknown() {
a61af66fc99e Initial load
duke
parents:
diff changeset
185 return (!(isInHeap() || isInInterpreter() || isInCodeCache() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
186 isInStrongGlobalJNIHandleBlock() || isInWeakGlobalJNIHandleBlock() || isInLocalJNIHandleBlock()));
a61af66fc99e Initial load
duke
parents:
diff changeset
187 }
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 public String toString() {
a61af66fc99e Initial load
duke
parents:
diff changeset
190 ByteArrayOutputStream bos = new ByteArrayOutputStream();
a61af66fc99e Initial load
duke
parents:
diff changeset
191 printOn(new PrintStream(bos));
a61af66fc99e Initial load
duke
parents:
diff changeset
192 return bos.toString();
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 public void print() {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 printOn(System.out);
a61af66fc99e Initial load
duke
parents:
diff changeset
197 }
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 public void printOn(PrintStream tty) {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 tty.print("Address ");
a61af66fc99e Initial load
duke
parents:
diff changeset
201 if (addr == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
202 tty.print("0x0");
a61af66fc99e Initial load
duke
parents:
diff changeset
203 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
204 tty.print(addr.toString());
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206 tty.print(": ");
a61af66fc99e Initial load
duke
parents:
diff changeset
207 if (isInHeap()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
208 if (isInTLAB()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
209 tty.print("In thread-local allocation buffer for thread \"" +
a61af66fc99e Initial load
duke
parents:
diff changeset
210 getTLABThread().getThreadName() + "\" (");
a61af66fc99e Initial load
duke
parents:
diff changeset
211 getTLABThread().printThreadIDOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 tty.print(") ");
a61af66fc99e Initial load
duke
parents:
diff changeset
213 getTLAB().printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
214 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
215 if (isInNewGen()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 tty.print("In new generation ");
a61af66fc99e Initial load
duke
parents:
diff changeset
217 } else if (isInOldGen()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
218 tty.print("In old generation ");
a61af66fc99e Initial load
duke
parents:
diff changeset
219 } else if (isInPermGen()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 tty.print("In perm generation ");
a61af66fc99e Initial load
duke
parents:
diff changeset
221 } else if (gen != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 tty.print("In Generation " + getGeneration().level());
a61af66fc99e Initial load
duke
parents:
diff changeset
223 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
224 tty.print("In unknown section of Java heap");
a61af66fc99e Initial load
duke
parents:
diff changeset
225 }
a61af66fc99e Initial load
duke
parents:
diff changeset
226 if (getGeneration() != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 getGeneration().printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 }
a61af66fc99e Initial load
duke
parents:
diff changeset
230 } else if (isInInterpreter()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
231 tty.println("In interpreter codelet \"" + interpreterCodelet.getDescription() + "\"");
a61af66fc99e Initial load
duke
parents:
diff changeset
232 interpreterCodelet.printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 } else if (isInCodeCache()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
234 CodeBlob b = getCodeBlob();
a61af66fc99e Initial load
duke
parents:
diff changeset
235 tty.print("In ");
a61af66fc99e Initial load
duke
parents:
diff changeset
236 if (isInBlobInstructions()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
237 tty.print("instructions");
a61af66fc99e Initial load
duke
parents:
diff changeset
238 } else if (isInBlobData()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
239 tty.print("data");
a61af66fc99e Initial load
duke
parents:
diff changeset
240 } else if (isInBlobOops()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
241 tty.print("oops");
a61af66fc99e Initial load
duke
parents:
diff changeset
242 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
243 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
244 Assert.that(isInBlobUnknownLocation(), "Should have known location in CodeBlob");
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246 tty.print("unknown location");
a61af66fc99e Initial load
duke
parents:
diff changeset
247 }
a61af66fc99e Initial load
duke
parents:
diff changeset
248 tty.print(" in ");
a61af66fc99e Initial load
duke
parents:
diff changeset
249 b.printOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
250
a61af66fc99e Initial load
duke
parents:
diff changeset
251 // FIXME: add more detail
a61af66fc99e Initial load
duke
parents:
diff changeset
252 } else if (isInStrongGlobalJNIHandleBlock() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
253 isInWeakGlobalJNIHandleBlock() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
254 isInLocalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
255 tty.print("In ");
a61af66fc99e Initial load
duke
parents:
diff changeset
256 if (isInStrongGlobalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
257 tty.print("strong global");
a61af66fc99e Initial load
duke
parents:
diff changeset
258 } else if (isInWeakGlobalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
259 tty.print("weak global");
a61af66fc99e Initial load
duke
parents:
diff changeset
260 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
261 tty.print("thread-local");
a61af66fc99e Initial load
duke
parents:
diff changeset
262 }
a61af66fc99e Initial load
duke
parents:
diff changeset
263 tty.print(" JNI handle block (" + handleBlock.top() + " handle slots present)");
a61af66fc99e Initial load
duke
parents:
diff changeset
264 if (isInLocalJNIHandleBlock()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
265 if (handleThread.isJavaThread()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
266 tty.print(" for JavaThread ");
a61af66fc99e Initial load
duke
parents:
diff changeset
267 ((JavaThread) handleThread).printThreadIDOn(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
268 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
269 tty.print("for a non-Java Thread");
a61af66fc99e Initial load
duke
parents:
diff changeset
270 }
a61af66fc99e Initial load
duke
parents:
diff changeset
271 }
a61af66fc99e Initial load
duke
parents:
diff changeset
272 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
273 // This must be last
a61af66fc99e Initial load
duke
parents:
diff changeset
274 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
275 Assert.that(isUnknown(), "Should have unknown location");
a61af66fc99e Initial load
duke
parents:
diff changeset
276 }
a61af66fc99e Initial load
duke
parents:
diff changeset
277 tty.print("In unknown location");
a61af66fc99e Initial load
duke
parents:
diff changeset
278 }
a61af66fc99e Initial load
duke
parents:
diff changeset
279 }
a61af66fc99e Initial load
duke
parents:
diff changeset
280 }