Search in sources :

Example 21 with J9MethodPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer in project openj9 by eclipse.

the class DTFJContext method cacheJITMethodAddresses.

private static void cacheJITMethodAddresses() {
    jitMethodCache = new HashMap<J9MethodPointer, List<J9JITExceptionTablePointer>>();
    try {
        J9MemorySegmentListPointer dataCacheList = getVm().jitConfig().dataCacheList();
        J9MemorySegmentPointer dataCache = dataCacheList.nextSegment();
        while (dataCache.notNull()) {
            UDATA current = UDATA.cast(dataCache.heapBase());
            UDATA end = UDATA.cast(dataCache.heapAlloc());
            while (current.lt(end)) {
                J9JITDataCacheHeaderPointer hdr = J9JITDataCacheHeaderPointer.cast(current);
                if (hdr.type().longValue() == J9DataTypeExceptionInfo) {
                    J9JITExceptionTablePointer metaData = J9JITExceptionTablePointer.cast(current.add(J9JITDataCacheHeader.SIZEOF));
                    addMetaData(metaData);
                }
                current = current.add(hdr.size());
            }
            dataCache = dataCache.nextSegment();
        }
    } catch (CorruptDataException e) {
        return;
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) J9JITDataCacheHeaderPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JITDataCacheHeaderPointer) J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer) J9MemorySegmentListPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MemorySegmentListPointer) J9JITExceptionTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer) ArrayList(java.util.ArrayList) List(java.util.List) J9MemorySegmentPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MemorySegmentPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 22 with J9MethodPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer in project openj9 by eclipse.

the class DTFJJavaClass method getDeclaredMethods.

@SuppressWarnings("rawtypes")
public Iterator getDeclaredMethods() {
    ArrayList<Object> methods;
    J9MethodPointer ramMethod;
    long methodCount;
    try {
        ramMethod = j9class.ramMethods();
        methodCount = j9class.romClass().romMethodCount().longValue();
        if (methodCount > MAX_CLASS_METHODS) {
            CorruptData cd = J9DDRDTFJUtils.newCorruptData(DTFJContext.getProcess(), "Corrupt class, maximum number of methods exceeded");
            return corruptIterator(cd);
        }
        methods = new ArrayList<Object>((int) methodCount);
    } catch (Throwable t) {
        CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
        return corruptIterator(cd);
    }
    for (int i = 0; i < methodCount; i++) {
        try {
            DTFJJavaMethod jmethod = new DTFJJavaMethod(this, ramMethod.add(i));
            methods.add(jmethod);
        } catch (Throwable t) {
            CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
            methods.add(cd);
        }
    }
    return methods.iterator();
}
Also used : J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer) JavaObject(com.ibm.dtfj.java.JavaObject) J9Object(com.ibm.j9ddr.vm29.structure.J9Object) CorruptData(com.ibm.dtfj.image.CorruptData) J9DDRCorruptData(com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData)

Example 23 with J9MethodPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer in project openj9 by eclipse.

the class J9MethodStructureFormatter method postFormat.

@Override
public FormatWalkResult postFormat(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs) {
    if (type.equalsIgnoreCase("j9method")) {
        J9MethodPointer method = J9MethodPointer.cast(address);
        if (!method.isNull()) {
            writeMethodName(method, out);
            writeJ9ROMClassAddress(method, out);
            writeNextMethodAddress(method, out);
        }
    }
    return FormatWalkResult.KEEP_WALKING;
}
Also used : J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)

Aggregations

J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)17 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)13 CorruptDataException (com.ibm.j9ddr.CorruptDataException)11 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)6 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)6 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)5 UDATA (com.ibm.j9ddr.vm29.types.UDATA)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)3 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)3 GCClassLoaderIterator (com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2 StackWalkResult (com.ibm.j9ddr.vm29.j9.stackwalker.StackWalkResult)2 WalkState (com.ibm.j9ddr.vm29.j9.stackwalker.WalkState)2 J9ROMClassAndMethod (com.ibm.j9ddr.vm29.j9.walkers.J9ROMClassAndMethod)2 J9ClassLoaderPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer)2 J9ConstantPoolPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ConstantPoolPointer)2 J9ROMNameAndSignaturePointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer)2 J9UTF8Pointer (com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)2 J9VMEntryLocalStoragePointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMEntryLocalStoragePointer)2