Exemplo n.º 1
0
 /**
  * Create an instruction of the Multianewarray instruction format.
  *
  * @param o the instruction's operator
  * @param Result the instruction's Result operand
  * @param Type the instruction's Type operand
  * @param numVarOps the number of variable length operands that will be stored in the insruction.
  * @return the newly created Multianewarray instruction
  */
 public static OPT_Instruction create(
     OPT_Operator o, OPT_RegisterOperand Result, OPT_TypeOperand Type, int numVarOps) {
   if (VM_Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Multianewarray");
   OPT_Instruction i = new OPT_Instruction(o, Math.max(2 + numVarOps, MIN_OPERAND_ARRAY_LENGTH));
   i.putOperand(0, Result);
   i.putOperand(1, Type);
   return i;
 }
Exemplo n.º 2
0
  /**
   * Mutate the argument instruction into an instruction of the Multianewarray instruction format
   * having the specified operator and operands.
   *
   * @param i the instruction to mutate
   * @param o the instruction's operator
   * @param Result the instruction's Result operand
   * @param Type the instruction's Type operand
   * @param numVarOps the number of variable length operands that will be stored in the insruction.
   * @return the mutated instruction
   */
  public static OPT_Instruction mutate(
      OPT_Instruction i,
      OPT_Operator o,
      OPT_RegisterOperand Result,
      OPT_TypeOperand Type,
      int numVarOps) {
    if (VM_Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Multianewarray");
    if (2 + numVarOps > MIN_OPERAND_ARRAY_LENGTH) i.resizeNumberOfOperands(2 + numVarOps);

    i.operator = o;
    i.putOperand(0, Result);
    i.putOperand(1, Type);
    return i;
  }
Exemplo n.º 3
0
 /**
  * Set the operand called Result 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 Result the operand to store
  */
 public static void setResult(OPT_Instruction i, OPT_RegisterOperand Result) {
   if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Multianewarray");
   i.putOperand(0, Result);
 }
Exemplo n.º 4
0
 /**
  * Change the number of Dimensions that may be stored in the argument instruction to numVarOps.
  *
  * @param i the instruction to access
  * @param numVarOps the new number of variable operands called Dimensions that may be stored in
  *     the instruction
  */
 public static void resizeNumberOfDimensions(OPT_Instruction i, int numVarOps) {
   if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Multianewarray");
   if (2 + numVarOps > MIN_OPERAND_ARRAY_LENGTH) i.resizeNumberOfOperands(2 + numVarOps);
   else for (int j = 2 + numVarOps; j < MIN_OPERAND_ARRAY_LENGTH; j++) i.putOperand(j, null);
 }
Exemplo n.º 5
0
 /**
  * Set the k'th operand called Dimension 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 k the index of the operand
  * @param o the operand to store
  */
 public static void setDimension(OPT_Instruction i, int k, OPT_Operand o) {
   if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Multianewarray");
   i.putOperand(2 + k, o);
 }
Exemplo n.º 6
0
 /**
  * Set the operand called Type 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 Type the operand to store
  */
 public static void setType(OPT_Instruction i, OPT_TypeOperand Type) {
   if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Multianewarray");
   i.putOperand(1, Type);
 }