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 */
013package org.mmtk.vm;
014
015import org.mmtk.utility.Log;
016import org.mmtk.utility.statistics.Xml;
017
018public class Config {
019  /** The name of the active plan */
020  private final String ACTIVE_PLAN;
021
022  /** Mark bit in the header or on the side ? */
023  public final boolean HEADER_MARK_BITS;
024
025  /** Zero pages on release? */
026  public final boolean ZERO_PAGES_ON_RELEASE;
027
028  Config(BuildTimeConfig config) {
029    ACTIVE_PLAN            = config.getPlanName();
030    HEADER_MARK_BITS        = config.getBooleanProperty("mmtk.headerMarkBit",true);
031    ZERO_PAGES_ON_RELEASE  = config.getBooleanProperty("mmtk.zeroPagesOnRelease",false);
032  }
033
034  public void printConfig() {
035    Log.writeln("================ MMTk Configuration ================");
036    Log.write("plan = "); Log.writeln(ACTIVE_PLAN);
037    Log.write("HEADER_MARK_BITS = ");  Log.writeln(HEADER_MARK_BITS);
038    Log.write("ZERO_PAGES_ON_RELEASE = ");  Log.writeln(ZERO_PAGES_ON_RELEASE);
039    Log.writeln("====================================================");
040  }
041
042  public void printConfigXml() {
043    Log.writeln("<config>");
044    Xml.configItem("plan",ACTIVE_PLAN);
045    Xml.configItem("header-mark-bit",HEADER_MARK_BITS);
046    Xml.configItem("zero-pages-on-release",ZERO_PAGES_ON_RELEASE);
047    Log.writeln("</config>");
048  }
049}