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.ir;
014
015import org.jikesrvm.compilers.common.CodeArray;
016import org.jikesrvm.compilers.opt.mir2mc.MachineCodeOffsets;
017import org.jikesrvm.compilers.opt.regalloc.LinearScanState;
018import org.jikesrvm.compilers.opt.regalloc.RegisterAllocatorState;
019import org.jikesrvm.osr.VariableMap;
020
021/**
022 * Wrapper class around IR info that is valid on the MIR
023 */
024public final class MIRInfo {
025
026  /**
027   * The generated machinecodes produced by this compilation of 'method'
028   */
029  public CodeArray machinecode;
030
031  /**
032   * Estimate produced by FinalMIRExpansion and used by
033   * Assembler to create code array; only meaningful on PowerPC
034   */
035  public int mcSizeEstimate;
036
037  /**
038   * The IRMap for the method (symbolic GCMapping info)
039   */
040  public GCIRMap gcIRMap;
041
042  public VariableMap osrVarMap;
043  /**
044   * The frame size of the current method
045   */
046  public int frameSize;
047
048  /**
049   * The number of floating point stack slots allocated.
050   * (Only used on IA32)
051   */
052  public int fpStackHeight;
053
054  /**
055   * A basic block holding the call to Thread.threadSwitch for a
056   * prologue.
057   */
058  public BasicBlock prologueYieldpointBlock = null;
059
060  /**
061   * A basic block holding the call to Thread.threadSwitch for an
062   * epilogue.
063   */
064  public BasicBlock epilogueYieldpointBlock = null;
065
066  /**
067   * A basic block holding the call to Thread.threadSwitch for a
068   * backedge.
069   */
070  public BasicBlock backedgeYieldpointBlock = null;
071
072  /**
073   * A basic block holding the call to yieldpointFromOsrOpt for an
074   * OSR invalidation.
075   */
076  public BasicBlock osrYieldpointBlock = null;
077
078  /**
079   * Information needed for linear scan.
080   */
081  public LinearScanState linearScanState = null;
082
083  public RegisterAllocatorState regAllocState = null;
084
085  public MachineCodeOffsets mcOffsets = null;
086
087  public MIRInfo(IR ir) {
088    ir.compiledMethod.setSaveVolatile(ir.method.getDeclaringClass().hasSaveVolatileAnnotation());
089    ir.compiledMethod.setOptLevel(ir.options.getOptLevel());
090  }
091
092}