Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8271229: [lworld] Test serviceability/sa/ClhsdbDumpclass.java fails with unexpected end of file #498

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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());