86 return CompactingPermGenGen.isSharedReadWrite(handle); 87 } 88 89 // Accessors for declared fields 90 public Mark getMark() { return new Mark(getHandle()); } 91 public Klass getKlass() { 92 if (VM.getVM().isCompressedOopsEnabled()) { 93 return (Klass) compressedKlass.getValue(this); 94 } else { 95 return (Klass) klass.getValue(this); 96 } 97 } 98 99 public boolean isA(Klass k) { 100 return getKlass().isSubtypeOf(k); 101 } 102 103 // Returns the byte size of this object 104 public long getObjectSize() { 105 Klass k = getKlass(); 106 if (k instanceof InstanceKlass) { 107 return ((InstanceKlass)k).getSizeHelper() 108 * VM.getVM().getAddressSize(); 109 } 110 // If it is not an instance, this method should be replaced. 111 return getHeaderSize(); 112 } 113 114 // Type test operations 115 public boolean isInstance() { return false; } 116 public boolean isInstanceRef() { return false; } 117 public boolean isArray() { return false; } 118 public boolean isObjArray() { return false; } 119 public boolean isTypeArray() { return false; } 120 public boolean isSymbol() { return false; } 121 public boolean isKlass() { return false; } 122 public boolean isThread() { return false; } 123 public boolean isMethod() { return false; } 124 public boolean isMethodData() { return false; } 125 public boolean isConstantPool() { return false; } 126 public boolean isConstantPoolCache() { return false; } 127 public boolean isCompiledICHolder() { return false; } 128 129 // Align the object size. 130 public static long alignObjectSize(long size) { 131 return VM.getVM().alignUp(size, VM.getVM().getMinObjAlignmentInBytes()); 132 } | 86 return CompactingPermGenGen.isSharedReadWrite(handle); 87 } 88 89 // Accessors for declared fields 90 public Mark getMark() { return new Mark(getHandle()); } 91 public Klass getKlass() { 92 if (VM.getVM().isCompressedOopsEnabled()) { 93 return (Klass) compressedKlass.getValue(this); 94 } else { 95 return (Klass) klass.getValue(this); 96 } 97 } 98 99 public boolean isA(Klass k) { 100 return getKlass().isSubtypeOf(k); 101 } 102 103 // Returns the byte size of this object 104 public long getObjectSize() { 105 Klass k = getKlass(); 106 // All other types should be overriding getObjectSize directly 107 return ((InstanceKlass)k).getObjectSize(this); 108 } 109 110 // Type test operations 111 public boolean isInstance() { return false; } 112 public boolean isInstanceRef() { return false; } 113 public boolean isArray() { return false; } 114 public boolean isObjArray() { return false; } 115 public boolean isTypeArray() { return false; } 116 public boolean isSymbol() { return false; } 117 public boolean isKlass() { return false; } 118 public boolean isThread() { return false; } 119 public boolean isMethod() { return false; } 120 public boolean isMethodData() { return false; } 121 public boolean isConstantPool() { return false; } 122 public boolean isConstantPoolCache() { return false; } 123 public boolean isCompiledICHolder() { return false; } 124 125 // Align the object size. 126 public static long alignObjectSize(long size) { 127 return VM.getVM().alignUp(size, VM.getVM().getMinObjAlignmentInBytes()); 128 } |