47 typeSize = type.getSize();
48 }
49
50 Instance(OopHandle handle, ObjectHeap heap) {
51 super(handle, heap);
52 }
53
54 // Returns header size in bytes.
55 public static long getHeaderSize() {
56 if (VM.getVM().isCompressedOopsEnabled()) {
57 return typeSize - VM.getVM().getIntSize();
58 } else {
59 return typeSize;
60 }
61 }
62
63 public boolean isInstance() { return true; }
64
65 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
66 super.iterateFields(visitor, doVMFields);
67 ((InstanceKlass) getKlass()).iterateNonStaticFields(visitor);
68 }
69
70 public void printValueOn(PrintStream tty) {
71 // Special-case strings.
72 // FIXME: would like to do this in more type-safe fashion (need
73 // SystemDictionary analogue)
74 if (getKlass().getName().asString().equals("java/lang/String")) {
75 tty.print("\"" + OopUtilities.stringOopToString(this) + "\"");
76 } else {
77 super.printValueOn(tty);
78 }
79 }
80 }
|
47 typeSize = type.getSize();
48 }
49
50 Instance(OopHandle handle, ObjectHeap heap) {
51 super(handle, heap);
52 }
53
54 // Returns header size in bytes.
55 public static long getHeaderSize() {
56 if (VM.getVM().isCompressedOopsEnabled()) {
57 return typeSize - VM.getVM().getIntSize();
58 } else {
59 return typeSize;
60 }
61 }
62
63 public boolean isInstance() { return true; }
64
65 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
66 super.iterateFields(visitor, doVMFields);
67 ((InstanceKlass) getKlass()).iterateNonStaticFields(visitor, this);
68 }
69
70 public void printValueOn(PrintStream tty) {
71 // Special-case strings.
72 // FIXME: would like to do this in more type-safe fashion (need
73 // SystemDictionary analogue)
74 if (getKlass().getName().asString().equals("java/lang/String")) {
75 tty.print("\"" + OopUtilities.stringOopToString(this) + "\"");
76 } else {
77 super.printValueOn(tty);
78 }
79 }
80 }
|