001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.mmtk.plan.refcount.fullheap;
014    
015    import org.mmtk.plan.TraceLocal;
016    import org.mmtk.plan.TransitiveClosure;
017    import org.mmtk.plan.refcount.RCBaseCollector;
018    import org.vmmagic.pragma.*;
019    
020    /**
021     * This class implements the collector context for a reference counting collector.
022     * See Shahriyar et al for details of and rationale for the optimizations used
023     * here (http://dx.doi.org/10.1145/2258996.2259008).  See Chapter 4 of
024     * Daniel Frampton's PhD thesis for details of and rationale for the cycle
025     * collection strategy used by this collector.
026     */
027    @Uninterruptible
028    public class RCCollector extends RCBaseCollector {
029      /************************************************************************
030       * Initialization
031       */
032    
033      /**
034       *
035       */
036      private final RCFindRootSetTraceLocal rootTrace;
037      private final RCModifiedProcessor modProcessor;
038    
039      /**
040       * Constructor.
041       */
042      public RCCollector() {
043        rootTrace = new RCFindRootSetTraceLocal(global().rootTrace, newRootBuffer);
044        modProcessor = new RCModifiedProcessor(this);
045      }
046    
047      @Override
048      protected final TransitiveClosure getModifiedProcessor() {
049        return modProcessor;
050      }
051    
052      @Override
053      protected final TraceLocal getRootTrace() {
054        return rootTrace;
055      }
056    }