Exemplo n.º 1
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.º 2
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);
 }