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 simple reference counting
022     * collector.
023     */
024    @Uninterruptible
025    public class RCCollector extends RCBaseCollector {
026      /************************************************************************
027       * Initialization
028       */
029      private final RCFindRootSetTraceLocal rootTrace;
030      private final RCModifiedProcessor modProcessor;
031    
032      /**
033       * Constructor.
034       */
035      public RCCollector() {
036        rootTrace = new RCFindRootSetTraceLocal(global().rootTrace, newRootBuffer);
037        modProcessor = new RCModifiedProcessor();
038      }
039    
040      /**
041       * Get the modified processor to use.
042       */
043      protected final TransitiveClosure getModifiedProcessor() {
044        return modProcessor;
045      }
046    
047      /**
048       * Get the root trace to use.
049       */
050      protected final TraceLocal getRootTrace() {
051        return rootTrace;
052      }
053    }