Search in sources :

Example 1 with J9JavaVMPointer

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);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U32(com.ibm.j9ddr.vm29.types.U32) I32(com.ibm.j9ddr.vm29.types.I32)

Example 2 with J9JavaVMPointer

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);
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer)

Example 3 with J9JavaVMPointer

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;
}
Also used : J9VMSystemPropertyPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMSystemPropertyPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) Properties(java.util.Properties)

Example 4 with J9JavaVMPointer

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]));
}
Also used : J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 5 with J9JavaVMPointer

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");
        }
    }
}
Also used : U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)

Aggregations

J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)57 CorruptDataException (com.ibm.j9ddr.CorruptDataException)49 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)39 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)23 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)17 UDATA (com.ibm.j9ddr.vm29.types.UDATA)13 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)10 ClassSegmentIterator (com.ibm.j9ddr.vm29.j9.walkers.ClassSegmentIterator)8 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)8 J9MemorySegmentPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MemorySegmentPointer)6 PatternString (com.ibm.j9ddr.util.PatternString)5 MonitorIterator (com.ibm.j9ddr.vm29.j9.walkers.MonitorIterator)5 ROMClassesIterator (com.ibm.j9ddr.vm29.j9.walkers.ROMClassesIterator)5 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)5 J9ClassLoaderPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer)5 MM_HeapRegionManagerPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer)5 Table (com.ibm.j9ddr.tools.ddrinteractive.Table)4 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)4 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)4 J9ThreadMonitorPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ThreadMonitorPointer)4