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.jikesrvm.mm.mminterface;
014    
015    import org.jikesrvm.SizeConstants;
016    
017    /**
018     * This class merely exposes the MMTk constants into the Jikes RVM
019     * package space so that they can be accessed by the VM in an
020     * MM-neutral way.  It is separate from MemoryManager to break
021     * cyclic class-loading dependencies.
022     */
023    public class MemoryManagerConstants implements SizeConstants {
024      /** {@code true} if the selected plan needs support for linearly scanning the heap */
025      public static final boolean NEEDS_LINEAR_SCAN = Selected.Constraints.get().needsLinearScan();
026      /** Number of bits in the GC header required by the selected plan */
027      public static final int GC_HEADER_BITS = Selected.Constraints.get().gcHeaderBits();
028      /** Number of additional bytes required in the header by the selected plan */
029      public static final int GC_HEADER_BYTES = Selected.Constraints.get().gcHeaderWords() << LOG_BYTES_IN_WORD;
030      /** {@code true} if the selected plan requires concurrent worker threads */
031      public static final boolean NEEDS_CONCURRENT_WORKERS = Selected.Constraints.get().needsConcurrentWorkers();
032      /** {@code true} if the selected plan needs support for generating a GC trace */
033      public static final boolean GENERATE_GC_TRACE = Selected.Constraints.get().generateGCTrace();
034      /** {@code true} if the selected plan may move objects */
035      public static final boolean MOVES_OBJECTS = Selected.Constraints.get().movesObjects();
036      /** {@code true} if the selected plan moves TIB objects */
037      public static final boolean MOVES_TIBS = false;
038      /** {@code true} if the selected plan moves code */
039      public static final boolean MOVES_CODE = false;
040    }
041