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.jikesrvm.compilers.opt.regalloc;
014
015import org.jikesrvm.compilers.opt.OptOptions;
016import org.jikesrvm.compilers.opt.driver.OptimizationPlanAtomicElement;
017import org.jikesrvm.compilers.opt.driver.OptimizationPlanCompositeElement;
018import org.jikesrvm.compilers.opt.driver.OptimizationPlanElement;
019
020/**
021 * Main driver for linear scan register allocation.
022 */
023public final class LinearScan extends OptimizationPlanCompositeElement {
024
025  /**
026   * Build this phase as a composite of others.
027   */
028  LinearScan() {
029    super("Linear Scan Composite Phase",
030          new OptimizationPlanElement[]{new OptimizationPlanAtomicElement(new IntervalAnalysis()),
031                                            new OptimizationPlanAtomicElement(new RegisterRestrictionsPhase()),
032                                            new OptimizationPlanAtomicElement(new LinearScanPhase()),
033                                            new OptimizationPlanAtomicElement(new UpdateGCMaps1()),
034                                            new OptimizationPlanAtomicElement(new SpillCode()),
035                                            new OptimizationPlanAtomicElement(new UpdateGCMaps2()),
036                                            new OptimizationPlanAtomicElement(new UpdateOSRMaps()),});
037  }
038
039  /*
040   * debug flags
041   */
042  static final boolean DEBUG = false;
043  static final boolean VERBOSE_DEBUG = false;
044  static final boolean GC_DEBUG = false;
045  static final boolean DEBUG_COALESCE = false;
046
047  /**
048   * Register allocation is required
049   */
050  @Override
051  public boolean shouldPerform(OptOptions options) {
052    return true;
053  }
054
055  @Override
056  public String getName() {
057    return "Linear Scan Composite Phase";
058  }
059
060  @Override
061  public boolean printingEnabled(OptOptions options, boolean before) {
062    return false;
063  }
064}