Example #1
0
 /**
  * Mutate the argument instruction into an instruction of the Unary 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 Val the instruction's Val operand
  * @return the mutated instruction
  */
 public static Instruction mutate(Instruction i, Operator o, RegisterOperand Result, Operand Val) {
   if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Unary");
   i.operator = o;
   i.putOperand(0, Result);
   i.putOperand(1, Val);
   return i;
 }
Example #2
0
 /**
  * Create an instruction of the MIR_Store instruction format.
  *
  * @param o the instruction's operator
  * @param Value the instruction's Value operand
  * @param Address the instruction's Address operand
  * @param Offset the instruction's Offset operand
  * @return the newly created MIR_Store instruction
  */
 public static Instruction create(
     Operator o, RegisterOperand Value, RegisterOperand Address, Operand Offset) {
   if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Store");
   Instruction i = new Instruction(o, 5);
   i.putOperand(0, Value);
   i.putOperand(1, Address);
   i.putOperand(2, Offset);
   return i;
 }
Example #3
0
 /**
  * Create an instruction of the StoreCheck instruction format.
  *
  * @param o the instruction's operator
  * @param GuardResult the instruction's GuardResult operand
  * @param Ref the instruction's Ref operand
  * @param Val the instruction's Val operand
  * @param Guard the instruction's Guard operand
  * @return the newly created StoreCheck instruction
  */
 public static Instruction create(
     Operator o, RegisterOperand GuardResult, Operand Ref, Operand Val, Operand Guard) {
   if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "StoreCheck");
   Instruction i = new Instruction(o, 5);
   i.putOperand(0, GuardResult);
   i.putOperand(1, Ref);
   i.putOperand(2, Val);
   i.putOperand(3, Guard);
   return i;
 }
Example #4
0
 /**
  * Mutate the argument instruction into an instruction of the MIR_Store instruction format having
  * the specified operator and operands.
  *
  * @param i the instruction to mutate
  * @param o the instruction's operator
  * @param Value the instruction's Value operand
  * @param Address the instruction's Address operand
  * @param Offset the instruction's Offset operand
  * @return the mutated instruction
  */
 public static Instruction mutate(
     Instruction i, Operator o, RegisterOperand Value, RegisterOperand Address, Operand Offset) {
   if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Store");
   i.operator = o;
   i.putOperand(0, Value);
   i.putOperand(1, Address);
   i.putOperand(2, Offset);
   i.putOperand(3, null);
   i.putOperand(4, null);
   return i;
 }
Example #5
0
 /**
  * Create an instruction of the InlineGuard instruction format.
  *
  * @param o the instruction's operator
  * @param Value the instruction's Value operand
  * @param Guard the instruction's Guard operand
  * @param Goal the instruction's Goal operand
  * @param Target the instruction's Target operand
  * @param BranchProfile the instruction's BranchProfile operand
  * @return the newly created InlineGuard instruction
  */
 public static Instruction create(
     Operator o,
     Operand Value,
     Operand Guard,
     Operand Goal,
     BranchOperand Target,
     BranchProfileOperand BranchProfile) {
   if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "InlineGuard");
   Instruction i = new Instruction(o, 5);
   i.putOperand(0, Value);
   i.putOperand(1, Guard);
   i.putOperand(2, Goal);
   i.putOperand(3, Target);
   i.putOperand(4, BranchProfile);
   return i;
 }
Example #6
0
  /**
   * Mutate the argument instruction into an instruction of the Attempt 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 Address the instruction's Address operand
   * @param Offset the instruction's Offset operand
   * @param OldValue the instruction's OldValue operand
   * @param NewValue the instruction's NewValue operand
   * @param Location the instruction's Location operand
   * @return the mutated instruction
   */
  public static Instruction mutate(
      Instruction i,
      Operator o,
      RegisterOperand Result,
      Operand Address,
      Operand Offset,
      Operand OldValue,
      Operand NewValue,
      LocationOperand Location) {
    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Attempt");
    i.resizeNumberOfOperands(7);

    i.operator = o;
    i.putOperand(0, Result);
    i.putOperand(1, Address);
    i.putOperand(2, Offset);
    i.putOperand(3, OldValue);
    i.putOperand(4, NewValue);
    i.putOperand(5, Location);
    i.putOperand(6, null);
    return i;
  }
Example #7
0
 /**
  * Create an instruction of the Attempt instruction format.
  *
  * @param o the instruction's operator
  * @param Result the instruction's Result operand
  * @param Address the instruction's Address operand
  * @param Offset the instruction's Offset operand
  * @param OldValue the instruction's OldValue operand
  * @param NewValue the instruction's NewValue operand
  * @param Location the instruction's Location operand
  * @param Guard the instruction's Guard operand
  * @return the newly created Attempt instruction
  */
 public static Instruction create(
     Operator o,
     RegisterOperand Result,
     Operand Address,
     Operand Offset,
     Operand OldValue,
     Operand NewValue,
     LocationOperand Location,
     Operand Guard) {
   if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Attempt");
   Instruction i = new Instruction(o, 7);
   i.putOperand(0, Result);
   i.putOperand(1, Address);
   i.putOperand(2, Offset);
   i.putOperand(3, OldValue);
   i.putOperand(4, NewValue);
   i.putOperand(5, Location);
   i.putOperand(6, Guard);
   return i;
 }
Example #8
0
 /**
  * Get the operand called Guard 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 Guard
  */
 public static Operand getGuard(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Store");
   return (Operand) i.getOperand(4);
 }
Example #9
0
 /**
  * Get the operand called GuardResult 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 GuardResult
  */
 public static RegisterOperand getGuardResult(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "StoreCheck");
   return (RegisterOperand) i.getOperand(0);
 }
Example #10
0
 /**
  * Set the operand called Guard 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 Guard the operand to store
  */
 public static void setGuard(Instruction i, Operand Guard) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "StoreCheck");
   i.putOperand(3, Guard);
 }
Example #11
0
 /**
  * Does the argument instruction have a non-null operand named Guard?
  *
  * @param i the instruction to access.
  * @return <code>true</code> if the instruction has an non-null operand named Guard or <code>false
  *     </code> if it does not.
  */
 public static boolean hasGuard(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "StoreCheck");
   return i.getOperand(3) != null;
 }
Example #12
0
 /**
  * Get the operand called Target 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 Target
  */
 public static BranchOperand getTarget(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   return (BranchOperand) i.getOperand(3);
 }
Example #13
0
 /**
  * Get the operand called Guard 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 Guard
  */
 public static Operand getClearGuard(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "StoreCheck");
   return (Operand) i.getClearOperand(3);
 }
Example #14
0
 /**
  * Does the argument instruction have a non-null operand named Result?
  *
  * @param i the instruction to access.
  * @return <code>true</code> if the instruction has an non-null operand named Result or <code>
  *     false</code> if it does not.
  */
 public static boolean hasResult(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Unary");
   return i.getOperand(0) != null;
 }
Example #15
0
 /**
  * Set the operand called Val 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 Val the operand to store
  */
 public static void setVal(Instruction i, Operand Val) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Unary");
   i.putOperand(1, Val);
 }
Example #16
0
 /**
  * Set the operand called Value 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 Value the operand to store
  */
 public static void setValue(Instruction i, RegisterOperand Value) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Store");
   i.putOperand(0, Value);
 }
Example #17
0
 /**
  * Get the operand called Result 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 Result
  */
 public static RegisterOperand getClearResult(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Unary");
   return (RegisterOperand) i.getClearOperand(0);
 }
Example #18
0
 /**
  * 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 BranchProfile the operand to store
  */
 public static void setBranchProfile(Instruction i, BranchProfileOperand BranchProfile) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   i.putOperand(4, BranchProfile);
 }
Example #19
0
 /**
  * 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 BranchProfileOperand getClearBranchProfile(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   return (BranchProfileOperand) i.getClearOperand(4);
 }
Example #20
0
 /**
  * Set the operand called Target 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 Target the operand to store
  */
 public static void setTarget(Instruction i, BranchOperand Target) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   i.putOperand(3, Target);
 }
Example #21
0
 /**
  * Set the operand called GuardResult 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 GuardResult the operand to store
  */
 public static void setGuardResult(Instruction i, RegisterOperand GuardResult) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "StoreCheck");
   i.putOperand(0, GuardResult);
 }
Example #22
0
 /**
  * Get the operand called Value 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 Value
  */
 public static RegisterOperand getClearValue(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Store");
   return (RegisterOperand) i.getClearOperand(0);
 }
Example #23
0
 /**
  * Get the operand called Val 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 Val
  */
 public static Operand getClearVal(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Unary");
   return (Operand) i.getClearOperand(1);
 }
Example #24
0
 /**
  * Set the operand called Ref 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 Ref the operand to store
  */
 public static void setRef(Instruction i, Operand Ref) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "StoreCheck");
   i.putOperand(1, Ref);
 }
Example #25
0
 /**
  * Get the operand called Value 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 Value
  */
 public static Operand getClearValue(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   return (Operand) i.getClearOperand(0);
 }
Example #26
0
 /**
  * Set the operand called Goal 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 Goal the operand to store
  */
 public static void setGoal(Instruction i, Operand Goal) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   i.putOperand(2, Goal);
 }
Example #27
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(Instruction i, RegisterOperand Result) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Unary");
   i.putOperand(0, Result);
 }
Example #28
0
 /**
  * Set the operand called Value 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 Value the operand to store
  */
 public static void setValue(Instruction i, Operand Value) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   i.putOperand(0, Value);
 }
Example #29
0
 /** Constructor for interior node. */
 public BURS_TreeNode(DepGraphNode n) {
   Instruction instr = n._instr;
   dg_node = n;
   opcode = instr.getOpcode();
 }
Example #30
0
 /**
  * Does the argument instruction have a non-null operand named Value?
  *
  * @param i the instruction to access.
  * @return <code>true</code> if the instruction has an non-null operand named Value or <code>false
  *     </code> if it does not.
  */
 public static boolean hasValue(Instruction i) {
   if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "InlineGuard");
   return i.getOperand(0) != null;
 }