use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class ObjectHash method inlineConvertValueToHash.
private static I32 inlineConvertValueToHash(J9JavaVMPointer vm, UDATA objectPointer) throws CorruptDataException {
final U32 MUL1 = new U32(0x85ebca6b);
final U32 MUL2 = new U32(0xc2b2ae35);
U32 hashValue = getSalt(vm, objectPointer);
UDATA shiftedAddress = objectPointer.div(ObjectModel.getObjectAlignmentInBytes());
U32 datum = new U32(shiftedAddress.bitAnd(0xffffffff));
hashValue = mix(hashValue, datum);
if (J9BuildFlags.env_data64) {
datum = new U32(shiftedAddress.rightShift(32));
hashValue = mix(hashValue, datum);
}
hashValue = hashValue.bitXor(UDATA.SIZEOF);
hashValue = hashValue.bitXor(hashValue.rightShift(16));
hashValue = hashValue.mult(MUL1);
hashValue = hashValue.bitXor(hashValue.rightShift(13));
hashValue = hashValue.mult(MUL2);
hashValue = hashValue.bitXor(hashValue.rightShift(16));
return new I32(hashValue);
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class GCHeapRegionIterator method from.
public static GCHeapRegionIterator from() throws CorruptDataException {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
MM_GCExtensionsPointer gcext = GCExtensions.getGCExtensionsPointer();
MM_HeapRegionManagerPointer hrm = gcext.heapRegionManager();
return fromMMHeapRegionManager(hrm, true, true);
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class J9JavaVMHelper method getSystemProperties.
public static Properties getSystemProperties(J9JavaVMPointer vm) throws CorruptDataException {
Properties result = new Properties();
Pool<J9VMSystemPropertyPointer> sysprops = Pool.fromJ9Pool(vm.systemProperties(), J9VMSystemPropertyPointer.class);
Iterator<J9VMSystemPropertyPointer> syspropsIterator = sysprops.iterator();
int count = 0;
while (syspropsIterator.hasNext()) {
J9VMSystemPropertyPointer prop = syspropsIterator.next();
// Iterator may return null if corrupt data was found.
if (prop != null) {
String name = null;
try {
name = prop.name().getCStringAtOffset(0);
} catch (CorruptDataException e) {
name = "Corrupt System Property[" + count + "]";
}
String value = null;
try {
value = prop.value().getCStringAtOffset(0);
} catch (CorruptDataException e) {
value = "Corrupt Value";
}
result.setProperty(name, value);
}
count++;
}
return result;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class FindVMTask method run.
/* (non-Javadoc)
* @see com.ibm.j9ddr.IBootstrapRunnable#run(com.ibm.j9ddr.IVMData, java.lang.Object[])
*/
public void run(IVMData vmData, Object[] userData) {
long[] passBackArray = (long[]) userData[0];
String vmAddressString = System.getProperty(J9VM_ADDRESS_PROPERTY);
if (vmAddressString != null) {
long address = 0;
try {
if (vmAddressString.startsWith("0x")) {
address = Long.parseLong(vmAddressString.substring(2), 16);
} else {
address = Long.parseLong(vmAddressString);
}
} catch (NumberFormatException nfe) {
logger.warning("System property " + J9VM_ADDRESS_PROPERTY + " does not contain a valid pointer address, found: " + vmAddressString);
throw nfe;
}
logger.warning("FindVMTask forcing J9JavaVMPointer to address from system property " + J9VM_ADDRESS_PROPERTY + " : " + vmAddressString);
// Override the cached version from J9RASHelper as well.
J9JavaVMPointer vm = J9JavaVMPointer.cast(address);
J9RASHelper.setCachedVM(vm);
passBackArray[0] = vm.getAddress();
} else {
try {
passBackArray[0] = DataType.getJ9RASPointer().vm().longValue();
} catch (CorruptDataException e) {
throw new RuntimeException(e);
}
}
logger.fine("FindVMTask passing back J9JavaVMPointer: 0x" + Long.toHexString(passBackArray[0]));
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class RamClassWalker method allSlotsInExtendedMethodBlockDo.
private void allSlotsInExtendedMethodBlockDo() throws CorruptDataException {
final J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
/* add in size of method trace array if extended method block active */
if (vm.runtimeFlags().allBitsIn(J9Consts.J9_RUNTIME_EXTENDED_METHOD_BLOCK)) {
long extendedMethodBlockSize = 0;
int romMethodCount = ramClass.romClass().romMethodCount().intValue();
extendedMethodBlockSize = romMethodCount + (UDATA.SIZEOF - 1);
extendedMethodBlockSize &= ~(UDATA.SIZEOF - 1);
/*
* Gets the start address of the extended methods. It is just before the ramMethods.
*/
U8Pointer extendedMethodStartAddr = U8Pointer.cast(ramClass.ramMethods()).sub(extendedMethodBlockSize);
classWalkerCallback.addSection(clazz, extendedMethodStartAddr, romMethodCount, "Extended method block", false);
while (romMethodCount-- > 0) {
classWalkerCallback.addSlot(clazz, SlotType.J9_U8, extendedMethodStartAddr.add(romMethodCount), "method flag", "!j9extendedmethodflaginfo");
}
}
}
Aggregations