use of com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer in project openj9 by eclipse.
the class J9ClassHelper method getRawModifiers.
/**
* Returns "raw" modifiers
*
* Derived from logic in J9VMJavaLangClassNativesCDLC.getModifiersImpl
* @param j9class
* @return
* @throws CorruptDataException
*/
public static int getRawModifiers(J9ClassPointer j9class) throws CorruptDataException {
if (J9ClassHelper.isArrayClass(j9class)) {
J9ArrayClassPointer arrayClass = J9ArrayClassPointer.cast(j9class);
U32 modifiers = arrayClass.leafComponentType().romClass().modifiers();
// OR in the bogus Sun bits
modifiers = modifiers.bitOr(J9JavaAccessFlags.J9AccAbstract);
modifiers = modifiers.bitOr(J9JavaAccessFlags.J9AccFinal);
return modifiers.intValue();
} else {
U32 modifiers = j9class.romClass().modifiers();
if (j9class.romClass().outerClassName().notNull()) {
modifiers = j9class.romClass().memberAccessFlags();
}
return modifiers.intValue();
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer in project openj9 by eclipse.
the class J9ClassHelper method getArrayName.
public static String getArrayName(J9ClassPointer clazz) throws CorruptDataException {
J9ArrayClassPointer arrayClass = J9ArrayClassPointer.cast(clazz);
StringBuilder name = new StringBuilder();
int arity = 0;
try {
arity = arrayClass.arity().intValue();
} catch (InvalidDataTypeException e) {
throw new AddressedCorruptDataException(arrayClass.getAddress(), "Array arity larger than MAXINT");
}
if (arity > MAXIMUM_ARRAY_ARITY) {
// Doubtful
throw new AddressedCorruptDataException(arrayClass.getAddress(), "Very high arity " + arity + " from array class 0x" + Long.toHexString(arrayClass.getAddress()));
}
for (int i = 0; i < arity; i++) {
name.append('[');
}
String elementClassName = J9ClassHelper.getName(arrayClass.leafComponentType());
Character type = TYPE_MAP.get(elementClassName);
if (type != null) {
name.append(type);
} else {
name.append('L');
name.append(elementClassName);
name.append(";");
}
return name.toString();
}
Aggregations