1 /*
2 * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
81 }
82 }
83
84 Interpreter interp = VM.getVM().getInterpreter();
85 if (interp.contains(a)) {
86 loc.inInterpreter = true;
87 loc.interpreterCodelet = interp.getCodeletContaining(a);
88 return loc;
89 }
90
91 if (!VM.getVM().isCore()) {
92 CodeCache c = VM.getVM().getCodeCache();
93 if (c.contains(a)) {
94 loc.inCodeCache = true;
95 loc.blob = c.findBlobUnsafe(a);
96 if (Assert.ASSERTS_ENABLED) {
97 Assert.that(loc.blob != null, "Should have found CodeBlob");
98 }
99 loc.inBlobInstructions = loc.blob.instructionsContains(a);
100 loc.inBlobData = loc.blob.dataContains(a);
101 loc.inBlobOops = loc.blob.oopsContains(a);
102 loc.inBlobUnknownLocation = (!(loc.inBlobInstructions ||
103 loc.inBlobData ||
104 loc.inBlobOops));
105 return loc;
106 }
107 }
108
109 // Check JNIHandles; both local and global
110 JNIHandles handles = VM.getVM().getJNIHandles();
111 JNIHandleBlock handleBlock = handles.globalHandles();
112 if (handleBlock != null) {
113 handleBlock = handleBlock.blockContainingHandle(a);
114 }
115 if (handleBlock != null) {
116 loc.inStrongGlobalJNIHandleBlock = true;
117 loc.handleBlock = handleBlock;
118 return loc;
119 } else {
120 handleBlock = handles.weakGlobalHandles();
121 if (handleBlock != null) {
|
1 /*
2 * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
81 }
82 }
83
84 Interpreter interp = VM.getVM().getInterpreter();
85 if (interp.contains(a)) {
86 loc.inInterpreter = true;
87 loc.interpreterCodelet = interp.getCodeletContaining(a);
88 return loc;
89 }
90
91 if (!VM.getVM().isCore()) {
92 CodeCache c = VM.getVM().getCodeCache();
93 if (c.contains(a)) {
94 loc.inCodeCache = true;
95 loc.blob = c.findBlobUnsafe(a);
96 if (Assert.ASSERTS_ENABLED) {
97 Assert.that(loc.blob != null, "Should have found CodeBlob");
98 }
99 loc.inBlobInstructions = loc.blob.instructionsContains(a);
100 loc.inBlobData = loc.blob.dataContains(a);
101
102 if (loc.blob.isNMethod()) {
103 NMethod nm = (NMethod) loc.blob;
104 loc.inBlobOops = nm.oopsContains(a);
105 }
106
107 loc.inBlobUnknownLocation = (!(loc.inBlobInstructions ||
108 loc.inBlobData ||
109 loc.inBlobOops));
110 return loc;
111 }
112 }
113
114 // Check JNIHandles; both local and global
115 JNIHandles handles = VM.getVM().getJNIHandles();
116 JNIHandleBlock handleBlock = handles.globalHandles();
117 if (handleBlock != null) {
118 handleBlock = handleBlock.blockContainingHandle(a);
119 }
120 if (handleBlock != null) {
121 loc.inStrongGlobalJNIHandleBlock = true;
122 loc.handleBlock = handleBlock;
123 return loc;
124 } else {
125 handleBlock = handles.weakGlobalHandles();
126 if (handleBlock != null) {
|