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.driver;
014
015import static org.jikesrvm.compilers.opt.ir.Operators.INT_LOAD;
016import static org.jikesrvm.compilers.opt.ir.Operators.LONG_LOAD;
017
018import org.jikesrvm.VM;
019import org.jikesrvm.classloader.TypeReference;
020import org.jikesrvm.compilers.opt.ir.Operator;
021
022/**
023 * Class that holds miscellaneous constants used in the opt compiler
024 */
025public final class OptConstants {
026  // the following constants are dummy bytecode indices,
027  // used to mark IR instructions that do not correspond
028  // to any original bytecode
029  public static final int UNKNOWN_BCI = -1;
030  public static final int PROLOGUE_BCI = -2;
031  public static final int EPILOGUE_BCI = -3;
032  public static final int RECTIFY_BCI = -4;
033  public static final int SYNTH_CATCH_BCI = -5;
034  public static final int SYNCHRONIZED_MONITORENTER_BCI = -6;
035  public static final int SYNCHRONIZED_MONITOREXIT_BCI = -7;
036  public static final int METHOD_COUNTER_BCI = -8;
037  public static final int SSA_SYNTH_BCI = -9;
038  public static final int INSTRUMENTATION_BCI = -10;
039  public static final int RUNTIME_SERVICES_BCI = -11;
040  public static final int EXTANT_ANALYSIS_BCI = -12;
041  public static final int PROLOGUE_BLOCK_BCI = -13;
042  public static final int EPILOGUE_BLOCK_BCI = -14;
043  public static final int OSR_PROLOGUE = -15;
044  public static final int SYNTH_LOOP_VERSIONING_BCI = -16;
045
046  // The following are used as trinary return values in OptCompiler code
047  public static final byte NO = 0;
048  public static final byte YES = 1;
049  public static final byte MAYBE = 2;
050
051  public static final Operator IA32_REF_LOAD = VM.BuildFor32Addr ? INT_LOAD : LONG_LOAD;
052  public static final TypeReference PRIMITIVE_TYPE_FOR_WORD =
053    VM.BuildFor32Addr ? TypeReference.Int : TypeReference.Long;
054
055  private OptConstants() {
056    // prevent instantiation
057  }
058}