use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class VmCheckCommand method verifyObsoleteJ9Class.
private boolean verifyObsoleteJ9Class(J9JavaVMPointer javaVM, PrintStream out, J9ClassPointer classPointer) throws CorruptDataException {
boolean passed = true;
J9ClassPointer replacedClass;
J9ClassPointer currentClass = J9ClassHelper.currentClass(classPointer);
verifyJ9ClassHeader(javaVM, out, currentClass);
replacedClass = currentClass.replacedClass();
while (!replacedClass.isNull()) {
if (replacedClass.eq(classPointer)) {
/* Expected case: found classPointer in the list. */
break;
}
replacedClass = replacedClass.replacedClass();
}
if (replacedClass.isNull()) {
reportError(out, "obsolete class=0x%s is not in replaced list on currentClass=0x%s", Long.toHexString(classPointer.getAddress()), Long.toHexString(currentClass.getAddress()));
passed = false;
}
return passed;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class GCCheckRunner method run.
@SuppressWarnings("unchecked")
public void run(IVMData vmData, Object[] userData) {
List<String> argList = ((List<String>) userData[0]);
String[] args = argList.toArray(new String[argList.size()]);
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
run(vm, args, System.out);
} catch (CorruptDataException e) {
e.printStackTrace();
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class J9ObjectFieldOffsetIterator_V1 method copyHiddenInstanceFieldsList.
// Based on fieldOffsetsStartDo in resolvefield.cpp
private LinkedList<HiddenInstanceField> copyHiddenInstanceFieldsList(J9JavaVMPointer vm) throws CorruptDataException {
LinkedList<HiddenInstanceField> list = new LinkedList<HiddenInstanceField>();
J9HiddenInstanceFieldPointer fieldPointer = vm.hiddenInstanceFields();
while (!fieldPointer.isNull()) {
list.add(new HiddenInstanceField(fieldPointer));
fieldPointer = fieldPointer.next();
}
return list;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class JavaLangClassLoaderHelper method getParent.
public static J9ObjectPointer getParent(J9ObjectPointer loader) throws CorruptDataException {
if (loader.isNull()) {
return J9ObjectPointer.NULL;
}
if (parentOffset == null) {
// Iterate through all the fields of Ljava/lang/ClassLoader; until you find "parent"
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9ClassPointer javaLangClassLoader = J9ClassLoaderHelper.findClass(vm.systemClassLoader(), "Ljava/lang/ClassLoader;");
Iterator<J9ObjectFieldOffset> fieldIterator = J9ClassHelper.getFieldOffsets(javaLangClassLoader);
while (fieldIterator.hasNext()) {
Object nextField = fieldIterator.next();
if (nextField instanceof J9ObjectFieldOffset) {
J9ObjectFieldOffset offset = (J9ObjectFieldOffset) nextField;
if ("parent".equals(offset.getName())) {
parentOffset = offset;
break;
}
}
}
}
if (parentOffset != null) {
return J9ObjectHelper.getObjectField(loader, parentOffset);
} else {
throw new CorruptDataException("Unable to find field offset for the 'parent' field");
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class ObjectHash method getSalt.
private static U32 getSalt(J9JavaVMPointer vm, UDATA objectPointer) throws CorruptDataException {
/* set up the default salt */
U32 salt = (new U32(1421595292)).bitXor(new U32(UDATA.cast(vm)));
J9IdentityHashDataPointer hashData = vm.identityHashData();
UDATA saltPolicy = hashData.hashSaltPolicy();
/* Replacing case statement in C with an if-else if statements since case expressions must use constant */
if (saltPolicy.eq(J9IdentityHashData.J9_IDENTITY_HASH_SALT_POLICY_STANDARD)) {
/* Gencon/optavgpause/optthruput use the default salt for non heap and
* tenure space but they use a table salt for the nursery.
*
* hashData->hashData1 is nursery base
* hashData->hashData2 is nursery top
*/
if (objectPointer.gte(hashData.hashData1())) {
if (objectPointer.lt(hashData.hashData2())) {
/* Object is in the nursery */
salt = hashData.hashSaltTableEA().at(0);
} else {
/* not in the heap so use default salt */
}
} else {
/* not in the nursery so use default salt */
}
} else if (saltPolicy.eq(J9IdentityHashData.J9_IDENTITY_HASH_SALT_POLICY_REGION)) {
if (objectPointer.gte(hashData.hashData1())) {
if (objectPointer.lt(hashData.hashData2())) {
UDATA heapDelta = objectPointer.sub(hashData.hashData1());
UDATA index = heapDelta.rightShift(hashData.hashData3());
salt = hashData.hashSaltTableEA().at(index);
} else {
/* not in the heap so use default salt */
}
} else {
/* not in the heap so use default salt */
}
} else if (saltPolicy.eq(J9IdentityHashData.J9_IDENTITY_HASH_SALT_POLICY_NONE)) {
/* Use default salt */
} else {
/* Unrecognized salt policy. Should assert but we are in util */
throw new CorruptDataException("Invalid salt policy");
}
return salt;
}
Aggregations