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 *
23 */
24
25 package sun.jvm.hotspot;
26
27 import java.io.*;
28 import java.awt.*;
29 import java.awt.event.*;
30 import javax.swing.*;
31 import java.util.*;
32
33 import sun.jvm.hotspot.code.*;
34 import sun.jvm.hotspot.compiler.*;
35 import sun.jvm.hotspot.debugger.*;
36 import sun.jvm.hotspot.gc.epsilon.*;
37 import sun.jvm.hotspot.gc.parallel.*;
38 import sun.jvm.hotspot.gc.shared.*;
39 import sun.jvm.hotspot.gc.g1.*;
40 import sun.jvm.hotspot.gc.z.*;
41 import sun.jvm.hotspot.interpreter.*;
42 import sun.jvm.hotspot.memory.*;
43 import sun.jvm.hotspot.oops.*;
44 import sun.jvm.hotspot.runtime.*;
45 import sun.jvm.hotspot.ui.*;
46 import sun.jvm.hotspot.ui.tree.*;
47 import sun.jvm.hotspot.ui.classbrowser.*;
48 import sun.jvm.hotspot.utilities.*;
49
50 /** The top-level HotSpot Debugger. FIXME: make this an embeddable
51 component! (Among other things, figure out what to do with the
52 menu bar...) */
53
54 public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
55 public static void main(String[] args) {
56 new HSDB(args).run();
57 }
58
1095 anno = "Humongous ";
1096 bad = false;
1097 } else if (region.isPinned()) {
1098 anno = "Pinned ";
1099 bad = false;
1100 } else if (region.isOld()) {
1101 anno = "Old ";
1102 bad = false;
1103 }
1104 } else if (collHeap instanceof ParallelScavengeHeap) {
1105 ParallelScavengeHeap heap = (ParallelScavengeHeap) collHeap;
1106 if (heap.youngGen().isIn(handle)) {
1107 anno = "PSYoungGen ";
1108 bad = false;
1109 } else if (heap.oldGen().isIn(handle)) {
1110 anno = "PSOldGen ";
1111 bad = false;
1112 }
1113 } else if (collHeap instanceof EpsilonHeap) {
1114 anno = "Epsilon ";
1115 bad = false;
1116 } else if (collHeap instanceof ZCollectedHeap) {
1117 ZCollectedHeap heap = (ZCollectedHeap) collHeap;
1118 anno = "ZHeap ";
1119 bad = false;
1120 } else {
1121 // Optimistically assume the oop isn't bad
1122 anno = "[Unknown generation] ";
1123 bad = false;
1124 }
1125
1126 if (!bad) {
1127 try {
1128 Oop oop = VM.getVM().getObjectHeap().newOop(handle);
1129 if (oop instanceof Instance) {
1130 // Java-level objects always have workable names
1131 anno = anno + oop.getKlass().getName().asString();
1132 } else {
1133 ByteArrayOutputStream bos = new ByteArrayOutputStream();
1134 Oop.printOopValueOn(oop, new PrintStream(bos));
|
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 *
23 */
24
25 package sun.jvm.hotspot;
26
27 import java.io.*;
28 import java.awt.*;
29 import java.awt.event.*;
30 import javax.swing.*;
31 import java.util.*;
32
33 import sun.jvm.hotspot.code.*;
34 import sun.jvm.hotspot.compiler.*;
35 import sun.jvm.hotspot.debugger.*;
36 import sun.jvm.hotspot.gc.epsilon.*;
37 import sun.jvm.hotspot.gc.parallel.*;
38 import sun.jvm.hotspot.gc.shared.*;
39 import sun.jvm.hotspot.gc.shenandoah.*;
40 import sun.jvm.hotspot.gc.g1.*;
41 import sun.jvm.hotspot.gc.z.*;
42 import sun.jvm.hotspot.interpreter.*;
43 import sun.jvm.hotspot.memory.*;
44 import sun.jvm.hotspot.oops.*;
45 import sun.jvm.hotspot.runtime.*;
46 import sun.jvm.hotspot.ui.*;
47 import sun.jvm.hotspot.ui.tree.*;
48 import sun.jvm.hotspot.ui.classbrowser.*;
49 import sun.jvm.hotspot.utilities.*;
50
51 /** The top-level HotSpot Debugger. FIXME: make this an embeddable
52 component! (Among other things, figure out what to do with the
53 menu bar...) */
54
55 public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
56 public static void main(String[] args) {
57 new HSDB(args).run();
58 }
59
1096 anno = "Humongous ";
1097 bad = false;
1098 } else if (region.isPinned()) {
1099 anno = "Pinned ";
1100 bad = false;
1101 } else if (region.isOld()) {
1102 anno = "Old ";
1103 bad = false;
1104 }
1105 } else if (collHeap instanceof ParallelScavengeHeap) {
1106 ParallelScavengeHeap heap = (ParallelScavengeHeap) collHeap;
1107 if (heap.youngGen().isIn(handle)) {
1108 anno = "PSYoungGen ";
1109 bad = false;
1110 } else if (heap.oldGen().isIn(handle)) {
1111 anno = "PSOldGen ";
1112 bad = false;
1113 }
1114 } else if (collHeap instanceof EpsilonHeap) {
1115 anno = "Epsilon ";
1116 bad = false;
1117 } else if (collHeap instanceof ShenandoahHeap) {
1118 ShenandoahHeap heap = (ShenandoahHeap) collHeap;
1119 anno = "ShenandoahHeap ";
1120 bad = false;
1121 } else if (collHeap instanceof ZCollectedHeap) {
1122 ZCollectedHeap heap = (ZCollectedHeap) collHeap;
1123 anno = "ZHeap ";
1124 bad = false;
1125 } else {
1126 // Optimistically assume the oop isn't bad
1127 anno = "[Unknown generation] ";
1128 bad = false;
1129 }
1130
1131 if (!bad) {
1132 try {
1133 Oop oop = VM.getVM().getObjectHeap().newOop(handle);
1134 if (oop instanceof Instance) {
1135 // Java-level objects always have workable names
1136 anno = anno + oop.getKlass().getName().asString();
1137 } else {
1138 ByteArrayOutputStream bos = new ByteArrayOutputStream();
1139 Oop.printOopValueOn(oop, new PrintStream(bos));
|