1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
185 try {
186 tty.print("Oop for " + getKlass().getName().asString());
187 } catch (java.lang.NullPointerException e) {
188 tty.print("Oop");
189 }
190 }
191
192 public void printRawOn(PrintStream tty) {
193 tty.print("Dumping raw memory for ");
194 printValueOn(tty);
195 tty.println();
196 long size = getObjectSize() * 4;
197 for (long i = 0; i < size; i += 4) {
198 long memVal = getHandle().getCIntegerAt(i, 4, true);
199 tty.println(Long.toHexString(memVal));
200 }
201 }
202
203 public boolean verify() { return true;}
204
205 // Package-private routine to speed up ObjectHeap.newOop
206 static Klass getKlassForOopHandle(OopHandle handle) {
207 if (handle == null) {
208 return null;
209 }
210 if (VM.getVM().isCompressedKlassPointersEnabled()) {
211 return (Klass)Metadata.instantiateWrapperFor(handle.getCompKlassAddressAt(compressedKlass.getOffset()));
212 } else {
213 return (Klass)Metadata.instantiateWrapperFor(handle.getAddressAt(klass.getOffset()));
214 }
215 }
216 };
|
1 /*
2 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
185 try {
186 tty.print("Oop for " + getKlass().getName().asString());
187 } catch (java.lang.NullPointerException e) {
188 tty.print("Oop");
189 }
190 }
191
192 public void printRawOn(PrintStream tty) {
193 tty.print("Dumping raw memory for ");
194 printValueOn(tty);
195 tty.println();
196 long size = getObjectSize() * 4;
197 for (long i = 0; i < size; i += 4) {
198 long memVal = getHandle().getCIntegerAt(i, 4, true);
199 tty.println(Long.toHexString(memVal));
200 }
201 }
202
203 public boolean verify() { return true;}
204
205 public static Klass getKlassForOopHandle(OopHandle handle) {
206 if (handle == null) {
207 return null;
208 }
209 if (VM.getVM().isCompressedKlassPointersEnabled()) {
210 return (Klass)Metadata.instantiateWrapperFor(handle.getCompKlassAddressAt(compressedKlass.getOffset()));
211 } else {
212 return (Klass)Metadata.instantiateWrapperFor(handle.getAddressAt(klass.getOffset()));
213 }
214 }
215 };
|