nus-yam/ex-repair huggingface dataset:
Program: 149813
Project: 149813
Buggy source:
/** 
 * Returns the number of operands that are pure uses. By convention, operands are ordered in instructions such that all defs are first, followed by all combined defs/uses, followed by all pure uses.
 * @return number of operands that are defs
 */
public int getNumberOfPureUses(){
  if (operator.hasVarDefs()) {
    if (VM.VerifyAssertions) {
      VM._assert(operator.getNumberOfDefUses() == 0);
    }
    int numOps=operator.getNumberOfFixedPureUses();
    int i=getNumberOfDefs() + numOps;
    for (; i < ops.length; i++) {
      if (ops[i] == null)       break;
      numOps++;
    }
    return numOps;
  }
 else {
    return operator.getNumberOfFixedPureUses();
  }
}

Fixed version (ground truth):
/** 
 * Returns the number of operands that are pure uses. By convention, operands are ordered in instructions such that all defs are first, followed by all combined defs/uses, followed by all pure uses.
 * @return number of operands that are defs
 */
public int getNumberOfPureUses(){
  if (operator.hasVarDefs()) {
    if (VM.VerifyAssertions) {
      VM._assert(operator.getNumberOfDefUses() == 0);
    }
    int numOps=operator.getNumberOfFixedPureUses();
    int i=getNumberOfDefs() + numOps;
    for (; i < ops.length; i++) {
      if (ops[i] == null)       break;
      numOps++;
    }
    return numOps;
  }
 else {
    if (operator.hasVarUses()) {
      return getNumberOfOperands() - operator.getNumberOfDefs();
    }
 else {
      return operator.getNumberOfFixedPureUses();
    }
  }
}
Program: 149815
Project: 149815
Buggy source:
public Offset minus(Offset off2){
  return new Offset(value + off2.value);
}

Fixed version (ground truth):
public Offset minus(Offset off2){
  return new Offset(value - off2.value);
}
Program: 149816
Project: 149816
Buggy source:
/** 
 * This method must be included, as it is used by ResourceBundle.getBundle(), and other places as well. The reference implementation of this method uses the getStackClassLoader() method. Returns the ClassLoader of the method that called the caller. i.e. A.x() calls B.y() calls callerClassLoader(), A's ClassLoader will be returned. Returns null for the bootstrap ClassLoader.
 * @return a ClassLoader or null for the bootstrap ClassLoader
 * @throws SecurityException when called from a non-bootstrap Class
 */
public static ClassLoader callerClassLoader(){
  if (org.jikesrvm.VM.runningVM) {
    ClassLoader ans=RVMClass.getClassLoaderFromStackFrame(1);
    if (ans == BootstrapClassLoader.getBootstrapClassLoader()) {
      return null;
    }
 else {
      return ans;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * This method must be included, as it is used by ResourceBundle.getBundle(), and other places as well. The reference implementation of this method uses the getStackClassLoader() method. Returns the ClassLoader of the method that called the caller. i.e. A.x() calls B.y() calls callerClassLoader(), A's ClassLoader will be returned. Returns null for the bootstrap ClassLoader.
 * @return a ClassLoader or null for the bootstrap ClassLoader
 * @throws SecurityException when called from a non-bootstrap Class
 */
public static ClassLoader callerClassLoader(){
  if (org.jikesrvm.VM.runningVM) {
    ClassLoader ans=RVMClass.getClassLoaderFromStackFrame(2);
    if (ans == BootstrapClassLoader.getBootstrapClassLoader()) {
      return null;
    }
 else {
      return ans;
    }
  }
 else {
    return null;
  }
}
Program: 149817
Project: 149817
Buggy source:
private static DefUseEffect mustImplementInterface(Instruction s){
  Operand ref=TypeCheck.getRef(s);
  if (ref.isNullConstant()) {
    Trap.mutate(s,TRAP,null,TrapCodeOperand.NullPtr());
    return DefUseEffect.TRAP_REDUCED;
  }
 else {
    TypeReference lhsType=TypeCheck.getType(s).getTypeRef();
    TypeReference rhsType=ref.getType();
    byte ans=ClassLoaderProxy.includesType(lhsType,rhsType);
    if (ans == OptConstants.YES) {
      Move.mutate(s,REF_MOVE,TypeCheck.getResult(s),ref);
      if (ref.isConstant())       return DefUseEffect.MOVE_FOLDED;
 else       return DefUseEffect.MOVE_REDUCED;
    }
 else     if (ans == OptConstants.NO) {
      RVMType rType=rhsType.peekType();
      if (rType != null && rType.isClassType() && rType.asClass().isFinal()) {
        Trap.mutate(s,TRAP,null,TrapCodeOperand.MustImplement());
        return DefUseEffect.TRAP_REDUCED;
      }
    }
    return DefUseEffect.UNCHANGED;
  }
}

Fixed version (ground truth):
private static DefUseEffect mustImplementInterface(Instruction s){
  Operand ref=TypeCheck.getRef(s);
  if (ref.isNullConstant()) {
    Trap.mutate(s,TRAP,null,TrapCodeOperand.NullPtr());
    return DefUseEffect.TRAP_REDUCED;
  }
 else {
    TypeReference lhsType=TypeCheck.getType(s).getTypeRef();
    TypeReference rhsType=ref.getType();
    byte ans=ClassLoaderProxy.includesType(lhsType,rhsType);
    if (ans == OptConstants.YES) {
      RVMType rType=rhsType.peekType();
      if (rType != null) {
        if (rType.isClassType() && rType.asClass().isInterface()) {
          return DefUseEffect.UNCHANGED;
        }
        Move.mutate(s,REF_MOVE,TypeCheck.getResult(s),ref);
        if (ref.isConstant())         return DefUseEffect.MOVE_FOLDED;
 else         return DefUseEffect.MOVE_REDUCED;
      }
 else {
        return DefUseEffect.UNCHANGED;
      }
    }
 else     if (ans == OptConstants.NO) {
      RVMType rType=rhsType.peekType();
      if (rType != null && rType.isClassType() && rType.asClass().isFinal()) {
        Trap.mutate(s,TRAP,null,TrapCodeOperand.MustImplement());
        return DefUseEffect.TRAP_REDUCED;
      }
    }
    return DefUseEffect.UNCHANGED;
  }
}
Program: 149818
Project: 149818
Buggy source:
/** 
 * Return the modifiers for the modeled method. The Modifier class should be used to decode the result.
 * @return the modifiers
 * @see java.lang.reflect.Modifier
 */
int getModifiers(){
  return getVMMethod().getModifiers();
}

Fixed version (ground truth):
/** 
 * Return the modifiers for the modeled method. The Modifier class should be used to decode the result.
 * @return the modifiers
 * @see java.lang.reflect.Modifier
 */
int getModifiers(){
  return getVMMember().getModifiers();
}
Program: 149819
Project: 149819
Buggy source:
/** 
 * Release one or more contiguous chunks associated with a discontiguous space.
 * @param chunk THe address of the start of the contiguous chunk or chunks
 * @return The number of chunks freed
 */
public int releaseDiscontiguousChunks(Address chunk){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(chunk.EQ(chunkAlign(chunk,true)));
  return Map.freeContiguousChunks(chunk);
}

Fixed version (ground truth):
/** 
 * Release one or more contiguous chunks associated with a discontiguous space.
 * @param chunk THe address of the start of the contiguous chunk or chunks
 * @return The number of chunks freed
 */
public int releaseDiscontiguousChunks(Address chunk){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(chunk.EQ(chunkAlign(chunk,true)));
  if (chunk.EQ(lastDiscontiguousRegion)) {
    lastDiscontiguousRegion=Map.getNextContiguousRegion(chunk);
  }
  return Map.freeContiguousChunks(chunk);
}
Program: 149821
Project: 149821
Buggy source:
private static DefUseEffect arrayLength(Instruction s){
  if (CF_FIELDS) {
    Operand op=GuardedUnary.getVal(s);
    if (op.isObjectConstant()) {
      int length=Array.getLength(op.asObjectConstant().value);
      Move.mutate(s,INT_MOVE,GuardedUnary.getClearResult(s),IC(length));
      return DefUseEffect.MOVE_FOLDED;
    }
 else     if (op.isNullConstant()) {
      return DefUseEffect.UNCHANGED;
    }
  }
  return DefUseEffect.UNCHANGED;
}

Fixed version (ground truth):
private static DefUseEffect arrayLength(Instruction s){
  if (CF_FIELDS) {
    Operand op=GuardedUnary.getVal(s);
    if (op.isObjectConstant()) {
      int length=0;
      if (op.getType().getArrayElementType().isCodeType()) {
        length=((VM_CodeArray)(op.asObjectConstant().value)).length();
      }
 else {
        length=Array.getLength(op.asObjectConstant().value);
      }
      Move.mutate(s,INT_MOVE,GuardedUnary.getClearResult(s),IC(length));
      return DefUseEffect.MOVE_FOLDED;
    }
 else     if (op.isNullConstant()) {
      return DefUseEffect.UNCHANGED;
    }
  }
  return DefUseEffect.UNCHANGED;
}
Program: 149822
Project: 149822
Buggy source:
/** 
 * A JNI helper function, to set the value pointed to by a C pointer of type (jboolean *).
 * @param boolPtr Native pointer to a jboolean variable to be set.   May bethe NULL pointer, in which case we do nothing.
 * @param val Value to set it to (usually TRUE)XXX There was a strange bug where calling this would crash the VM. That's why it's ifdef'd.  So the dozen-odd places in VM_JNIFunctions where I would use it instead have this code inlined, guarded with an #if.  --Steve Augart
 */
static void setBoolStar(Address boolPtr,boolean val){
  if (boolPtr.isZero()) {
    return;
  }
  if (val) {
    boolPtr.store((byte)1);
  }
 else {
    boolPtr.store((byte)0);
  }
}

Fixed version (ground truth):
/** 
 * A JNI helper function, to set the value pointed to by a C pointer of type (jboolean *).
 * @param boolPtr Native pointer to a jboolean variable to be set.   May bethe NULL pointer, in which case we do nothing.
 * @param val Value to set it to (usually TRUE)
 */
static void setBoolStar(Address boolPtr,boolean val){
  if (boolPtr.isZero()) {
    return;
  }
  if (val) {
    boolPtr.store((byte)1);
  }
 else {
    boolPtr.store((byte)0);
  }
}
Program: 149823
Project: 149823
Buggy source:
/** 
 * Mark final fields as being available as literals
 */
private void markFinalFieldsAsLiterals(){
  for (  VM_Field f : getStaticFields()) {
    if (f.isFinal()) {
      Offset fieldOffset=f.getOffset();
      if (VM_Statics.isReference(VM_Statics.offsetAsSlot(fieldOffset))) {
        VM_Statics.markAsReferenceLiteral(fieldOffset);
      }
 else {
        VM_Statics.markAsNumericLiteral(fieldOffset);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Mark final fields as being available as literals
 */
private void markFinalFieldsAsLiterals(){
  for (  VM_Field f : getStaticFields()) {
    if (f.isFinal()) {
      Offset fieldOffset=f.getOffset();
      if (VM_Statics.isReference(VM_Statics.offsetAsSlot(fieldOffset))) {
        VM_Statics.markAsReferenceLiteral(fieldOffset);
      }
 else {
        VM_Statics.markAsNumericLiteral(f.getSize(),fieldOffset);
      }
    }
  }
}
Program: 149824
Project: 149824
Buggy source:
/** 
 * Allocate a numeric slot in the jtoc.
 * @param size of slot
 * @param field is the slot for a field
 * @return offset of slot that was allocated as int(two slots are allocated for longs and doubles)
 */
public static synchronized Offset allocateNumericSlot(int size,boolean field){
  int slot;
  if (size == BYTES_IN_LONG) {
    nextNumericSlot--;
    if ((nextNumericSlot & 1) != 0) {
      nextNumericSlot--;
      numericSlotHole=nextNumericSlot + 2;
    }
    slot=nextNumericSlot;
    nextNumericSlot--;
  }
 else {
    if (numericSlotHole != middleOfTable) {
      slot=numericSlotHole;
      numericSlotHole=middleOfTable;
    }
 else {
      slot=nextNumericSlot;
      nextNumericSlot--;
    }
    if (field) {
      numericFieldVector.set(slot);
    }
  }
  if (nextNumericSlot < 0) {
    enlargeTable();
  }
  return slotAsOffset(slot);
}

Fixed version (ground truth):
/** 
 * Allocate a numeric slot in the jtoc.
 * @param size of slot
 * @param field is the slot for a field
 * @return offset of slot that was allocated as int(two slots are allocated for longs and doubles)
 */
public static synchronized Offset allocateNumericSlot(int size,boolean field){
  int slot;
  if (size == BYTES_IN_LONG) {
    nextNumericSlot--;
    if ((nextNumericSlot & 1) != 0) {
      nextNumericSlot--;
      numericSlotHole=nextNumericSlot + 2;
    }
    slot=nextNumericSlot;
    nextNumericSlot--;
    if (field) {
      numericFieldVector.set(slot);
      numericFieldVector.set(slot + 1);
    }
  }
 else {
    if (numericSlotHole != middleOfTable) {
      slot=numericSlotHole;
      numericSlotHole=middleOfTable;
    }
 else {
      slot=nextNumericSlot;
      nextNumericSlot--;
    }
    if (field) {
      numericFieldVector.set(slot);
    }
  }
  if (nextNumericSlot < 0) {
    enlargeTable();
  }
  return slotAsOffset(slot);
}
Program: 149825
Project: 149825
Buggy source:
/** 
 * Mark a slot that was previously a field as being a literal as its value is final
 */
public static synchronized void markAsNumericLiteral(Offset fieldOffset){
  int slot=offsetAsSlot(fieldOffset);
  numericFieldVector.clear(slot);
}

Fixed version (ground truth):
/** 
 * Mark a slot that was previously a field as being a literal as its value is final
 */
public static synchronized void markAsNumericLiteral(int size,Offset fieldOffset){
  int slot=offsetAsSlot(fieldOffset);
  if (size == BYTES_IN_LONG) {
    numericFieldVector.clear(slot);
    numericFieldVector.clear(slot + 1);
  }
 else {
    numericFieldVector.clear(slot);
  }
}
Program: 149826
Project: 149826
Buggy source:
/** 
 * Compute forward dependences from a given def to a given node.
 * @param op source operand
 * @param destNode destination node
 * @param lastExceptionNode node representing the last PEI
 */
private void computeForwardDependencesDef(Operand op,DepGraphNode destNode,DepGraphNode lastExceptionNode){
  if (!(op instanceof RegisterOperand))   return;
  RegisterOperand regOp=(RegisterOperand)op;
  DepGraphNode sourceNode=regOp.getRegister().dNode();
  if (sourceNode != null) {
    int type=regOp.getRegister().isValidation() ? GUARD_OUTPUT : REG_OUTPUT;
    sourceNode.insertOutEdge(destNode,type);
    if (lastExceptionNode != null && regOp.getRegister().spansBasicBlock() && currentBlock.hasExceptionHandlers()) {
      if (!ir.getHandlerLivenessComputed() || handlerLiveSet.contains(regOp.getRegister())) {
        lastExceptionNode.insertOutEdge(destNode,EXCEPTION_R);
      }
    }
  }
  regOp.getRegister().setdNode(destNode);
}

Fixed version (ground truth):
/** 
 * Compute forward dependences from a given def to a given node.
 * @param op source operand
 * @param destNode destination node
 * @param lastExceptionNode node representing the last PEI
 */
private void computeForwardDependencesDef(Operand op,DepGraphNode destNode,DepGraphNode lastExceptionNode){
  if (!(op instanceof RegisterOperand))   return;
  RegisterOperand regOp=(RegisterOperand)op;
  DepGraphNode sourceNode=regOp.getRegister().dNode();
  if (sourceNode != null) {
    int type=regOp.getRegister().isValidation() ? GUARD_OUTPUT : REG_OUTPUT;
    sourceNode.insertOutEdge(destNode,type);
  }
  if (lastExceptionNode != null && regOp.getRegister().spansBasicBlock() && currentBlock.hasExceptionHandlers()) {
    if (!ir.getHandlerLivenessComputed() || handlerLiveSet.contains(regOp.getRegister())) {
      lastExceptionNode.insertOutEdge(destNode,EXCEPTION_R);
    }
  }
  regOp.getRegister().setdNode(destNode);
}
Program: 149828
Project: 149828
Buggy source:
/** 
 * Prepare for a new collection increment.
 */
public void prepare(boolean majorGC){
  if (majorGC)   markState=ObjectHeader.deltaMarkState(markState,true);
  chunkMap.reset();
  defrag.prepare(chunkMap,this);
  inCollection=true;
  if (TMP_CHECK_REUSE_EFFICIENCY) {
    float ratio=(TMPreusableLineCount > 0) ? ((float)TMPreusedLineCount / (float)TMPreusableLineCount) : (float)1.0;
    Log.write("String_Node_Str");
    Log.write(TMPreusedLineCount);
    Log.write("String_Node_Str");
    Log.write(TMPreusableLineCount);
    Log.write("String_Node_Str");
    Log.write(ratio);
    ratio=(TMPreusableBlockCount > 0) ? ((float)TMPreusedBlockCount / (float)TMPreusableBlockCount) : (float)1.0;
    Log.write("String_Node_Str");
    Log.write(TMPreusedBlockCount);
    Log.write("String_Node_Str");
    Log.write(TMPreusableBlockCount);
    Log.write("String_Node_Str");
    Log.write(ratio);
    Log.write("String_Node_Str");
    TMPreusableLineCount=0;
    TMPreusedLineCount=0;
  }
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(VM.activePlan.collectorCount() <= MAX_COLLECTORS);
}

Fixed version (ground truth):
/** 
 * Prepare for a new collection increment.
 */
public void prepare(boolean majorGC){
  if (majorGC)   markState=ObjectHeader.deltaMarkState(markState,true);
  chunkMap.reset();
  defrag.prepare(chunkMap,this);
  inCollection=true;
  if (TMP_CHECK_REUSE_EFFICIENCY && Options.verbose.getValue() >= 1) {
    float ratio=(TMPreusableLineCount > 0) ? ((float)TMPreusedLineCount / (float)TMPreusableLineCount) : (float)1.0;
    Log.write("String_Node_Str");
    Log.write(TMPreusedLineCount);
    Log.write("String_Node_Str");
    Log.write(TMPreusableLineCount);
    Log.write("String_Node_Str");
    Log.write(ratio);
    ratio=(TMPreusableBlockCount > 0) ? ((float)TMPreusedBlockCount / (float)TMPreusableBlockCount) : (float)1.0;
    Log.write("String_Node_Str");
    Log.write(TMPreusedBlockCount);
    Log.write("String_Node_Str");
    Log.write(TMPreusableBlockCount);
    Log.write("String_Node_Str");
    Log.write(ratio);
    Log.write("String_Node_Str");
    TMPreusableLineCount=0;
    TMPreusedLineCount=0;
  }
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(VM.activePlan.collectorCount() <= MAX_COLLECTORS);
}
Program: 149829
Project: 149829
Buggy source:
/** 
 * Perform any required post allocation initialization
 * @param object the object ref to the storage to be initialized
 */
@Inline public void postAlloc(ObjectReference object,int bytes,boolean straddle){
  if (VM.VERIFY_ASSERTIONS && TMP_EXACT_ALLOC_TIME_STRADDLE_CHECK) {
    Address start=VM.objectModel.objectStartRef(object);
    Address end=VM.objectModel.getObjectEndAddress(object).minus(1);
    boolean sanityStraddle=start.toWord().xor(end.toWord()).toInt() >= BYTES_IN_LINE;
    VM.assertions._assert(sanityStraddle == straddle);
  }
  boolean setStraddleBit=(TMP_INEXACT_ALLOC_TIME_STRADDLE_CHECK && bytes > BYTES_IN_LINE) || (TMP_EXACT_ALLOC_TIME_STRADDLE_CHECK && straddle);
  if (setStraddleBit)   ObjectHeader.markAsStraddling(object);
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(ObjectHeader.isNewObject(object));
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!ObjectHeader.isForwardedOrMarked(object));
}

Fixed version (ground truth):
/** 
 * Perform any required post allocation initialization
 * @param object the object ref to the storage to be initialized
 */
@Inline public void postAlloc(ObjectReference object,int bytes,boolean straddle){
  if (VM.VERIFY_ASSERTIONS && TMP_EXACT_ALLOC_TIME_STRADDLE_CHECK) {
    Address start=VM.objectModel.objectStartRef(object);
    Address end=VM.objectModel.getObjectEndAddress(object).minus(1);
    boolean sanityStraddle=start.toWord().xor(end.toWord()).toInt() >= BYTES_IN_LINE;
    VM.assertions._assert(sanityStraddle == straddle);
  }
  boolean setStraddleBit=(TMP_INEXACT_ALLOC_TIME_STRADDLE_CHECK && bytes > BYTES_IN_LINE) || (TMP_EXACT_ALLOC_TIME_STRADDLE_CHECK && straddle);
  if (setStraddleBit)   ObjectHeader.markAsStraddling(object);
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(ObjectHeader.isNewObject(object));
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!ObjectHeader.isForwardedOrBeingForwarded(object));
}
Program: 149830
Project: 149830
Buggy source:
/** 
 * Test the liveness of an object during copying sticky mark bits collection
 * @param object The object in question
 * @return True if this object is known to be live (i.e. it is marked)
 */
@Inline public boolean copyNurseryIsLive(ObjectReference object){
  return ObjectHeader.isForwardedOrMarked(object) || ObjectHeader.testMarkState(object,markState);
}

Fixed version (ground truth):
/** 
 * Test the liveness of an object during copying sticky mark bits collection
 * @param object The object in question
 * @return True if this object is known to be live (i.e. it is marked)
 */
@Inline public boolean copyNurseryIsLive(ObjectReference object){
  return ObjectHeader.isForwardedOrBeingForwarded(object) || ObjectHeader.testMarkState(object,markState);
}
Program: 149831
Project: 149831
Buggy source:
/** 
 * Generic test of the liveness of an object
 * @param object The object in question
 * @return True if this object is known to be live (i.e. it is marked)
 */
@Inline public boolean isLive(ObjectReference object){
  if (TMP_SUPPORT_DEFRAG && defrag.inDefrag() && isDefragSource(object))   return ObjectHeader.isForwardedOrMarked(object) || ObjectHeader.testMarkState(object,markState);
 else   return ObjectHeader.testMarkState(object,markState);
}

Fixed version (ground truth):
/** 
 * Generic test of the liveness of an object
 * @param object The object in question
 * @return True if this object is known to be live (i.e. it is marked)
 */
@Inline public boolean isLive(ObjectReference object){
  if (TMP_SUPPORT_DEFRAG && defrag.inDefrag() && isDefragSource(object))   return ObjectHeader.isForwardedOrBeingForwarded(object) || ObjectHeader.testMarkState(object,markState);
 else   return ObjectHeader.testMarkState(object,markState);
}
Program: 149832
Project: 149832
Buggy source:
/** 
 * Perform any required post copy (i.e. in-GC allocation) initialization. This is relevant (for example) when Squish is used as the mature space in a copying GC.
 * @param object the object ref to the storage to be initialized
 * @param majorGC Is this copy happening during a major gc?
 */
@Inline public void postCopy(ObjectReference object,int bytes,boolean majorGC,boolean straddle){
  boolean setStraddleBit=(TMP_INEXACT_ALLOC_TIME_STRADDLE_CHECK && bytes > BYTES_IN_LINE) || (TMP_EXACT_ALLOC_TIME_STRADDLE_CHECK && straddle);
  ObjectHeader.writeMarkState(object,markState,setStraddleBit);
  if (!MARK_LINE_AT_SCAN_TIME && majorGC)   markLines(object);
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!ObjectHeader.isForwardedOrMarked(object));
  if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER)   VM.assertions._assert(ObjectHeader.isUnloggedObject(object));
}

Fixed version (ground truth):
/** 
 * Perform any required post copy (i.e. in-GC allocation) initialization. This is relevant (for example) when Squish is used as the mature space in a copying GC.
 * @param object the object ref to the storage to be initialized
 * @param majorGC Is this copy happening during a major gc?
 */
@Inline public void postCopy(ObjectReference object,int bytes,boolean majorGC,boolean straddle){
  boolean setStraddleBit=(TMP_INEXACT_ALLOC_TIME_STRADDLE_CHECK && bytes > BYTES_IN_LINE) || (TMP_EXACT_ALLOC_TIME_STRADDLE_CHECK && straddle);
  ObjectHeader.writeMarkState(object,markState,setStraddleBit);
  if (!MARK_LINE_AT_SCAN_TIME && majorGC)   markLines(object);
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!ObjectHeader.isForwardedOrBeingForwarded(object));
  if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER)   VM.assertions._assert(ObjectHeader.isUnloggedObject(object));
}
Program: 149834
Project: 149834
Buggy source:
/** 
 * Trace a reference to an object in the context of a non-moving collection.  This call is optimized for the simpler non-moving case.
 * @param trace The trace performing the transitive closure
 * @param object The object to be traced.
 */
@Inline private void traceObjectWithoutMoving(TransitiveClosure trace,ObjectReference object){
  Word markValue=Plan.NEEDS_LOG_BIT_IN_HEADER ? markState.or(ObjectHeader.UNLOGGED_BIT) : markState;
  Word oldMarkState=ObjectHeader.testAndMark(object,markValue);
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!defrag.inDefrag() || defrag.spaceExhausted() || !isDefragSource(object));
  if (oldMarkState != markValue) {
    if (!MARK_LINE_AT_SCAN_TIME)     ImmixSpace.markLines(object);
    trace.processNode(object);
  }
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!ObjectHeader.isForwardedOrMarked(object));
  if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER)   VM.assertions._assert(ObjectHeader.isUnloggedObject(object));
}

Fixed version (ground truth):
/** 
 * Trace a reference to an object in the context of a non-moving collection.  This call is optimized for the simpler non-moving case.
 * @param trace The trace performing the transitive closure
 * @param object The object to be traced.
 */
@Inline private void traceObjectWithoutMoving(TransitiveClosure trace,ObjectReference object){
  Word markValue=Plan.NEEDS_LOG_BIT_IN_HEADER ? markState.or(ObjectHeader.UNLOGGED_BIT) : markState;
  Word oldMarkState=ObjectHeader.testAndMark(object,markValue);
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!defrag.inDefrag() || defrag.spaceExhausted() || !isDefragSource(object));
  if (oldMarkState != markValue) {
    if (!MARK_LINE_AT_SCAN_TIME)     ImmixSpace.markLines(object);
    trace.processNode(object);
  }
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!ObjectHeader.isForwardedOrBeingForwarded(object));
  if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER)   VM.assertions._assert(ObjectHeader.isUnloggedObject(object));
}
Program: 149835
Project: 149835
Buggy source:
public static boolean isForwardedOrBeingForwarded(Word forwardingWord){
  return !forwardingWord.and(FORWARDING_MASK).isZero();
}

Fixed version (ground truth):
static boolean isForwardedOrBeingForwarded(Word forwardingWord){
  return !forwardingWord.and(FORWARDING_MASK).isZero();
}
Program: 149836
Project: 149836
Buggy source:
@Inline public static boolean isStraddleBitSet(Word header){
  return header.and(STRADDLE_BIT).EQ(STRADDLE_BIT);
}

Fixed version (ground truth):
@Inline private static boolean isStraddleBitSet(Word header){
  return header.and(STRADDLE_BIT).EQ(STRADDLE_BIT);
}
Program: 149837
Project: 149837
Buggy source:
@Inline public static boolean isPinnedObject(ObjectReference object){
  return isPinnedBitSet(VM.objectModel.readAvailableBitsWord(object));
}

Fixed version (ground truth):
@Inline static boolean isPinnedObject(ObjectReference object){
  return isPinnedBitSet(VM.objectModel.readAvailableBitsWord(object));
}
Program: 149838
Project: 149838
Buggy source:
/** 
 * Either return the forwarding pointer if the object is already forwarded (or being forwarded) or write the bit pattern that indicates that the object is being forwarded
 * @param object The object to be forwarded
 * @return The forwarding pointer for the object if it has alreadybeen forwarded.
 */
static Word attemptToBeForwarder(ObjectReference object){
  Word oldValue;
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    if (oldValue.and(IS_MARKED_MASK).EQ(MARKED))     return oldValue;
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,oldValue.or(BEING_FORWARDED)));
  return oldValue;
}

Fixed version (ground truth):
/** 
 * Either return the forwarding pointer if the object is already forwarded (or being forwarded) or write the bit pattern that indicates that the object is being forwarded
 * @param object The object to be forwarded
 * @return The forwarding pointer for the object if it has alreadybeen forwarded.
 */
static Word attemptToBeForwarder(ObjectReference object){
  Word oldValue;
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    if (oldValue.and(FORWARDING_MASK).EQ(FORWARDED))     return oldValue;
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,oldValue.or(BEING_FORWARDED)));
  return oldValue;
}
Program: 149839
Project: 149839
Buggy source:
@Inline public static boolean isPinnedBitSet(Word header){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(ImmixConstants.TMP_SUPPORT_PINNING);
  return header.and(PINNED_BIT).EQ(PINNED_BIT);
}

Fixed version (ground truth):
@Inline private static boolean isPinnedBitSet(Word header){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(ImmixConstants.TMP_SUPPORT_PINNING);
  return header.and(PINNED_BIT).EQ(PINNED_BIT);
}
Program: 149840
Project: 149840
Buggy source:
@Inline public static boolean isUnloggedBitSet(Word header){
  return header.and(UNLOGGED_BIT).EQ(UNLOGGED_BIT);
}

Fixed version (ground truth):
@Inline static boolean isUnloggedBitSet(Word header){
  return header.and(UNLOGGED_BIT).EQ(UNLOGGED_BIT);
}
Program: 149841
Project: 149841
Buggy source:
@Inline public static boolean isUnloggedObject(ObjectReference object){
  return isUnloggedBitSet(VM.objectModel.readAvailableBitsWord(object));
}

Fixed version (ground truth):
@Inline static boolean isUnloggedObject(ObjectReference object){
  return isUnloggedBitSet(VM.objectModel.readAvailableBitsWord(object));
}
Program: 149842
Project: 149842
Buggy source:
/** 
 * Return true if the mark count for an object has the given value.
 * @param object The object whose mark bit is to be tested
 * @param value The value against which the mark bit will be tested
 * @return True if the mark bit for the object has the given value.
 */
static boolean testMarkState(ObjectReference object,Word value){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(value.and(MARK_MASK).EQ(value));
  if (false && TMP_USE_BYTE_GRAIN_LOG_STORE) {
    return (VM.objectModel.readAvailableByte(object) & MARK_MASK.toInt()) == value.toInt();
  }
 else {
    return VM.objectModel.readAvailableBitsWord(object).and(MARK_MASK).EQ(value);
  }
}

Fixed version (ground truth):
static boolean testMarkState(Word forwardingWord,Word value){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(value.and(MARK_MASK).EQ(value));
  return forwardingWord.and(MARK_MASK).EQ(value);
}
Program: 149843
Project: 149843
Buggy source:
/** 
 * Allocate <code>pages</code> pages from this resource.<p> If the request can be satisfied, then ensure the pages are mmpapped and zeroed before returning the address of the start of the region.  If the request cannot be satisfied, return zero.
 * @param pages The number of pages to be allocated.
 * @return The start of the first page if successful, zero onfailure.
 */
@Inline protected Address allocPages(int pages){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(metaDataPagesPerRegion == 0 || pages <= PAGES_IN_CHUNK - metaDataPagesPerRegion);
  lock();
  boolean newChunk=false;
  int pageOffset=freeList.alloc(pages);
  if (pageOffset == GenericFreeList.FAILURE && !contiguous)   pageOffset=allocateContiguousChunks(pages);
  if (pageOffset == -1) {
    unlock();
    return Address.zero();
  }
 else {
    pagesCurrentlyOnFreeList-=pages;
    if (pageOffset > highWaterMark) {
      if ((pageOffset ^ highWaterMark) > EmbeddedMetaData.PAGES_IN_REGION) {
        int regions=1 + ((pageOffset - highWaterMark) >> EmbeddedMetaData.LOG_PAGES_IN_REGION);
        int metapages=regions * metaDataPagesPerRegion;
        reserved+=metapages;
        committed+=metapages;
        newChunk=true;
      }
      highWaterMark=pageOffset;
    }
    Address rtn=start.plus(Conversions.pagesToBytes(pageOffset));
    Extent bytes=Conversions.pagesToBytes(pages);
    commitPages(pages,pages);
    space.growSpace(rtn,bytes,newChunk);
    unlock();
    Mmapper.ensureMapped(rtn,pages);
    VM.memory.zero(rtn,bytes);
    return rtn;
  }
}

Fixed version (ground truth):
/** 
 * Allocate <code>pages</code> pages from this resource.<p> If the request can be satisfied, then ensure the pages are mmpapped and zeroed before returning the address of the start of the region.  If the request cannot be satisfied, return zero.
 * @param pages The number of pages to be allocated.
 * @return The start of the first page if successful, zero onfailure.
 */
@Inline protected Address allocPages(int pages){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(metaDataPagesPerRegion == 0 || pages <= PAGES_IN_CHUNK - metaDataPagesPerRegion);
  lock();
  boolean newChunk=false;
  int pageOffset=freeList.alloc(pages);
  if (pageOffset == GenericFreeList.FAILURE && !contiguous) {
    pageOffset=allocateContiguousChunks(pages);
    newChunk=true;
  }
  if (pageOffset == -1) {
    unlock();
    return Address.zero();
  }
 else {
    pagesCurrentlyOnFreeList-=pages;
    if (pageOffset > highWaterMark) {
      if ((pageOffset ^ highWaterMark) > EmbeddedMetaData.PAGES_IN_REGION) {
        int regions=1 + ((pageOffset - highWaterMark) >> EmbeddedMetaData.LOG_PAGES_IN_REGION);
        int metapages=regions * metaDataPagesPerRegion;
        reserved+=metapages;
        committed+=metapages;
        newChunk=true;
      }
      highWaterMark=pageOffset;
    }
    Address rtn=start.plus(Conversions.pagesToBytes(pageOffset));
    Extent bytes=Conversions.pagesToBytes(pages);
    commitPages(pages,pages);
    space.growSpace(rtn,bytes,newChunk);
    unlock();
    Mmapper.ensureMapped(rtn,pages);
    VM.memory.zero(rtn,bytes);
    return rtn;
  }
}
Program: 149844
Project: 149844
Buggy source:
private static DefUseEffect instanceOf(Instruction s){
  Operand ref=InstanceOf.getRef(s);
  if (ref.isNullConstant()) {
    Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
    return DefUseEffect.MOVE_FOLDED;
  }
 else   if (ref.isConstant() || (ref.isRegister() && ref.asRegister().isExtant() && ref.asRegister().isPreciseType())) {
    s.operator=INSTANCEOF_NOTNULL;
    return instanceOfNotNull(s);
  }
 else {
    VM_TypeReference lhsType=InstanceOf.getType(s).getTypeRef();
    VM_TypeReference rhsType=ref.getType();
    byte ans=ClassLoaderProxy.includesType(lhsType,rhsType);
    if (ans == Constants.NO) {
      VM_Type rType=rhsType.peekType();
      if (rType != null && rType.isClassType() && rType.asClass().isFinal()) {
        Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
        return DefUseEffect.MOVE_FOLDED;
      }
 else {
        return DefUseEffect.UNCHANGED;
      }
    }
 else {
      return DefUseEffect.UNCHANGED;
    }
  }
}

Fixed version (ground truth):
private static DefUseEffect instanceOf(Instruction s){
  Operand ref=InstanceOf.getRef(s);
  if (ref.isNullConstant()) {
    Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
    return DefUseEffect.MOVE_FOLDED;
  }
 else   if (ref.isConstant()) {
    s.operator=INSTANCEOF_NOTNULL;
    return instanceOfNotNull(s);
  }
 else {
    VM_TypeReference lhsType=InstanceOf.getType(s).getTypeRef();
    VM_TypeReference rhsType=ref.getType();
    byte ans=ClassLoaderProxy.includesType(lhsType,rhsType);
    if (ans == Constants.NO) {
      VM_Type rType=rhsType.peekType();
      if (rType != null && rType.isClassType() && rType.asClass().isFinal()) {
        Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
        return DefUseEffect.MOVE_FOLDED;
      }
 else {
        return DefUseEffect.UNCHANGED;
      }
    }
 else {
      return DefUseEffect.UNCHANGED;
    }
  }
}
Program: 149845
Project: 149845
Buggy source:
public Instruction generateAnewarray(VM_TypeReference arrayTypeRef,VM_TypeReference elementTypeRef){
  if (arrayTypeRef == null) {
    if (VM.VerifyAssertions)     VM._assert(elementTypeRef != null);
    arrayTypeRef=elementTypeRef.getArrayTypeForElementType();
  }
  if (elementTypeRef == null) {
    elementTypeRef=arrayTypeRef.getArrayElementType();
  }
  RegisterOperand t=gc.temps.makeTemp(arrayTypeRef);
  t.setPreciseType();
  t.setExtant();
  markGuardlessNonNull(t);
  VM_Type arrayType=arrayTypeRef.peekType();
  Operator op;
  TypeOperand arrayOp;
  if ((arrayType != null) && (arrayType.isInitialized() || arrayType.isInBootImage())) {
    op=NEWARRAY;
    arrayOp=makeTypeOperand(arrayType);
  }
 else {
    VM_Type elementType=elementTypeRef.peekType();
    if ((elementType != null) && (elementType.isInitialized() || elementType.isInBootImage())) {
      arrayType=arrayTypeRef.resolve();
      arrayType.resolve();
      arrayType.instantiate();
      op=NEWARRAY;
      arrayOp=makeTypeOperand(arrayType);
    }
 else {
      op=NEWARRAY_UNRESOLVED;
      arrayOp=makeTypeOperand(arrayTypeRef);
    }
  }
  Instruction s=NewArray.create(op,t,arrayOp,popInt());
  push(t.copyD2U());
  rectifyStateWithErrorHandler();
  rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangNegativeArraySizeException);
  return s;
}

Fixed version (ground truth):
public Instruction generateAnewarray(VM_TypeReference arrayTypeRef,VM_TypeReference elementTypeRef){
  if (arrayTypeRef == null) {
    if (VM.VerifyAssertions)     VM._assert(elementTypeRef != null);
    arrayTypeRef=elementTypeRef.getArrayTypeForElementType();
  }
  if (elementTypeRef == null) {
    elementTypeRef=arrayTypeRef.getArrayElementType();
  }
  RegisterOperand t=gc.temps.makeTemp(arrayTypeRef);
  t.setPreciseType();
  markGuardlessNonNull(t);
  VM_Type arrayType=arrayTypeRef.peekType();
  Operator op;
  TypeOperand arrayOp;
  if ((arrayType != null) && (arrayType.isInitialized() || arrayType.isInBootImage())) {
    op=NEWARRAY;
    arrayOp=makeTypeOperand(arrayType);
    t.setExtant();
  }
 else {
    VM_Type elementType=elementTypeRef.peekType();
    if ((elementType != null) && (elementType.isInitialized() || elementType.isInBootImage())) {
      arrayType=arrayTypeRef.resolve();
      arrayType.resolve();
      arrayType.instantiate();
      op=NEWARRAY;
      arrayOp=makeTypeOperand(arrayType);
      t.setExtant();
    }
 else {
      op=NEWARRAY_UNRESOLVED;
      arrayOp=makeTypeOperand(arrayTypeRef);
    }
  }
  Instruction s=NewArray.create(op,t,arrayOp,popInt());
  push(t.copyD2U());
  rectifyStateWithErrorHandler();
  rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangNegativeArraySizeException);
  return s;
}
Program: 149847
Project: 149847
Buggy source:
/** 
 * Clear this register from holding a known to exist object 
 */
public void clearExtant(){
  flags&=~EXTANT;
}

Fixed version (ground truth):
/** 
 * Clear this register from holding an extant value 
 */
public void clearExtant(){
  flags&=~EXTANT;
}
Program: 149848
Project: 149848
Buggy source:
/** 
 * Is this register known to contain an object? 
 */
public boolean isExtant(){
  return (flags & EXTANT) != 0;
}

Fixed version (ground truth):
/** 
 * Is this register known to contain either NULL or an object whose class was fully loaded before the current method was called? This fact is used to determine whether we can optimize away inline guards based on pre-existence based inlining.
 */
public boolean isExtant(){
  return (flags & EXTANT) != 0;
}
Program: 149849
Project: 149849
Buggy source:
/** 
 * Set this register as holding a known to exist object 
 */
public void setExtant(){
  flags|=EXTANT;
}

Fixed version (ground truth):
/** 
 * Set this register as holding an extant object (or NULL) (ie, an object whose class was fully loaded before the current method was called). This fact is used to determine whether we can optimize away inline guards based on pre-existence based inlining.
 */
public void setExtant(){
  flags|=EXTANT;
}
Program: 149850
Project: 149850
Buggy source:
private void checkReadAccess(Object obj) throws IllegalAccessException, IllegalArgumentException, ExceptionInInitializerError {
  VM_Class declaringClass=field.getDeclaringClass();
  if (!field.isStatic()) {
    if (obj == null) {
      throw new NullPointerException();
    }
    VM_Type objType=VM_ObjectModel.getObjectType(obj);
    if (objType != declaringClass && !VM_Runtime.isAssignableWith(declaringClass,objType)) {
      throw new IllegalArgumentException();
    }
  }
  if (!field.isPublic() && !f.isAccessible()) {
    VM_Class accessingClass=VM_Class.getClassFromStackFrame(2);
    JikesRVMSupport.checkAccess(field,accessingClass);
  }
  if (field.isStatic() && !declaringClass.isInitialized()) {
    try {
      VM_Runtime.initializeClassForDynamicLink(declaringClass);
    }
 catch (    Throwable e) {
      ExceptionInInitializerError ex=new ExceptionInInitializerError();
      ex.initCause(e);
      throw ex;
    }
  }
}

Fixed version (ground truth):
private void checkReadAccess(Object obj) throws IllegalAccessException, IllegalArgumentException, ExceptionInInitializerError {
  VM_Class declaringClass=field.getDeclaringClass();
  if (!field.isStatic()) {
    if (obj == null) {
      throw new NullPointerException();
    }
    VM_Type objType=VM_ObjectModel.getObjectType(obj);
    if (objType != declaringClass && !VM_Runtime.isAssignableWith(declaringClass,objType)) {
      throw new IllegalArgumentException();
    }
  }
  if (!field.isPublic() && !f.isAccessible()) {
    VM_Class accessingClass=VM_Class.getClassFromStackFrame(3);
    JikesRVMSupport.checkAccess(field,accessingClass);
  }
  if (field.isStatic() && !declaringClass.isInitialized()) {
    try {
      VM_Runtime.initializeClassForDynamicLink(declaringClass);
    }
 catch (    Throwable e) {
      ExceptionInInitializerError ex=new ExceptionInInitializerError();
      ex.initCause(e);
      throw ex;
    }
  }
}
Program: 149851
Project: 149851
Buggy source:
private void checkWriteAccess(Object obj) throws IllegalAccessException, IllegalArgumentException, ExceptionInInitializerError {
  VM_Class declaringClass=field.getDeclaringClass();
  if (!field.isStatic()) {
    if (obj == null) {
      throw new NullPointerException();
    }
    VM_Type objType=VM_ObjectModel.getObjectType(obj);
    if (objType != declaringClass && !VM_Runtime.isAssignableWith(declaringClass,objType)) {
      throw new IllegalArgumentException();
    }
  }
  if (!field.isPublic() && !f.isAccessible()) {
    VM_Class accessingClass=VM_Class.getClassFromStackFrame(2);
    JikesRVMSupport.checkAccess(field,accessingClass);
  }
  if (field.isFinal())   throw new IllegalAccessException();
  if (field.isStatic() && !declaringClass.isInitialized()) {
    try {
      VM_Runtime.initializeClassForDynamicLink(declaringClass);
    }
 catch (    Throwable e) {
      ExceptionInInitializerError ex=new ExceptionInInitializerError();
      ex.initCause(e);
      throw ex;
    }
  }
}

Fixed version (ground truth):
private void checkWriteAccess(Object obj) throws IllegalAccessException, IllegalArgumentException, ExceptionInInitializerError {
  VM_Class declaringClass=field.getDeclaringClass();
  if (!field.isStatic()) {
    if (obj == null) {
      throw new NullPointerException();
    }
    VM_Type objType=VM_ObjectModel.getObjectType(obj);
    if (objType != declaringClass && !VM_Runtime.isAssignableWith(declaringClass,objType)) {
      throw new IllegalArgumentException();
    }
  }
  if (!field.isPublic() && !f.isAccessible()) {
    VM_Class accessingClass=VM_Class.getClassFromStackFrame(3);
    JikesRVMSupport.checkAccess(field,accessingClass);
  }
  if (field.isFinal())   throw new IllegalAccessException();
  if (field.isStatic() && !declaringClass.isInitialized()) {
    try {
      VM_Runtime.initializeClassForDynamicLink(declaringClass);
    }
 catch (    Throwable e) {
      ExceptionInInitializerError ex=new ExceptionInInitializerError();
      ex.initCause(e);
      throw ex;
    }
  }
}
Program: 149853
Project: 149853
Buggy source:
private static DefUseEffect instanceOf(Instruction s){
  Operand ref=InstanceOf.getRef(s);
  if (ref.isNullConstant()) {
    Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
    return DefUseEffect.MOVE_FOLDED;
  }
 else   if (ref.isConstant()) {
    s.operator=INSTANCEOF_NOTNULL;
    return instanceOfNotNull(s);
  }
 else {
    VM_TypeReference lhsType=InstanceOf.getType(s).getTypeRef();
    VM_TypeReference rhsType=ref.getType();
    byte ans=ClassLoaderProxy.includesType(lhsType,rhsType);
    if (ans == Constants.NO) {
      VM_Type rType=rhsType.peekType();
      if (rType != null && rType.isClassType() && rType.asClass().isFinal()) {
        Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
        return DefUseEffect.MOVE_FOLDED;
      }
 else {
        return DefUseEffect.UNCHANGED;
      }
    }
 else {
      return DefUseEffect.UNCHANGED;
    }
  }
}

Fixed version (ground truth):
private static DefUseEffect instanceOf(Instruction s){
  Operand ref=InstanceOf.getRef(s);
  if (ref.isNullConstant()) {
    Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
    return DefUseEffect.MOVE_FOLDED;
  }
 else   if (ref.isConstant() || (ref.isRegister() && ref.asRegister().isExtant())) {
    s.operator=INSTANCEOF_NOTNULL;
    return instanceOfNotNull(s);
  }
 else {
    VM_TypeReference lhsType=InstanceOf.getType(s).getTypeRef();
    VM_TypeReference rhsType=ref.getType();
    byte ans=ClassLoaderProxy.includesType(lhsType,rhsType);
    if (ans == Constants.NO) {
      VM_Type rType=rhsType.peekType();
      if (rType != null && rType.isClassType() && rType.asClass().isFinal()) {
        Move.mutate(s,INT_MOVE,InstanceOf.getClearResult(s),IC(0));
        return DefUseEffect.MOVE_FOLDED;
      }
 else {
        return DefUseEffect.UNCHANGED;
      }
    }
 else {
      return DefUseEffect.UNCHANGED;
    }
  }
}
Program: 149855
Project: 149855
Buggy source:
Object construct(Object[] args) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  if (!constructor.isPublic() && !cons.isAccessible()) {
    VM_Class accessingClass=VM_Class.getClassFromStackFrame(1);
    JikesRVMSupport.checkAccess(constructor,accessingClass);
  }
  VM_TypeReference[] parameterTypes=constructor.getParameterTypes();
  if (args == null) {
    if (parameterTypes.length != 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 else {
    if (args.length != parameterTypes.length) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    for (int i=0; i < parameterTypes.length; i++) {
      args[i]=JikesRVMSupport.makeArgumentCompatible(parameterTypes[i].resolve(),args[i]);
    }
  }
  VM_Class cls=constructor.getDeclaringClass();
  if (cls.isAbstract()) {
    throw new InstantiationException("String_Node_Str");
  }
  if (!cls.isInitialized()) {
    try {
      VM_Runtime.initializeClassForDynamicLink(cls);
    }
 catch (    Throwable e) {
      ExceptionInInitializerError ex=new ExceptionInInitializerError();
      ex.initCause(e);
      throw ex;
    }
  }
  Object obj=VM_Runtime.resolvedNewScalar(cls);
  try {
    VM_Reflection.invoke(constructor,obj,args);
  }
 catch (  Throwable e) {
    throw new InvocationTargetException(e);
  }
  return obj;
}

Fixed version (ground truth):
Object construct(Object[] args) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  if (!constructor.isPublic() && !cons.isAccessible()) {
    VM_Class accessingClass=VM_Class.getClassFromStackFrame(2);
    JikesRVMSupport.checkAccess(constructor,accessingClass);
  }
  VM_TypeReference[] parameterTypes=constructor.getParameterTypes();
  if (args == null) {
    if (parameterTypes.length != 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 else {
    if (args.length != parameterTypes.length) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    for (int i=0; i < parameterTypes.length; i++) {
      args[i]=JikesRVMSupport.makeArgumentCompatible(parameterTypes[i].resolve(),args[i]);
    }
  }
  VM_Class cls=constructor.getDeclaringClass();
  if (cls.isAbstract()) {
    throw new InstantiationException("String_Node_Str");
  }
  if (!cls.isInitialized()) {
    try {
      VM_Runtime.initializeClassForDynamicLink(cls);
    }
 catch (    Throwable e) {
      ExceptionInInitializerError ex=new ExceptionInInitializerError();
      ex.initCause(e);
      throw ex;
    }
  }
  Object obj=VM_Runtime.resolvedNewScalar(cls);
  try {
    VM_Reflection.invoke(constructor,obj,args);
  }
 catch (  Throwable e) {
    throw new InvocationTargetException(e);
  }
  return obj;
}