From: <cap...@us...> - 2009-01-29 14:36:45
|
Revision: 15304 http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=15304&view=rev Author: captain5050 Date: 2009-01-29 14:36:38 +0000 (Thu, 29 Jan 2009) Log Message: ----------- Make fields that can final, final. Small improvements to javadoc. Modified Paths: -------------- rvmroot/trunk/MMTk/src/org/mmtk/plan/MutatorContext.java rvmroot/trunk/MMTk/src/org/mmtk/plan/Plan.java rvmroot/trunk/MMTk/src/org/mmtk/plan/concurrent/ConcurrentMutator.java rvmroot/trunk/MMTk/src/org/mmtk/plan/copyms/CopyMSMutator.java rvmroot/trunk/MMTk/src/org/mmtk/plan/generational/Gen.java rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java rvmroot/trunk/MMTk/src/org/mmtk/utility/SimpleHashtable.java rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/Map.java rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/SpaceDescriptor.java Modified: rvmroot/trunk/MMTk/src/org/mmtk/plan/MutatorContext.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/plan/MutatorContext.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/plan/MutatorContext.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -95,25 +95,25 @@ */ /** Unique mutator identifier */ - protected int id = VM.activePlan.registerMutator(this); + protected final int id = VM.activePlan.registerMutator(this); /** Used for printing log information in a thread safe manner */ protected final Log log = new Log(); /** Per-mutator allocator into the immortal space */ - protected BumpPointer immortal = new ImmortalLocal(Plan.immortalSpace); + protected final BumpPointer immortal = new ImmortalLocal(Plan.immortalSpace); /** Per-mutator allocator into the large object space */ - protected LargeObjectLocal los = new LargeObjectLocal(Plan.loSpace); + protected final LargeObjectLocal los = new LargeObjectLocal(Plan.loSpace); /** Per-mutator allocator into the small code space */ - private MarkSweepLocal smcode = Plan.USE_CODE_SPACE ? new MarkSweepLocal(Plan.smallCodeSpace) : null; + private final MarkSweepLocal smcode = Plan.USE_CODE_SPACE ? new MarkSweepLocal(Plan.smallCodeSpace) : null; /** Per-mutator allocator into the large code space */ - private LargeObjectLocal lgcode = Plan.USE_CODE_SPACE ? new LargeObjectLocal(Plan.largeCodeSpace) : null; + private final LargeObjectLocal lgcode = Plan.USE_CODE_SPACE ? new LargeObjectLocal(Plan.largeCodeSpace) : null; /** Per-mutator allocator into the non moving space */ - private MarkSweepLocal nonmove = new MarkSweepLocal(Plan.nonMovingSpace); + private final MarkSweepLocal nonmove = new MarkSweepLocal(Plan.nonMovingSpace); /**************************************************************************** @@ -145,7 +145,7 @@ * @param bytes The number of bytes to be allocated * @param align The requested alignment. * @param allocator The allocator statically assigned to this allocation - * @return The allocator dyncamically assigned to this allocation + * @return The allocator dynamically assigned to this allocation */ @Inline public int checkAllocator(int bytes, int align, int allocator) { @@ -325,7 +325,7 @@ * @param tgt The target of the new reference * @param metaDataA A value that assists the host VM in creating a store * @param metaDataB A value that assists the host VM in creating a store - * @param mode The context in which the store occured + * @param mode The context in which the store occurred */ public void writeBarrier(ObjectReference src, Address slot, ObjectReference tgt, Word metaDataA, @@ -349,7 +349,7 @@ * @param tgt The target of the new reference * @param metaDataA A value that assists the host VM in creating a store * @param metaDataB A value that assists the host VM in creating a store - * @param mode The context in which the store occured + * @param mode The context in which the store occurred * @return True if the swap was successful. */ public boolean tryCompareAndSwapWriteBarrier(ObjectReference src, Address slot, Modified: rvmroot/trunk/MMTk/src/org/mmtk/plan/Plan.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/plan/Plan.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/plan/Plan.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -152,7 +152,7 @@ public static final Timer totalTime = new Timer("time"); /** Performance counters */ - public static PerfCounter totalPerfCnt = new PerfCounter("perf"); + public static final PerfCounter totalPerfCnt = new PerfCounter("perf"); /** Support for time-limited GCs */ protected static long timeCap; Modified: rvmroot/trunk/MMTk/src/org/mmtk/plan/concurrent/ConcurrentMutator.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/plan/concurrent/ConcurrentMutator.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/plan/concurrent/ConcurrentMutator.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -84,7 +84,7 @@ * @param tgt The target of the new reference * @param metaDataA A value that assists the host VM in creating a store * @param metaDataB A value that assists the host VM in creating a store - * @param mode The context in which the store occured + * @param mode The context in which the store occurred */ @Inline public void writeBarrier(ObjectReference src, Address slot, ObjectReference tgt, Word metaDataA, Word metaDataB, int mode) { @@ -106,7 +106,7 @@ * @param tgt The target of the new reference * @param metaDataA A value that assists the host VM in creating a store * @param metaDataB A value that assists the host VM in creating a store - * @param mode The context in which the store occured + * @param mode The context in which the store occurred * @return True if the swap was successful. */ @Inline @@ -168,15 +168,4 @@ * @param ref The reference to check. */ protected abstract void checkAndEnqueueReference(ObjectReference ref); - - /**************************************************************************** - * - * Miscellaneous - */ - - /** @return The active global plan as a <code>Gen</code> instance. */ - @Inline - private static Concurrent global() { - return (Concurrent) VM.activePlan.global(); - } } Modified: rvmroot/trunk/MMTk/src/org/mmtk/plan/copyms/CopyMSMutator.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/plan/copyms/CopyMSMutator.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/plan/copyms/CopyMSMutator.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -43,8 +43,8 @@ * Instance fields */ - private MarkSweepLocal mature; - private CopyLocal nursery; + private final MarkSweepLocal mature; + private final CopyLocal nursery; /**************************************************************************** * Modified: rvmroot/trunk/MMTk/src/org/mmtk/plan/generational/Gen.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/plan/generational/Gen.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/plan/generational/Gen.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -77,12 +77,12 @@ */ /* Statistics */ - protected static BooleanCounter fullHeap = new BooleanCounter("majorGC", true, true); - private static Timer fullHeapTime = new Timer("majorGCTime", false, true); - protected static EventCounter wbFast; - protected static EventCounter wbSlow; - public static SizeCounter nurseryMark; - public static SizeCounter nurseryCons; + 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; /** The nursery space is where all new objects are allocated by default */ private static final VMRequest vmRequest = USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(0.15f, true); @@ -116,10 +116,16 @@ 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; } } Modified: rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -19,10 +19,12 @@ * MMTk follows the pattern set by Jikes RVM for defining sizes of * primitive types thus: * - * static final int LOG_BYTES_IN_INT = 2; - * static final int BYTES_IN_INT = 1<<LOG_BYTES_IN_INT; + * <pre> + * static final int LOG_BYTES_IN_INT = 2; + * static final int BYTES_IN_INT = 1<<LOG_BYTES_IN_INT; * static final int LOG_BITS_IN_INT = LOG_BITS_IN_BYTE + LOG_BYTES_IN_INT; * static final int BITS_IN_INT = 1<<LOG_BITS_IN_INT; + * </pre> */ public interface Constants { Modified: rvmroot/trunk/MMTk/src/org/mmtk/utility/SimpleHashtable.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/utility/SimpleHashtable.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/utility/SimpleHashtable.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -35,19 +35,19 @@ private static final Offset DATA_OFFSET = Offset.fromIntSignExtend(BYTES_IN_WORD); /** The size of each entry in the table */ - private Extent entrySize; + private final Extent entrySize; /** The mask to use to get the hash code */ - private Word mask; + private final Word mask; /** The start address of the data table */ private Address base; /** The full size of the table */ - private Extent size; + private final Extent size; /** The space to use for allocating the data structure */ - private RawPageSpace space; + private final RawPageSpace space; /** Is this table valid (created) */ private boolean valid; Modified: rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/Map.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/Map.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/Map.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -47,7 +47,7 @@ private static final FreeListPageResource[] sharedFLMap; private static int totalAvailableDiscontiguousChunks = 0; - private static Lock lock = VM.newLock("Map lock"); + private static final Lock lock = VM.newLock("Map lock"); /**************************************************************************** * Modified: rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/SpaceDescriptor.java =================================================================== --- rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/SpaceDescriptor.java 2009-01-29 14:16:59 UTC (rev 15303) +++ rvmroot/trunk/MMTk/src/org/mmtk/utility/heap/SpaceDescriptor.java 2009-01-29 14:36:38 UTC (rev 15304) @@ -58,7 +58,7 @@ private static final int BASE_EXPONENT = BITS_IN_INT - MANTISSA_BITS; private static int discontiguousSpaceIndex = 0; - private static int DISCONTIG_INDEX_INCREMENT = 1<<TYPE_BITS; + private static final int DISCONTIG_INDEX_INCREMENT = 1<<TYPE_BITS; /**************************************************************************** * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |