Skip to content

Commit

Permalink
Merge pull request #18042 from theresa-m/nr_ddr
Browse files Browse the repository at this point in the history
DDR support for Valhalla NullRestricted attribute
  • Loading branch information
keithc-ca authored Sep 1, 2023
2 parents 9707c07 + 80418e5 commit c46b260
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ J9Consts.J9_ITABLE_OFFSET_VIRTUAL = 0

J9DescriptionBits.J9DescriptionCpBsmIndexMask = 0

J9FieldFlags.J9FieldFlagIsNullRestricted = 0

J9JavaAccessFlags.J9AccClassIsUnmodifiable = 0
J9JavaAccessFlags.J9AccRecord = 0
J9JavaAccessFlags.J9AccSealed = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ public static void j9bcutil_dumpRomMethod(PrintStream out, J9ROMMethodPointer ro
* -ACC_TRANSIENT
* -ACC_SYNTHETIC
* -ACC_ENUM
* -J9FieldFlagConstant
* -J9FieldFlagIsNullRestricted
*
* :: METHODPARAMETERS ::
* -ACC_FINAL
Expand Down Expand Up @@ -261,7 +263,7 @@ private static void dumpModifiers(PrintStream out, long modifiers, int modifierS
if (ONLY_SPEC_MODIFIERS == modScope) {
modifiers &= J9CfrClassFile.CFR_FIELD_ACCESS_MASK;
} else {
modifiers &= J9CfrClassFile.CFR_FIELD_ACCESS_MASK | J9FieldFlags.J9FieldFlagConstant;
modifiers &= J9CfrClassFile.CFR_FIELD_ACCESS_MASK | J9FieldFlags.J9FieldFlagConstant | J9FieldFlags.J9FieldFlagIsNullRestricted;
}
break;

Expand Down Expand Up @@ -311,6 +313,10 @@ private static void dumpModifiers(PrintStream out, long modifiers, int modifierS
out.append("(constant) ");
modifiers &= ~J9FieldFlags.J9FieldFlagConstant;
}
if ((modifiers & J9FieldFlags.J9FieldFlagIsNullRestricted) != 0) {
out.append("(NullRestricted) ");
modifiers &= ~J9FieldFlags.J9FieldFlagIsNullRestricted;
}
}
}

Expand Down Expand Up @@ -709,15 +715,15 @@ private static void dumpRomField(PrintStream out, J9ROMFieldShapePointer romFiel
out.append(" Name: " + J9UTF8Helper.stringValue(romField.nameAndSignature().name()) + nl);
out.append(" Signature: " + J9UTF8Helper.stringValue(romField.nameAndSignature().signature()) + nl);
out.append(String.format(" Access Flags (%s): ", Long.toHexString(romField.modifiers().longValue())));
dumpModifiers(out, romField.modifiers().longValue(), MODIFIERSOURCE_FIELD, ONLY_SPEC_MODIFIERS);
dumpModifiers(out, romField.modifiers().longValue(), MODIFIERSOURCE_FIELD, INCLUDE_INTERNAL_MODIFIERS);
out.append(nl);
}

private static void dumpRomStaticField(PrintStream out, J9ROMFieldShapePointer romStatic, long flags) throws CorruptDataException {
out.append(" Name: " + J9UTF8Helper.stringValue(romStatic.nameAndSignature().name()) + nl);
out.append(" Signature: " + J9UTF8Helper.stringValue(romStatic.nameAndSignature().signature()) + nl);
out.append(String.format(" Access Flags (%s): ", Long.toHexString(romStatic.modifiers().longValue())));
dumpModifiers(out, romStatic.modifiers().longValue(), MODIFIERSOURCE_FIELD, ONLY_SPEC_MODIFIERS);
dumpModifiers(out, romStatic.modifiers().longValue(), MODIFIERSOURCE_FIELD, INCLUDE_INTERNAL_MODIFIERS);
out.append(nl);
}

Expand Down Expand Up @@ -1210,7 +1216,7 @@ private static void dumpMethodParameters(PrintStream out, J9ROMClassPointer romc
}

out.print(String.format(" 0x%x ( ", parameterFlags));
dumpModifiers(out, parameterFlags, ONLY_SPEC_MODIFIERS, MODIFIERSOURCE_METHODPARAMETER);
dumpModifiers(out, parameterFlags, MODIFIERSOURCE_METHODPARAMETER, ONLY_SPEC_MODIFIERS);
out.println(" )\n");
}
out.println("\n");
Expand Down

0 comments on commit c46b260

Please sign in to comment.