Skip to content
Permalink
Browse files
8271229: [lworld] Test serviceability/sa/ClhsdbDumpclass.java fails w…
…ith unexpected end of file

Reviewed-by: dsimms
  • Loading branch information
fparain committed Jul 27, 2021
1 parent 865c6b5 commit 702f1baf114ac27a8456415127b349469bd46748
@@ -2310,6 +2310,8 @@ typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
declare_constant(InstanceKlass::_misc_is_shared_app_class) \
declare_constant(InstanceKlass::_misc_invalid_inline_super) \
declare_constant(InstanceKlass::_misc_invalid_identity_super) \
declare_constant(InstanceKlass::_misc_has_injected_primitiveObject) \
declare_constant(InstanceKlass::_misc_has_injected_identityObject) \
\
/*********************************/ \
/* Symbol* - symbol max length */ \
@@ -78,6 +78,8 @@ public void update(Observable o, Object data) {
private static int MISC_IS_SHARED_BOOT_CLASS;
private static int MISC_IS_SHARED_PLATFORM_CLASS;
private static int MISC_IS_SHARED_APP_CLASS;
private static int MISC_HAS_INJECTED_PRIMITIVEOBJECT;
private static int MISC_HAS_INJECTED_IDENTITYOBJECT;

private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("InstanceKlass");
@@ -135,6 +137,8 @@ private static synchronized void initialize(TypeDataBase db) throws WrongTypeExc
MISC_IS_SHARED_BOOT_CLASS = db.lookupIntConstant("InstanceKlass::_misc_is_shared_boot_class").intValue();
MISC_IS_SHARED_PLATFORM_CLASS = db.lookupIntConstant("InstanceKlass::_misc_is_shared_platform_class").intValue();
MISC_IS_SHARED_APP_CLASS = db.lookupIntConstant("InstanceKlass::_misc_is_shared_app_class").intValue();
MISC_HAS_INJECTED_PRIMITIVEOBJECT = db.lookupIntConstant("InstanceKlass::_misc_has_injected_primitiveObject").intValue();
MISC_HAS_INJECTED_IDENTITYOBJECT = db.lookupIntConstant("InstanceKlass::_misc_has_injected_identityObject").intValue();
}

public InstanceKlass(Address addr) {
@@ -569,6 +573,14 @@ private boolean isInInnerClasses(Symbol sym, boolean includeLocals) {
}
}

public boolean hasInjectedIdentityObject() {
return (getMiscFlags() & MISC_HAS_INJECTED_IDENTITYOBJECT) != 0;
}

public boolean hasInjectedPrimitiveObject() {
return (getMiscFlags() & MISC_HAS_INJECTED_PRIMITIVEOBJECT) != 0;
}

public boolean implementsInterface(Klass k) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(k.isInterface(), "should not reach here");
@@ -352,11 +352,15 @@ protected void writeSuperClass() throws IOException {
protected void writeInterfaces() throws IOException {
KlassArray interfaces = klass.getLocalInterfaces();
final int len = interfaces.length();
int nb_interfaces = len;
if (klass.hasInjectedIdentityObject() || klass.hasInjectedPrimitiveObject()) {
nb_interfaces--;
}

if (DEBUG) debugMessage("number of interfaces = " + len);
if (DEBUG) debugMessage("number of interfaces = " + nb_interfaces);

// write interfaces count
dos.writeShort((short) len);
dos.writeShort((short) nb_interfaces);
for (int i = 0; i < len; i++) {
Klass k = interfaces.getAt(i);
Short index = (Short) classToIndex.get(k.getName().asString());

0 comments on commit 702f1ba

Please sign in to comment.