Search in sources :

Example 1 with MM_IncrementalGenerationalGCPointer

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

the class GCHeapMap method from.

public static GCHeapMap from() throws CorruptDataException {
    MM_GCExtensionsPointer extensions = GCExtensions.getGCExtensionsPointer();
    if (GCExtensions.isStandardGC()) {
        if (!GCExtensions.isSegregatedHeap()) {
            MM_ParallelGlobalGCPointer pgc = MM_ParallelGlobalGCPointer.cast(extensions._globalCollector());
            MM_MarkMapPointer markMap = pgc._markingScheme()._markMap();
            return new GCMarkMapStandard(markMap);
        } else {
            MM_SegregatedGCPointer sgc = MM_SegregatedGCPointer.cast(extensions._globalCollector());
            MM_MarkMapPointer markMap = sgc._markingScheme()._markMap();
            return new GCMarkMap(markMap);
        }
    } else if (GCExtensions.isVLHGC()) {
        // probably needs a proper subclass
        MM_IncrementalGenerationalGCPointer igc = MM_IncrementalGenerationalGCPointer.cast(extensions._globalCollector());
        MM_MarkMapPointer markMap = igc._markMapManager()._previousMarkMap();
        return new GCMarkMap(markMap);
    } else if (GCExtensions.isMetronomeGC()) {
        MM_MarkMapPointer markMap = extensions.realtimeGC()._markingScheme()._markMap();
        return new GCMarkMap(markMap);
    } else {
        throw new UnsupportedOperationException("GC policy not supported");
    }
}
Also used : MM_SegregatedGCPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_SegregatedGCPointer) MM_IncrementalGenerationalGCPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_IncrementalGenerationalGCPointer) MM_ParallelGlobalGCPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_ParallelGlobalGCPointer) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer) MM_MarkMapPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MarkMapPointer)

Example 2 with MM_IncrementalGenerationalGCPointer

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

the class MarkMapCommand method showMarkMap.

protected void showMarkMap(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
    showActiveMarkMap(out);
    try {
        out.format("\nKnown mark maps:\n");
        MM_GCExtensionsPointer extensions = GCExtensions.getGCExtensionsPointer();
        if (GCExtensions.isStandardGC()) {
            MM_ParallelGlobalGCPointer pgc = MM_ParallelGlobalGCPointer.cast(extensions._globalCollector());
            MM_MarkMapPointer markMap = pgc._markingScheme()._markMap();
            out.format("\tactive: %s\n", markMap.getHexAddress());
        } else if (GCExtensions.isVLHGC()) {
            // probably needs a proper subclass
            MM_IncrementalGenerationalGCPointer igc = MM_IncrementalGenerationalGCPointer.cast(extensions._globalCollector());
            out.format("\tprevious: %s\n", igc._markMapManager()._previousMarkMap().getHexAddress());
            out.format("\tnext: %s\n", igc._markMapManager()._nextMarkMap().getHexAddress());
        } else if (GCExtensions.isMetronomeGC()) {
            MM_HeapMapPointer markMap = extensions.realtimeGC()._markingScheme()._markMap();
            out.format("\tactive: %s\n", markMap.getHexAddress());
        } else {
            out.format("\tUnrecognized GC policy!\n");
        }
        try {
            if (extensions.referenceChainWalkerMarkMap().notNull()) {
                out.format("\treference chain walker: %s\n", extensions.referenceChainWalkerMarkMap().getHexAddress());
            }
        } catch (NoSuchFieldError nsf) {
        // guess we don't have one
        }
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : MM_IncrementalGenerationalGCPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_IncrementalGenerationalGCPointer) MM_ParallelGlobalGCPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_ParallelGlobalGCPointer) MM_HeapMapPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapMapPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) MM_MarkMapPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MarkMapPointer)

Example 3 with MM_IncrementalGenerationalGCPointer

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

the class MarkMapCommand method setMarkMap.

protected void setMarkMap(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
    GCHeapMap newMap = null;
    try {
        if (args[1].equalsIgnoreCase("active") || args[1].equalsIgnoreCase("default")) {
            newMap = GCHeapMap.from();
        } else if (args[1].equalsIgnoreCase("previous")) {
            if (GCExtensions.isVLHGC()) {
                MM_GCExtensionsPointer extensions = GCExtensions.getGCExtensionsPointer();
                MM_IncrementalGenerationalGCPointer igc = MM_IncrementalGenerationalGCPointer.cast(extensions._globalCollector());
                newMap = GCHeapMap.fromHeapMap(igc._markMapManager()._previousMarkMap());
            } else {
                throw new DDRInteractiveCommandException("Only valid when running balanced!");
            }
        } else if (args[1].equalsIgnoreCase("next")) {
            if (GCExtensions.isVLHGC()) {
                MM_GCExtensionsPointer extensions = GCExtensions.getGCExtensionsPointer();
                MM_IncrementalGenerationalGCPointer igc = MM_IncrementalGenerationalGCPointer.cast(extensions._globalCollector());
                newMap = GCHeapMap.fromHeapMap(igc._markMapManager()._nextMarkMap());
            } else {
                throw new DDRInteractiveCommandException("Only valid when running balanced!");
            }
        } else {
            long address = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);
            MM_HeapMapPointer heapMap = MM_HeapMapPointer.cast(address);
            newMap = GCHeapMap.fromHeapMap(heapMap);
        }
        /* Quick test for validity */
        newMap.queryObject(J9ObjectPointer.cast(newMap.getHeapBase()));
        newMap.queryObject(J9ObjectPointer.cast(newMap.getHeapTop().subOffset(newMap.getObjectGrain())));
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
    /* If we got here, the new map must be ok */
    if (newMap != null) {
        markMap = newMap;
        showActiveMarkMap(out);
    }
}
Also used : MM_IncrementalGenerationalGCPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_IncrementalGenerationalGCPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) MM_HeapMapPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapMapPointer) GCHeapMap(com.ibm.j9ddr.vm29.j9.gc.GCHeapMap) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Aggregations

MM_GCExtensionsPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer)3 MM_IncrementalGenerationalGCPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_IncrementalGenerationalGCPointer)3 CorruptDataException (com.ibm.j9ddr.CorruptDataException)2 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)2 MM_HeapMapPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapMapPointer)2 MM_MarkMapPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_MarkMapPointer)2 MM_ParallelGlobalGCPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_ParallelGlobalGCPointer)2 GCHeapMap (com.ibm.j9ddr.vm29.j9.gc.GCHeapMap)1 MM_SegregatedGCPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_SegregatedGCPointer)1