/*
* THIS FILE IS MACHINE_GENERATED. DO NOT EDIT.
* See InstructionFormats.template, CommonOperands.dat,
* OperatorList.dat, etc.
*/
package org.jikesrvm.compilers.opt.ir;
import org.jikesrvm.VM_Configuration;
/**
* InstructionFormats that have a BranchProfile (which is OPT_BranchProfileOperand)
*/
public final class BranchProfileCarrier extends OPT_InstructionFormat {
private static final int[] _index = {
-1 // Unassigned
, -1 // Move
, -1 // Return
, -1 // Prologue
, -1 // InstrumentedCounter
, -1 // Empty
, -1 // Nullary
, -1 // New
, -1 // NewArray
, -1 // Multianewarray
, -1 // Athrow
, -1 // MonitorOp
, -1 // CacheOp
, -1 // NullCheck
, -1 // ZeroCheck
, -1 // BoundsCheck
, -1 // StoreCheck
, -1 // TypeCheck
, -1 // InstanceOf
, -1 // Trap
, -1 // TrapIf
, 5 // IfCmp
, -1 // IfCmp2
, 4 // InlineGuard
, 4 // BooleanCmp
, -1 // CondMove
, -1 // Goto
, -1 // Label
, -1 // BBend
, -1 // Unary
, -1 // GuardedUnary
, -1 // Binary
, -1 // GuardedBinary
, -1 // GuardedSet
, -1 // ALoad
, -1 // GetField
, -1 // GetStatic
, -1 // Load
, -1 // AStore
, -1 // PutField
, -1 // PutStatic
, -1 // Store
, -1 // Prepare
, -1 // Attempt
, -1 // Call
, -1 // TableSwitch
, -1 // LookupSwitch
, -1 // LowTableSwitch
, -1 // Phi
, -1 // OsrBarrier
, -1 // OsrPoint
, -1 // MIR_LowTableSwitch
, -1 // MIR_Move
, -1 // MIR_CondMove
, -1 // MIR_Lea
, -1 // MIR_BinaryAcc
, -1 // MIR_Divide
, -1 // MIR_Multiply
, -1 // MIR_ConvertDW2QW
, -1 // MIR_UnaryAcc
, -1 // MIR_Compare
, -1 // MIR_CompareExchange
, -1 // MIR_CompareExchange8B
, -1 // MIR_Trap
, -1 // MIR_TrapIf
, -1 // MIR_Branch
, 2 // MIR_CondBranch
, -1 // MIR_CondBranch2
, -1 // MIR_Call
, -1 // MIR_Empty
, -1 // MIR_Return
, -1 // MIR_Set
, -1 // MIR_Test
, -1 // MIR_Nullary
, -1 // MIR_UnaryNoRes
, -1 // MIR_Unary
, -1 // MIR_XChng
, -1 // MIR_DoubleShift
, -1 // MIR_CaseLabel
, -1 // MIR_FSave
, -1 // MIR_RDTSC
, -1 // MIR_CacheOp
};
/**
* Does the instruction belong to an instruction format that
* has an operand called BranchProfile?
* @param i the instruction to test
* @return <code>true</code> if the instruction's instruction
* format has an operand called BranchProfile and
* <code>false</code> if it does not.
*/
public static boolean conforms(OPT_Instruction i) {
return conforms(i.operator);
}
/**
* Does the operator belong to an instruction format that
* has an operand called BranchProfile?
* @param o the operator to test
* @return <code>true</code> if the instruction's instruction
* format has an operand called BranchProfile and
* <code>false</code> if it does not.
*/
public static boolean conforms(OPT_Operator o) {
return _index[o.format] != -1;
}
/**
* Get the operand called BranchProfile from the
* argument instruction. Note that the returned operand
* will still point to its containing instruction.
* @param i the instruction to fetch the operand from
* @return the operand called BranchProfile
*/
public static OPT_BranchProfileOperand getBranchProfile(OPT_Instruction i) {
if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "BranchProfileCarrier");
int index = _index[i.operator.format];
return (OPT_BranchProfileOperand) i.getOperand(index);
}
/**
* Get the operand called BranchProfile from the argument
* instruction clearing its instruction pointer. The returned
* operand will not point to any containing instruction.
* @param i the instruction to fetch the operand from
* @return the operand called BranchProfile
*/
public static OPT_BranchProfileOperand getClearBranchProfile(OPT_Instruction i) {
if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "BranchProfileCarrier");
int index = _index[i.operator.format];
return (OPT_BranchProfileOperand) i.getClearOperand(index);
}
/**
* Set the operand called BranchProfile in the argument
* instruction to the argument operand. The operand will
* now point to the argument instruction as its containing
* instruction.
* @param i the instruction in which to store the operand
* @param op the operand to store
*/
public static void setBranchProfile(OPT_Instruction i, OPT_BranchProfileOperand op) {
if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "BranchProfileCarrier");
int index = _index[i.operator.format];
i.putOperand(index, op);
}
/**
* Return the index of the operand called BranchProfile
* in the argument instruction.
* @param i the instruction to access.
* @return the index of the operand called BranchProfile
* in the argument instruction
*/
public static int indexOfBranchProfile(OPT_Instruction i) {
if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "BranchProfileCarrier");
return _index[i.operator.format];
}
/**
* Does the argument instruction have a non-null
* operand named BranchProfile?
* @param i the instruction to access.
* @return <code>true</code> if the instruction has an non-null
* operand named BranchProfile or <code>false</code>
* if it does not.
*/
public static boolean hasBranchProfile(OPT_Instruction i) {
if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "BranchProfileCarrier");
int index = _index[i.operator.format];
return i.getOperand(index) != null;
}
}