From: <jik...@li...> - 2011-08-14 00:01:00
|
details: http://jikesrvm.hg.sourceforge.net/hgweb/jikesrvm/soc2011/rev/8c6a9cb8cf41 changeset: 10472:8c6a9cb8cf41 user: gary46 date: Sat Aug 13 17:00:48 2011 -0700 description: removing previous version of Gen for survivor and steps (removing generational_steps and generational_survivor folders) diffstat: MMTk/src/org/mmtk/plan/generational_steps/GenSteps.java | 872 ---------- MMTk/src/org/mmtk/plan/generational_steps/GenStepsCollector.java | 295 --- MMTk/src/org/mmtk/plan/generational_steps/GenStepsConstraints.java | 82 - MMTk/src/org/mmtk/plan/generational_steps/GenStepsMatureTraceLocal.java | 179 -- MMTk/src/org/mmtk/plan/generational_steps/GenStepsMutator.java | 356 ---- MMTk/src/org/mmtk/plan/generational_steps/GenStepsNurseryTraceLocal.java | 205 -- MMTk/src/org/mmtk/plan/generational_steps/copying/GenStepsCopy.java | 221 -- MMTk/src/org/mmtk/plan/generational_steps/copying/GenStepsCopyCollector.java | 180 -- MMTk/src/org/mmtk/plan/generational_steps/copying/GenStepsCopyConstraints.java | 22 - MMTk/src/org/mmtk/plan/generational_steps/copying/GenStepsCopyMatureTraceLocal.java | 105 - MMTk/src/org/mmtk/plan/generational_steps/copying/GenStepsCopyMutator.java | 165 - MMTk/src/org/mmtk/plan/generational_steps/marksweep/GenStepsMS.java | 168 - MMTk/src/org/mmtk/plan/generational_steps/marksweep/GenStepsMSCollector.java | 185 -- MMTk/src/org/mmtk/plan/generational_steps/marksweep/GenStepsMSConstraints.java | 30 - MMTk/src/org/mmtk/plan/generational_steps/marksweep/GenStepsMSMatureTraceLocal.java | 92 - MMTk/src/org/mmtk/plan/generational_steps/marksweep/GenStepsMSMutator.java | 176 -- MMTk/src/org/mmtk/plan/generational_survivor/GenSurvivor.java | 677 ------- MMTk/src/org/mmtk/plan/generational_survivor/GenSurvivorCollector.java | 278 --- MMTk/src/org/mmtk/plan/generational_survivor/GenSurvivorConstraints.java | 82 - MMTk/src/org/mmtk/plan/generational_survivor/GenSurvivorMatureTraceLocal.java | 160 - MMTk/src/org/mmtk/plan/generational_survivor/GenSurvivorMutator.java | 356 ---- MMTk/src/org/mmtk/plan/generational_survivor/GenSurvivorNurseryTraceLocal.java | 152 - MMTk/src/org/mmtk/plan/generational_survivor/marksweep/GenSurvivorMS.java | 168 - MMTk/src/org/mmtk/plan/generational_survivor/marksweep/GenSurvivorMSCollector.java | 184 -- MMTk/src/org/mmtk/plan/generational_survivor/marksweep/GenSurvivorMSConstraints.java | 30 - MMTk/src/org/mmtk/plan/generational_survivor/marksweep/GenSurvivorMSMatureTraceLocal.java | 89 - MMTk/src/org/mmtk/plan/generational_survivor/marksweep/GenSurvivorMSMutator.java | 176 -- 27 files changed, 0 insertions(+), 5685 deletions(-) diffs (truncated from 5793 to 300 lines): diff -r bfb9e4ad6957 -r 8c6a9cb8cf41 MMTk/src/org/mmtk/plan/generational_steps/GenSteps.java --- a/MMTk/src/org/mmtk/plan/generational_steps/GenSteps.java Sat Aug 13 16:58:17 2011 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,872 +0,0 @@ -/* - * This file is part of the Jikes RVM project (http://jikesrvm.org). - * - * This file is licensed to You under the Eclipse Public License (EPL); - * You may not use this file except in compliance with the License. You - * may obtain a copy of the License at - * - * http://www.opensource.org/licenses/eclipse-1.0.php - * - * See the COPYRIGHT.txt file distributed with this work for information - * regarding copyright ownership. - */ -package org.mmtk.plan.generational_steps; - -import org.mmtk.plan.*; -import org.mmtk.policy.CopySpace; -import org.mmtk.policy.Space; - -import org.mmtk.utility.deque.*; -import org.mmtk.utility.heap.Map; -import org.mmtk.utility.heap.VMRequest; -import org.mmtk.utility.Log; -import org.mmtk.utility.options.Options; -import org.mmtk.utility.sanitychecker.SanityChecker; -import org.mmtk.utility.statistics.*; - -import org.mmtk.vm.VM; - -import org.vmmagic.pragma.*; -import org.vmmagic.unboxed.*; - -/** - * This abstract class implements the core functionality of generic - * two-generationa copying collectors. Nursery collections occur when - * either the heap is full or the nursery is full. The nursery size - * is determined by an optional command line argument. If undefined, - * the nursery size is "infinite", so nursery collections only occur - * when the heap is full (this is known as a flexible-sized nursery - * collector). Thus both fixed and flexible nursery sizes are - * supported. Full heap collections occur when the nursery size has - * dropped to a statically defined threshold, - * <code>NURSERY_THRESHOLD</code><p> - * - * See also Plan.java for general comments on local vs global plan - * classes. - */ -@Uninterruptible -public abstract class GenSteps extends StopTheWorld { - - /***************************************************************************** - * - * Constants - */ - protected static final float SURVIVAL_ESTIMATE = 0.8f; // est yield - protected static final float MATURE_FRACTION = 0.5f; // est yield - private static final float WORST_CASE_COPY_EXPANSION = 1.5f; // worst case for addition of one word overhead due to address based hashing - public static final boolean IGNORE_REMSETS = false; - public static final boolean USE_NON_HEAP_OBJECT_REFERENCE_WRITE_BARRIER = false; - public static final boolean USE_OBJECT_BARRIER_FOR_AASTORE = false; // choose between slot and object barriers - public static final boolean USE_OBJECT_BARRIER_FOR_PUTFIELD = false; // choose between slot and object barriers - public static final boolean USE_OBJECT_BARRIER = USE_OBJECT_BARRIER_FOR_AASTORE || USE_OBJECT_BARRIER_FOR_PUTFIELD; - - /** Fraction of available virtual memory to give to the nursery (if contiguous) */ - protected static final float NURSERY_VM_FRACTION = 0.15f; - - /** Switch between a contiguous and discontiguous nursery (experimental) */ - static final boolean USE_DISCONTIGUOUS_NURSERY = false; - - // Allocators - public static final int ALLOC_NURSERY = ALLOC_DEFAULT; - public static final int ALLOC_MATURE = StopTheWorld.ALLOCATORS + 1; - public static final int ALLOC_MATURE_MINORGC = StopTheWorld.ALLOCATORS + 2; - public static final int ALLOC_MATURE_MAJORGC = StopTheWorld.ALLOCATORS + 3; - public static final int ALLOC_STEP1 = StopTheWorld.ALLOCATORS + 4; - public static final int ALLOC_STEP2 = StopTheWorld.ALLOCATORS + 5; - - public static final int SCAN_NURSERY = 0; - public static final int SCAN_MATURE = 1; - - /***************************************************************************** - * - * Class fields - */ - - /* Statistics */ - protected static final BooleanCounter fullHeap = new BooleanCounter("majorGC", true, true); - private static final Timer fullHeapTime = new Timer("majorGCTime", false, true); - protected static final EventCounter wbFast; - protected static final EventCounter wbSlow; - public static final SizeCounter nurseryMark; - public static final SizeCounter nurseryCons; - - public static final int NUMBER_OF_STEPS = 2; - private static final float SPACES_FRACTION_SIZE = NURSERY_VM_FRACTION / (((NUMBER_OF_STEPS + 1) * 2) - 1); - - /** The nursery space is where all new objects are allocated by default */ - - private static final VMRequest vmRequest = USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(SPACES_FRACTION_SIZE, true); - public static final CopySpace edenSpace = new CopySpace("eden", false, vmRequest); - - public static final int EDEN = edenSpace.getDescriptor(); - private static final Address EDEN_START = edenSpace.getStart(); - - - //GC state - static boolean hi = false; // True if copying to "higher" semispace (0 is low, 1 is high) - - /** The steps space is where all objects that survive the nursery will start going through before reaching the Mature Space */ - /* TODO: Use an array instead to allow N number of space */ - /* Step one */ - public static final CopySpace step1Space0 = new CopySpace("step10", false, USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(SPACES_FRACTION_SIZE, true)); - public static final CopySpace step1Space1 = new CopySpace("step11", false, USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(SPACES_FRACTION_SIZE, true)); - - /* Step two */ - public static final CopySpace step2Space0 = new CopySpace("step20", false, USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(SPACES_FRACTION_SIZE, true)); - public static final CopySpace step2Space1 = new CopySpace("step21", false, USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(SPACES_FRACTION_SIZE, true)); - - public static final int SPACE10 = step1Space0.getDescriptor(); - public static final int SPACE11 = step1Space1.getDescriptor(); - public static final int SPACE20 = step2Space0.getDescriptor(); - public static final int SPACE21 = step2Space1.getDescriptor(); - - /***************************************************************************** - * - * Instance fields - */ - /* status fields */ - public boolean gcFullHeap = true;//false; - public boolean nextGCFullHeap = true;//false; - - /* The trace object */ - public final Trace nurseryTrace = new Trace(metaDataSpace); - - /** - * Remset pools. - * At the end of each collection swap the remset pools. - * Active remsets must be in modbufPool, remsetPool and arrayRemsetPool because they are widely used without a getter. - * Swapping one is also quicker than swaping when needed. - */ - public final SharedDeque modbufPool = new SharedDeque("modBufs",metaDataSpace, 1); - public final SharedDeque remsetPool = new SharedDeque("remSets",metaDataSpace, 1); - public final SharedDeque arrayRemsetPool = new SharedDeque("arrayRemSets",metaDataSpace, 2); - - public final SharedDeque remsetPool2 = new SharedDeque("remSets2",metaDataSpace, 1); - - /* - * Class initializer - */ - static { - if (GATHER_WRITE_BARRIER_STATS) { - wbFast = new EventCounter("wbFast"); - wbSlow = new EventCounter("wbSlow"); - } else { - wbFast = null; - wbSlow = null; - } - if (Stats.GATHER_MARK_CONS_STATS) { - nurseryMark = new SizeCounter("nurseryMark", true, true); - nurseryCons = new SizeCounter("nurseryCons", true, true); - } else { - nurseryMark = null; - nurseryCons = null; - } - } - - /***************************************************************************** - * - * Collection - */ - - /** - * Force the next collection to be full heap. - */ - public void forceFullHeapCollection() { - nextGCFullHeap = true; - } - - /** - * Perform a (global) collection phase. - * - * @param phaseId Collection phase to execute. - */ - @NoInline - public void collectionPhase(short phaseId) { - if (phaseId == SET_COLLECTION_KIND) { - super.collectionPhase(phaseId); - gcFullHeap = requiresFullHeapCollection(); - return; - } - - if (phaseId == PREPARE) { - edenSpace.prepare(true); - - hi = !hi; // flip the semi-spaces - // TODO: Use a while statement and go through an array - step1Space0.prepare(hi); - step1Space1.prepare(!hi); - step2Space0.prepare(hi); - step2Space1.prepare(!hi); - - Log.write("Parallel workers = ");Log.writeln(VM.activePlan.collector().parallelWorkerCount()); - modbufPool.prepare(); - remsetPool.prepare(); - arrayRemsetPool.prepare(); - - if (traceFullHeap()){ - if (gcFullHeap) { - if (Stats.gatheringStats()) fullHeap.set(); - fullHeapTime.start(); - } - super.collectionPhase(phaseId); - - // we can throw away the remsets (but not modbuf) for a full heap GC - remsetPool.clearDeque(1); - arrayRemsetPool.clearDeque(2); - } - return; - } - if (phaseId == CLOSURE) { - if (!traceFullHeap()) { - nurseryTrace.prepare(); - } - return; - } - - if (phaseId == RELEASE) { - edenSpace.release(); - // TODO: use a function fromSpace that returns an array of from spaces to release. - if (hi) - { - step1Space0.release(); - step2Space0.release(); - } - else - { - step1Space1.release(); - step2Space1.release(); - } - - modbufPool.clearDeque(1); - /* Must not be used when copying remset2 to remset1 instead of swapping sharedDeque */ - remsetPool.clearDeque(1); - arrayRemsetPool.clearDeque(2); - if (!traceFullHeap()) { - nurseryTrace.release(); - } else { - super.collectionPhase(phaseId); - if (gcFullHeap) fullHeapTime.stop(); - } - nextGCFullHeap = true; -// nextGCFullHeap = (getPagesAvail() < Options.nurserySize.getMinNursery()); -// Log.writeln(nextGCFullHeap); - - /* ADDED */ - /* Reseting empty pools before swapping */ - /* Swap the remset pools */ - modbufPool.reset(); - remsetPool.reset(); - arrayRemsetPool.reset(); - swapRemsetPools(); - remsetPool2.reset(); - return; - } - - super.collectionPhase(phaseId); - } - - /** - * This method controls the triggering of a GC. It is called periodically - * during allocation. Returns true to trigger a collection. - * - * @param spaceFull Space request failed, must recover pages within 'space'. - * @return True if a collection is requested by the plan. - */ - public final boolean collectionRequired(boolean spaceFull, Space space) { - int nurseryPages = edenSpace.reservedPages(); - - if (nurseryPages > Options.nurserySize.getMaxNursery()) { - return true; - } - - if (virtualMemoryExhausted()) { - return true; - } - - if (spaceFull && space != edenSpace) { - nextGCFullHeap = true; - } - - return super.collectionRequired(spaceFull, space); - } - - /** - * Determine if this GC should be a full heap collection. - * - * @return True is this GC should be a full heap collection. |