counterInst.insertBefore(Unary.create(MATERIALIZE_CONSTANT, incValReg, incOperand));
counterInst.insertBefore(Binary.create(MATERIALIZE_CONSTANT, incValReg, ir.regpool.makeJTOCOp(ir,counterInst), incOperand));
  public void mutateOptEventCounterInstruction(OPT_Instruction counterInst, 					       OPT_IR ir)  {    if (VM.VerifyAssertions)      VM.assert(InstrumentedCounter.conforms(counterInst));    OPT_IntConstantOperand intOp =      InstrumentedCounter.getData(counterInst);    int handle = intOp.value;    intOp = InstrumentedCounter.getIndex(counterInst);    int index = intOp.value;    // Get the base of array    OPT_RegisterOperand counterArray =  OPT_ConvertToLowLevelIR.      getStatic(counterInst, ir, counterArraysField);    // load counterArrays[handle]    OPT_RegisterOperand array2 =      InsertALoadOffset(counterInst,                        ir, REF_ALOAD,                        VM_Type.JavaLangObjectType,                        counterArray, handle);    OPT_ConvertToLowLevelIR.      doArrayLoad(counterInst.prevInstructionInCodeOrder(), ir, INT_LOAD, 2);                                                                                   // load counterArrays[handle][index]    OPT_RegisterOperand origVal =      InsertALoadOffset(counterInst,                        ir, DOUBLE_ALOAD,                        VM_Type.DoubleType,                        array2, index);    OPT_ConvertToLowLevelIR.      doArrayLoad(counterInst.prevInstructionInCodeOrder(),ir, DOUBLE_LOAD, 3);        OPT_Operand incOperand = InstrumentedCounter.getIncrement(counterInst);    OPT_RegisterOperand incValReg = null;    if (incOperand instanceof OPT_RegisterOperand) {      // Get the increment value.  If the counters were inserted in HIR,      // the double will have been lowered and thus will be an      // OPT_RegisterOperand.      incValReg = (OPT_RegisterOperand) InstrumentedCounter.	getIncrement(counterInst);    }    else {      // If the counter was inserted in LIR, it needs to be      // materialized manually.      incValReg = ir.regpool.makeTemp(VM_Type.DoubleType);      counterInst.insertBefore(Unary.create(MATERIALIZE_CONSTANT, incValReg,					    incOperand));    }    // Insert increment instruction    OPT_RegisterOperand newValue =      OPT_ConvertToLowLevelIR.InsertBinary(counterInst, ir, DOUBLE_ADD,                                           VM_Type.DoubleType, origVal,                                           incValReg.copyD2U());    // Store it    OPT_Instruction store = AStore.mutate(counterInst,DOUBLE_ASTORE,                                         newValue, array2.copyU2D(),                                         OPT_IRTools.I(index),null,null);    OPT_ConvertToLowLevelIR.doArrayStore(store, ir, DOUBLE_STORE, 3);                                         }