Program: 149846
Project: 149846
Buggy source:
/** 
 * Generate instructions for a basic block. May discover other basic blocks that need to be generated along the way.
 * @param fromIndex bytecode index to start from
 */
private void generateFrom(int fromIndex){
  if (DBG_BB || DBG_SELECTED) {
    db("String_Node_Str" + currentBBLE + "String_Node_Str"+ runoff);
  }
  currentBBLE.setGenerated();
  endOfBasicBlock=fallThrough=false;
  lastInstr=null;
  bcodes.reset(fromIndex);
  while (true) {
    currentBBLE.high=instrIndex=bcodes.index();
    int code=bcodes.nextInstruction();
    if (DBG_BCPARSE) {
      db("String_Node_Str" + instrIndex + "String_Node_Str"+ code+ "String_Node_Str"+ Integer.toHexString(code)+ "String_Node_Str"+ ((code < JBC_name.length) ? JBC_name[code] : "String_Node_Str"));
    }
    Instruction s=null;
    lastOsrBarrier=null;
switch (code) {
case JBC_nop:
      break;
case JBC_aconst_null:
    push(new NullConstantOperand());
  break;
case JBC_iconst_m1:
case JBC_iconst_0:
case JBC_iconst_1:
case JBC_iconst_2:
case JBC_iconst_3:
case JBC_iconst_4:
case JBC_iconst_5:
push(new IntConstantOperand(code - JBC_iconst_0));
break;
case JBC_lconst_0:
case JBC_lconst_1:
pushDual(new LongConstantOperand(code - JBC_lconst_0));
break;
case JBC_fconst_0:
push(new FloatConstantOperand(0.f));
break;
case JBC_fconst_1:
push(new FloatConstantOperand(1.f));
break;
case JBC_fconst_2:
push(new FloatConstantOperand(2.f));
break;
case JBC_dconst_0:
pushDual(new DoubleConstantOperand(0.));
break;
case JBC_dconst_1:
pushDual(new DoubleConstantOperand(1.));
break;
case JBC_bipush:
push(new IntConstantOperand(bcodes.getByteValue()));
break;
case JBC_sipush:
push(new IntConstantOperand(bcodes.getShortValue()));
break;
case JBC_ldc:
push(getConstantOperand(bcodes.getConstantIndex()));
break;
case JBC_ldc_w:
push(getConstantOperand(bcodes.getWideConstantIndex()));
break;
case JBC_ldc2_w:
pushDual(getConstantOperand(bcodes.getWideConstantIndex()));
break;
case JBC_iload:
s=do_iload(bcodes.getLocalNumber());
break;
case JBC_lload:
s=do_lload(bcodes.getLocalNumber());
break;
case JBC_fload:
s=do_fload(bcodes.getLocalNumber());
break;
case JBC_dload:
s=do_dload(bcodes.getLocalNumber());
break;
case JBC_aload:
s=do_aload(bcodes.getLocalNumber());
break;
case JBC_iload_0:
case JBC_iload_1:
case JBC_iload_2:
case JBC_iload_3:
s=do_iload(code - JBC_iload_0);
break;
case JBC_lload_0:
case JBC_lload_1:
case JBC_lload_2:
case JBC_lload_3:
s=do_lload(code - JBC_lload_0);
break;
case JBC_fload_0:
case JBC_fload_1:
case JBC_fload_2:
case JBC_fload_3:
s=do_fload(code - JBC_fload_0);
break;
case JBC_dload_0:
case JBC_dload_1:
case JBC_dload_2:
case JBC_dload_3:
s=do_dload(code - JBC_dload_0);
break;
case JBC_aload_0:
case JBC_aload_1:
case JBC_aload_2:
case JBC_aload_3:
s=do_aload(code - JBC_aload_0);
break;
case JBC_iaload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.IntArray);
}
s=_aloadHelper(INT_ALOAD,ref,index,VM_TypeReference.Int);
}
break;
case JBC_laload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.LongArray);
}
s=_aloadHelper(LONG_ALOAD,ref,index,VM_TypeReference.Long);
}
break;
case JBC_faload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.FloatArray);
}
s=_aloadHelper(FLOAT_ALOAD,ref,index,VM_TypeReference.Float);
}
break;
case JBC_daload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.DoubleArray);
}
s=_aloadHelper(DOUBLE_ALOAD,ref,index,VM_TypeReference.Double);
}
break;
case JBC_aaload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getRefTypeOf(ref).getArrayElementType();
if (VM.VerifyAssertions) VM._assert(type.isReferenceType());
s=_aloadHelper(REF_ALOAD,ref,index,type);
}
break;
case JBC_baload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getArrayTypeOf(ref);
if (VM.VerifyAssertions) {
VM._assert(type == VM_TypeReference.ByteArray || type == VM_TypeReference.BooleanArray);
}
if (type == VM_TypeReference.ByteArray) {
s=_aloadHelper(BYTE_ALOAD,ref,index,VM_TypeReference.Byte);
}
 else {
s=_aloadHelper(UBYTE_ALOAD,ref,index,VM_TypeReference.Boolean);
}
}
break;
case JBC_caload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.CharArray);
}
s=_aloadHelper(USHORT_ALOAD,ref,index,VM_TypeReference.Char);
}
break;
case JBC_saload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.ShortArray);
}
s=_aloadHelper(SHORT_ALOAD,ref,index,VM_TypeReference.Short);
}
break;
case JBC_istore:
s=do_store(bcodes.getLocalNumber(),popInt());
break;
case JBC_lstore:
s=do_store(bcodes.getLocalNumber(),popLong());
break;
case JBC_fstore:
s=do_store(bcodes.getLocalNumber(),popFloat());
break;
case JBC_dstore:
s=do_store(bcodes.getLocalNumber(),popDouble());
break;
case JBC_astore:
s=do_astore(bcodes.getLocalNumber());
break;
case JBC_istore_0:
case JBC_istore_1:
case JBC_istore_2:
case JBC_istore_3:
s=do_store(code - JBC_istore_0,popInt());
break;
case JBC_lstore_0:
case JBC_lstore_1:
case JBC_lstore_2:
case JBC_lstore_3:
s=do_store(code - JBC_lstore_0,popLong());
break;
case JBC_fstore_0:
case JBC_fstore_1:
case JBC_fstore_2:
case JBC_fstore_3:
s=do_store(code - JBC_fstore_0,popFloat());
break;
case JBC_dstore_0:
case JBC_dstore_1:
case JBC_dstore_2:
case JBC_dstore_3:
s=do_store(code - JBC_dstore_0,popDouble());
break;
case JBC_astore_0:
case JBC_astore_1:
case JBC_astore_2:
case JBC_astore_3:
s=do_astore(code - JBC_astore_0);
break;
case JBC_iastore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.IntArray);
}
s=AStore.create(INT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Int),getCurrentGuard());
}
break;
case JBC_lastore:
{
Operand val=popLong();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.LongArray);
}
s=AStore.create(LONG_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Long),getCurrentGuard());
}
break;
case JBC_fastore:
{
Operand val=popFloat();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.FloatArray);
}
s=AStore.create(FLOAT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Float),getCurrentGuard());
}
break;
case JBC_dastore:
{
Operand val=popDouble();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.DoubleArray);
}
s=AStore.create(DOUBLE_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Double),getCurrentGuard());
}
break;
case JBC_aastore:
{
Operand val=pop();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getRefTypeOf(ref).getArrayElementType();
if (VM.VerifyAssertions) VM._assert(type.isReferenceType());
if (do_CheckStore(ref,val,type)) {
break;
}
s=AStore.create(REF_ASTORE,val,ref,index,new LocationOperand(type),getCurrentGuard());
}
break;
case JBC_bastore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getArrayTypeOf(ref);
if (VM.VerifyAssertions) {
VM._assert(type == VM_TypeReference.ByteArray || type == VM_TypeReference.BooleanArray);
}
if (type == VM_TypeReference.ByteArray) {
type=VM_TypeReference.Byte;
}
 else {
type=VM_TypeReference.Boolean;
}
s=AStore.create(BYTE_ASTORE,val,ref,index,new LocationOperand(type),getCurrentGuard());
}
break;
case JBC_castore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.CharArray);
}
s=AStore.create(SHORT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Char),getCurrentGuard());
}
break;
case JBC_sastore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.ShortArray);
}
s=AStore.create(SHORT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Short),getCurrentGuard());
}
break;
case JBC_pop:
stack.pop();
break;
case JBC_pop2:
stack.pop2();
break;
case JBC_dup:
{
Operand op1=stack.pop();
stack.push(op1);
s=pushCopy(op1);
}
break;
case JBC_dup_x1:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
stack.push(op1);
stack.push(op2);
s=pushCopy(op1);
}
break;
case JBC_dup_x2:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
Operand op3=stack.pop();
stack.push(op1);
stack.push(op3);
stack.push(op2);
s=pushCopy(op1);
}
break;
case JBC_dup2:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
stack.push(op2);
stack.push(op1);
s=pushCopy(op2);
if (s != null) {
appendInstruction(s);
s=null;
}
s=pushCopy(op1);
}
break;
case JBC_dup2_x1:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
Operand op3=stack.pop();
stack.push(op2);
stack.push(op1);
stack.push(op3);
s=pushCopy(op2);
if (s != null) {
appendInstruction(s);
s=null;
}
s=pushCopy(op1);
}
break;
case JBC_dup2_x2:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
Operand op3=stack.pop();
Operand op4=stack.pop();
stack.push(op2);
stack.push(op1);
stack.push(op4);
stack.push(op3);
s=pushCopy(op2);
if (s != null) {
appendInstruction(s);
s=null;
}
s=pushCopy(op1);
}
break;
case JBC_swap:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
stack.push(op1);
stack.push(op2);
}
break;
case JBC_iadd:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_ADD,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_ladd:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_ADD,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_fadd:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_ADD,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_dadd:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_ADD,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_isub:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_SUB,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lsub:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_SUB,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_fsub:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_SUB,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_dsub:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_SUB,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_imul:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_MUL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lmul:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_MUL,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_fmul:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_MUL,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_dmul:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_MUL,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_idiv:
{
clearCurrentGuard();
Operand op2=popInt();
Operand op1=popInt();
if (do_IntZeroCheck(op2)) {
break;
}
s=_guardedBinaryHelper(INT_DIV,op1,op2,getCurrentGuard(),VM_TypeReference.Int);
}
break;
case JBC_ldiv:
{
clearCurrentGuard();
Operand op2=popLong();
Operand op1=popLong();
if (do_LongZeroCheck(op2)) {
break;
}
s=_guardedBinaryDualHelper(LONG_DIV,op1,op2,getCurrentGuard(),VM_TypeReference.Long);
}
break;
case JBC_fdiv:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_DIV,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_ddiv:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_DIV,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_irem:
{
clearCurrentGuard();
Operand op2=popInt();
Operand op1=popInt();
if (do_IntZeroCheck(op2)) {
break;
}
s=_guardedBinaryHelper(INT_REM,op1,op2,getCurrentGuard(),VM_TypeReference.Int);
}
break;
case JBC_lrem:
{
clearCurrentGuard();
Operand op2=popLong();
Operand op1=popLong();
if (do_LongZeroCheck(op2)) {
break;
}
s=_guardedBinaryDualHelper(LONG_REM,op1,op2,getCurrentGuard(),VM_TypeReference.Long);
}
break;
case JBC_frem:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_REM,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_drem:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_REM,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_ineg:
s=_unaryHelper(INT_NEG,popInt(),VM_TypeReference.Int);
break;
case JBC_lneg:
s=_unaryDualHelper(LONG_NEG,popLong(),VM_TypeReference.Long);
break;
case JBC_fneg:
s=_unaryHelper(FLOAT_NEG,popFloat(),VM_TypeReference.Float);
break;
case JBC_dneg:
s=_unaryDualHelper(DOUBLE_NEG,popDouble(),VM_TypeReference.Double);
break;
case JBC_ishl:
{
Operand op2=popShiftInt(false);
Operand op1=popInt();
s=_binaryHelper(INT_SHL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lshl:
{
Operand op2=popShiftInt(true);
Operand op1=popLong();
s=_binaryDualHelper(LONG_SHL,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_ishr:
{
Operand op2=popShiftInt(false);
Operand op1=popInt();
s=_binaryHelper(INT_SHR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lshr:
{
Operand op2=popShiftInt(true);
Operand op1=popLong();
s=_binaryDualHelper(LONG_SHR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_iushr:
{
Operand op2=popShiftInt(false);
Operand op1=popInt();
s=_binaryHelper(INT_USHR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lushr:
{
Operand op2=popShiftInt(true);
Operand op1=popLong();
s=_binaryDualHelper(LONG_USHR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_iand:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_AND,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_land:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_AND,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_ior:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_OR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lor:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_OR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_ixor:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_XOR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lxor:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_XOR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_iinc:
{
int index=bcodes.getLocalNumber();
s=do_iinc(index,bcodes.getIncrement());
}
break;
case JBC_i2l:
s=_unaryDualHelper(INT_2LONG,popInt(),VM_TypeReference.Long);
break;
case JBC_i2f:
s=_unaryHelper(INT_2FLOAT,popInt(),VM_TypeReference.Float);
break;
case JBC_i2d:
s=_unaryDualHelper(INT_2DOUBLE,popInt(),VM_TypeReference.Double);
break;
case JBC_l2i:
s=_unaryHelper(LONG_2INT,popLong(),VM_TypeReference.Int);
break;
case JBC_l2f:
s=_unaryHelper(LONG_2FLOAT,popLong(),VM_TypeReference.Float);
break;
case JBC_l2d:
s=_unaryDualHelper(LONG_2DOUBLE,popLong(),VM_TypeReference.Double);
break;
case JBC_f2i:
s=_unaryHelper(FLOAT_2INT,popFloat(),VM_TypeReference.Int);
break;
case JBC_f2l:
s=_unaryDualHelper(FLOAT_2LONG,popFloat(),VM_TypeReference.Long);
break;
case JBC_f2d:
s=_unaryDualHelper(FLOAT_2DOUBLE,popFloat(),VM_TypeReference.Double);
break;
case JBC_d2i:
s=_unaryHelper(DOUBLE_2INT,popDouble(),VM_TypeReference.Int);
break;
case JBC_d2l:
s=_unaryDualHelper(DOUBLE_2LONG,popDouble(),VM_TypeReference.Long);
break;
case JBC_d2f:
s=_unaryHelper(DOUBLE_2FLOAT,popDouble(),VM_TypeReference.Float);
break;
case JBC_int2byte:
s=_unaryHelper(INT_2BYTE,popInt(),VM_TypeReference.Byte);
break;
case JBC_int2char:
s=_unaryHelper(INT_2USHORT,popInt(),VM_TypeReference.Char);
break;
case JBC_int2short:
s=_unaryHelper(INT_2SHORT,popInt(),VM_TypeReference.Short);
break;
case JBC_lcmp:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryHelper(LONG_CMP,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_fcmpl:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_CMPL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_fcmpg:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_CMPG,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_dcmpl:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryHelper(DOUBLE_CMPL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_dcmpg:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryHelper(DOUBLE_CMPG,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_ifeq:
s=_intIfHelper(ConditionOperand.EQUAL());
break;
case JBC_ifne:
s=_intIfHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_iflt:
s=_intIfHelper(ConditionOperand.LESS());
break;
case JBC_ifge:
s=_intIfHelper(ConditionOperand.GREATER_EQUAL());
break;
case JBC_ifgt:
s=_intIfHelper(ConditionOperand.GREATER());
break;
case JBC_ifle:
s=_intIfHelper(ConditionOperand.LESS_EQUAL());
break;
case JBC_if_icmpeq:
s=_intIfCmpHelper(ConditionOperand.EQUAL());
break;
case JBC_if_icmpne:
s=_intIfCmpHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_if_icmplt:
s=_intIfCmpHelper(ConditionOperand.LESS());
break;
case JBC_if_icmpge:
s=_intIfCmpHelper(ConditionOperand.GREATER_EQUAL());
break;
case JBC_if_icmpgt:
s=_intIfCmpHelper(ConditionOperand.GREATER());
break;
case JBC_if_icmple:
s=_intIfCmpHelper(ConditionOperand.LESS_EQUAL());
break;
case JBC_if_acmpeq:
s=_refIfCmpHelper(ConditionOperand.EQUAL());
break;
case JBC_if_acmpne:
s=_refIfCmpHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_goto:
{
int offset=bcodes.getBranchOffset();
if (offset != 3) {
s=_gotoHelper(offset);
}
}
break;
case JBC_jsr:
s=_jsrHelper(bcodes.getBranchOffset());
break;
case JBC_ret:
s=_retHelper(bcodes.getLocalNumber());
break;
case JBC_tableswitch:
{
bcodes.alignSwitch();
Operand op0=popInt();
int defaultoff=bcodes.getDefaultSwitchOffset();
int low=bcodes.getLowSwitchValue();
int high=bcodes.getHighSwitchValue();
int number=high - low + 1;
if (CF_TABLESWITCH && op0 instanceof IntConstantOperand) {
int v1=((IntConstantOperand)op0).value;
int match=bcodes.computeTableSwitchOffset(v1,low,high);
int offset=match == 0 ? defaultoff : match;
bcodes.skipTableSwitchOffsets(number);
if (DBG_CF) {
db("String_Node_Str" + v1 + "String_Node_Str");
}
s=_gotoHelper(offset);
break;
}
s=TableSwitch.create(TABLESWITCH,op0,null,null,new IntConstantOperand(low),new IntConstantOperand(high),generateTarget(defaultoff),null,number * 2);
for (int i=0; i < number; ++i) {
TableSwitch.setTarget(s,i,generateTarget(bcodes.getTableSwitchOffset(i)));
}
bcodes.skipTableSwitchOffsets(number);
VM_SwitchBranchProfile sp=gc.getSwitchProfile(instrIndex - bciAdjustment);
if (sp == null) {
float approxProb=1.0f / (number + 1);
TableSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(approxProb));
for (int i=0; i < number; ++i) {
TableSwitch.setBranchProfile(s,i,new BranchProfileOperand(approxProb));
}
}
 else {
TableSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(sp.getDefaultProbability()));
for (int i=0; i < number; ++i) {
TableSwitch.setBranchProfile(s,i,new BranchProfileOperand(sp.getCaseProbability(i)));
}
}
}
break;
case JBC_lookupswitch:
{
bcodes.alignSwitch();
Operand op0=popInt();
int defaultoff=bcodes.getDefaultSwitchOffset();
int numpairs=bcodes.getSwitchLength();
if (numpairs == 0) {
s=_gotoHelper(defaultoff);
break;
}
if (CF_LOOKUPSWITCH && op0 instanceof IntConstantOperand) {
int v1=((IntConstantOperand)op0).value;
int match=bcodes.computeLookupSwitchOffset(v1,numpairs);
int offset=match == 0 ? defaultoff : match;
bcodes.skipLookupSwitchPairs(numpairs);
if (DBG_CF) {
db("String_Node_Str" + v1 + "String_Node_Str");
}
s=_gotoHelper(offset);
break;
}
s=LookupSwitch.create(LOOKUPSWITCH,op0,null,null,generateTarget(defaultoff),null,numpairs * 3);
for (int i=0; i < numpairs; ++i) {
LookupSwitch.setMatch(s,i,new IntConstantOperand(bcodes.getLookupSwitchValue(i)));
LookupSwitch.setTarget(s,i,generateTarget(bcodes.getLookupSwitchOffset(i)));
}
bcodes.skipLookupSwitchPairs(numpairs);
VM_SwitchBranchProfile sp=gc.getSwitchProfile(instrIndex - bciAdjustment);
if (sp == null) {
float approxProb=1.0f / (float)(numpairs + 1);
LookupSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(approxProb));
for (int i=0; i < numpairs; ++i) {
LookupSwitch.setBranchProfile(s,i,new BranchProfileOperand(approxProb));
}
}
 else {
LookupSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(sp.getDefaultProbability()));
for (int i=0; i < numpairs; ++i) {
LookupSwitch.setBranchProfile(s,i,new BranchProfileOperand(sp.getCaseProbability(i)));
}
}
}
break;
case JBC_ireturn:
_returnHelper(INT_MOVE,popInt());
break;
case JBC_lreturn:
_returnHelper(LONG_MOVE,popLong());
break;
case JBC_freturn:
_returnHelper(FLOAT_MOVE,popFloat());
break;
case JBC_dreturn:
_returnHelper(DOUBLE_MOVE,popDouble());
break;
case JBC_areturn:
{
Operand op0=popRef();
if (VM.VerifyAssertions && !op0.isDefinitelyNull()) {
VM_TypeReference retType=op0.getType();
assertIsAssignable(gc.method.getReturnType(),retType);
}
_returnHelper(REF_MOVE,op0);
}
break;
case JBC_return:
_returnHelper(null,null);
break;
case JBC_getstatic:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeStaticFieldRef(ref);
Operand offsetOp;
VM_TypeReference fieldType=ref.getFieldContentsType();
RegisterOperand t=gc.temps.makeTemp(fieldType);
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
VM_Field field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
VM_Type ft=fieldType.peekType();
if (ft != null && ft.isClassType()) {
VM_TypeReference concreteType=FieldAnalysis.getConcreteType(field);
if (concreteType != null) {
if (concreteType == fieldType) {
t.setDeclaredType();
t.setPreciseType();
}
 else {
fieldType=concreteType;
t.setType(concreteType);
t.setPreciseType();
}
}
}
if (field.isFinal()) {
VM_Class declaringClass=field.getDeclaringClass();
if (declaringClass.isInitialized() || declaringClass.isInBootImage()) {
try {
ConstantOperand rhs=StaticFieldReader.getStaticFieldValue(field);
push(rhs,fieldType);
break;
}
 catch (NoSuchFieldException e) {
if (VM.runningVM) {
throw new Error("String_Node_Str",e);
}
 else {
}
}
}
}
 else if (field.isRuntimeFinal()) {
if (VM.VerifyAssertions) VM._assert(fieldType.isBooleanType());
boolean rhsBool=field.getRuntimeFinalValue();
push(new IntConstantOperand(rhsBool ? 1 : 0));
break;
}
}
s=GetStatic.create(GETSTATIC,t,offsetOp,fieldOp);
push(t.copyD2U(),fieldType);
}
break;
case JBC_putstatic:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeStaticFieldRef(ref);
Operand offsetOp;
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
VM_Field field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
}
VM_TypeReference fieldType=ref.getFieldContentsType();
Operand r=pop(fieldType);
s=PutStatic.create(PUTSTATIC,r,offsetOp,fieldOp);
}
break;
case JBC_getfield:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeInstanceFieldRef(ref);
Operand offsetOp;
VM_TypeReference fieldType=ref.getFieldContentsType();
VM_Field field=null;
RegisterOperand t=gc.temps.makeTemp(fieldType);
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
VM_Type ft=fieldType.peekType();
if (ft != null && ft.isClassType()) {
VM_TypeReference concreteType=FieldAnalysis.getConcreteType(field);
if (concreteType != null) {
if (concreteType == fieldType) {
t.setDeclaredType();
t.setPreciseType();
}
 else {
fieldType=concreteType;
t.setType(concreteType);
t.setPreciseType();
}
}
}
}
Operand op1=pop();
clearCurrentGuard();
if (do_NullCheck(op1)) {
break;
}
if (op1.isConstant() && field.isFinal()) {
try {
ConstantOperand rhs=StaticFieldReader.getFieldValueAsConstant(field,op1.asObjectConstant().value);
push(rhs,fieldType);
break;
}
 catch (NoSuchFieldException e) {
if (VM.runningVM) {
throw new Error("String_Node_Str",e);
}
 else {
}
}
}
s=GetField.create(GETFIELD,t,op1,offsetOp,fieldOp,getCurrentGuard());
push(t.copyD2U(),fieldType);
}
break;
case JBC_putfield:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeInstanceFieldRef(ref);
VM_TypeReference fieldType=ref.getFieldContentsType();
Operand offsetOp;
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
VM_Field field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
}
Operand val=pop(fieldType);
Operand obj=popRef();
clearCurrentGuard();
if (do_NullCheck(obj)) {
break;
}
s=PutField.create(PUTFIELD,val,obj,offsetOp,fieldOp,getCurrentGuard());
}
break;
case JBC_invokevirtual:
{
VM_MethodReference ref=bcodes.getMethodReference();
if (ref.isMagic()) {
boolean generated=GenerateMagic.generateMagic(this,gc,ref);
if (generated) break;
}
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
if (ref.isMiranda()) {
s=_callHelper(ref,MethodOperand.INTERFACE(ref,null));
if (s == null) break;
Operand receiver=Call.getParam(s,0);
VM_Class receiverType=(VM_Class)receiver.getType().peekType();
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
VM_Method vmeth=null;
if (receiverType != null && receiverType.isInitialized() && !receiverType.isInterface()) {
vmeth=ClassLoaderProxy.lookupMethod(receiverType,ref);
}
if (vmeth != null) {
VM_MethodReference vmethRef=vmeth.getMemberRef().asMethodReference();
MethodOperand mop=MethodOperand.VIRTUAL(vmethRef,vmeth);
if (receiver.isConstant() || (receiver.isRegister() && receiver.asRegister().isPreciseType())) {
mop.refine(vmeth,true);
}
Call.setMethod(s,mop);
boolean unresolved=vmethRef.needsDynamicLink(bcodes.getMethod());
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(vmeth.getOffset()));
}
if (maybeInlineMethod(shouldInline(s,receiver.isConstant() || (receiver.isRegister() && receiver.asRegister().isExtant())),s)) {
return;
}
}
}
 else {
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
VM_Method target=ref.peekResolvedMethod();
MethodOperand methOp=MethodOperand.VIRTUAL(ref,target);
s=_callHelper(ref,methOp);
if (s == null) break;
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
if (VM.VerifyAssertions) VM._assert(target != null);
Call.setAddress(s,new AddressConstantOperand(target.getOffset()));
}
Operand receiver=Call.getParam(s,0);
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
boolean isExtant=false;
boolean isPreciseType=false;
VM_TypeReference tr=null;
if (receiver.isRegister()) {
RegisterOperand rop=receiver.asRegister();
isExtant=rop.isExtant();
isPreciseType=rop.isPreciseType();
tr=rop.getType();
}
 else {
isExtant=true;
isPreciseType=true;
tr=receiver.getType();
}
VM_Type type=tr.peekType();
if (type != null && type.isResolved()) {
if (type.isClassType()) {
VM_Method vmeth=target;
if (target == null || type != target.getDeclaringClass()) {
vmeth=ClassLoaderProxy.lookupMethod(type.asClass(),ref);
}
if (vmeth != null) {
methOp.refine(vmeth,isPreciseType || type.asClass().isFinal());
}
}
 else {
if (VM.VerifyAssertions) VM._assert(target != null,"String_Node_Str");
methOp.refine(target,true);
}
}
if (maybeInlineMethod(shouldInline(s,isExtant),s)) {
return;
}
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_invokespecial:
{
VM_MethodReference ref=bcodes.getMethodReference();
VM_Method target=ref.resolveInvokeSpecial();
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
s=_callHelper(ref,MethodOperand.SPECIAL(ref,target));
if (s == null) break;
if (target == null) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(target.getOffset()));
}
Operand receiver=Call.getParam(s,0);
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
if (maybeInlineMethod(shouldInline(s,false),s)) {
return;
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_invokestatic:
{
VM_MethodReference ref=bcodes.getMethodReference();
if (ref.isMagic()) {
boolean generated=GenerateMagic.generateMagic(this,gc,ref);
if (generated) break;
}
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
VM_Method target=ref.peekResolvedMethod();
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
s=_callHelper(ref,MethodOperand.STATIC(ref,target));
if (s == null) break;
if (Call.conforms(s)) {
MethodOperand methOp=Call.getMethod(s);
if (methOp.getTarget() == target) {
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(target.getOffset()));
}
if (maybeInlineMethod(shouldInline(s,false),s)) {
return;
}
}
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_invokeinterface:
{
VM_MethodReference ref=bcodes.getMethodReference();
bcodes.alignInvokeInterface();
VM_Method resolvedMethod=null;
resolvedMethod=ref.peekInterfaceMethod();
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
s=_callHelper(ref,MethodOperand.INTERFACE(ref,resolvedMethod));
if (s == null) break;
Operand receiver=Call.getParam(s,0);
VM_Class receiverType=(VM_Class)receiver.getType().peekType();
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
boolean requiresImplementsTest=VM.BuildForIMTInterfaceInvocation;
if (requiresImplementsTest) {
if (resolvedMethod == null) {
RegisterOperand tibPtr=gc.temps.makeTemp(VM_TypeReference.TIB);
Instruction getTib=GuardedUnary.create(GET_OBJ_TIB,tibPtr,receiver.copy(),getCurrentGuard());
appendInstruction(getTib);
getTib.bcIndex=RUNTIME_SERVICES_BCI;
VM_Method target=VM_Entrypoints.unresolvedInvokeinterfaceImplementsTestMethod;
Instruction callCheck=Call.create2(CALL,null,new AddressConstantOperand(target.getOffset()),MethodOperand.STATIC(target),new IntConstantOperand(ref.getId()),tibPtr.copyD2U());
if (gc.options.NO_CALLEE_EXCEPTIONS) {
callCheck.markAsNonPEI();
}
appendInstruction(callCheck);
callCheck.bcIndex=RUNTIME_SERVICES_BCI;
requiresImplementsTest=false;
rectifyStateWithErrorHandler();
}
 else {
VM_Type interfaceType=resolvedMethod.getDeclaringClass();
if (receiverType != null && receiverType.isResolved() && !receiverType.isInterface()) {
byte doesImplement=ClassLoaderProxy.includesType(interfaceType.getTypeRef(),receiverType.getTypeRef());
requiresImplementsTest=doesImplement != YES;
}
}
}
VM_Method vmeth=null;
if (receiverType != null && receiverType.isInitialized() && !receiverType.isInterface()) {
vmeth=ClassLoaderProxy.lookupMethod(receiverType,ref);
}
if (vmeth != null) {
VM_MethodReference vmethRef=vmeth.getMemberRef().asMethodReference();
if (requiresImplementsTest) {
RegisterOperand checkedReceiver=gc.temps.makeTemp(receiver);
appendInstruction(TypeCheck.create(MUST_IMPLEMENT_INTERFACE,checkedReceiver,receiver.copy(),makeTypeOperand(resolvedMethod.getDeclaringClass()),getCurrentGuard()));
checkedReceiver.refine(resolvedMethod.getDeclaringClass().getTypeRef());
Call.setParam(s,0,checkedReceiver.copyRO());
receiver=checkedReceiver;
rectifyStateWithErrorHandler();
}
MethodOperand mop=MethodOperand.VIRTUAL(vmethRef,vmeth);
if (receiver.isConstant() || receiver.asRegister().isPreciseType()) {
mop.refine(vmeth,true);
}
Call.setMethod(s,mop);
boolean unresolved=vmethRef.needsDynamicLink(bcodes.getMethod());
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(vmeth.getOffset()));
}
if (maybeInlineMethod(shouldInline(s,receiver.isConstant() || receiver.asRegister().isExtant()),s)) {
return;
}
}
 else {
if (resolvedMethod != null && maybeInlineMethod(shouldInline(s,false),s)) {
return;
}
 else {
if (requiresImplementsTest) {
RegisterOperand checkedReceiver=gc.temps.makeTemp(receiver);
appendInstruction(TypeCheck.create(MUST_IMPLEMENT_INTERFACE,checkedReceiver,receiver.copy(),makeTypeOperand(resolvedMethod.getDeclaringClass()),getCurrentGuard()));
checkedReceiver.refine(resolvedMethod.getDeclaringClass().getTypeRef());
Call.setParam(s,0,checkedReceiver.copyRO());
}
}
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_xxxunusedxxx:
OptimizingCompilerException.UNREACHABLE();
break;
case JBC_new:
{
VM_TypeReference klass=bcodes.getTypeReference();
RegisterOperand t=gc.temps.makeTemp(klass);
t.setPreciseType();
t.setExtant();
markGuardlessNonNull(t);
Operator operator;
TypeOperand klassOp;
VM_Class klassType=(VM_Class)klass.peekType();
if (klassType != null && (klassType.isInitialized() || klassType.isInBootImage())) {
klassOp=makeTypeOperand(klassType);
operator=NEW;
}
 else {
operator=NEW_UNRESOLVED;
klassOp=makeTypeOperand(klass);
}
s=New.create(operator,t,klassOp);
push(t.copyD2U());
rectifyStateWithErrorHandler();
}
break;
case JBC_newarray:
{
VM_Type array=bcodes.getPrimitiveArrayType();
TypeOperand arrayOp=makeTypeOperand(array);
RegisterOperand t=gc.temps.makeTemp(array.getTypeRef());
t.setPreciseType();
t.setExtant();
markGuardlessNonNull(t);
s=NewArray.create(NEWARRAY,t,arrayOp,popInt());
push(t.copyD2U());
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangNegativeArraySizeException);
}
break;
case JBC_anewarray:
{
VM_TypeReference elementTypeRef=bcodes.getTypeReference();
s=generateAnewarray(null,elementTypeRef);
}
break;
case JBC_arraylength:
{
Operand op1=pop();
clearCurrentGuard();
if (do_NullCheck(op1)) {
break;
}
if (VM.VerifyAssertions) {
VM._assert(getArrayTypeOf(op1).isArrayType());
}
RegisterOperand t=gc.temps.makeTempInt();
s=GuardedUnary.create(ARRAYLENGTH,t,op1,getCurrentGuard());
push(t.copyD2U());
}
break;
case JBC_athrow:
{
Operand op0=pop();
clearCurrentGuard();
if (do_NullCheck(op0)) {
break;
}
VM_TypeReference type=getRefTypeOf(op0);
if (VM.VerifyAssertions) assertIsAssignable(VM_TypeReference.JavaLangThrowable,type);
if (!gc.method.isInterruptible()) {
appendInstruction(Empty.create(UNINT_END));
}
endOfBasicBlock=true;
BasicBlock definiteTarget=rectifyStateWithExceptionHandler(type,true);
if (definiteTarget != null) {
appendInstruction(CacheOp.create(SET_CAUGHT_EXCEPTION,op0));
s=Goto.create(GOTO,definiteTarget.makeJumpTarget());
definiteTarget.setExceptionHandlerWithNormalIn();
}
 else {
s=Athrow.create(ATHROW,op0);
}
}
break;
case JBC_checkcast:
{
VM_TypeReference typeRef=bcodes.getTypeReference();
boolean classLoading=couldCauseClassLoading(typeRef);
Operand op2=pop();
if (typeRef.isWordType()) {
op2=op2.copy();
if (op2 instanceof RegisterOperand) {
((RegisterOperand)op2).setType(typeRef);
}
push(op2);
if (DBG_CF) db("String_Node_Str" + typeRef);
break;
}
if (VM.VerifyAssertions) VM._assert(op2.isRef());
if (CF_CHECKCAST && !classLoading) {
if (op2.isDefinitelyNull()) {
push(op2);
if (DBG_CF) db("String_Node_Str");
break;
}
VM_TypeReference type=getRefTypeOf(op2);
if (ClassLoaderProxy.includesType(typeRef,type) == YES) {
push(op2);
if (DBG_CF) {
db("String_Node_Str" + op2 + "String_Node_Str"+ typeRef+ "String_Node_Str"+ type);
}
break;
}
}
RegisterOperand refinedOp2=gc.temps.makeTemp(op2);
if (!gc.options.NO_CHECKCAST) {
if (classLoading) {
s=TypeCheck.create(CHECKCAST_UNRESOLVED,refinedOp2,op2.copy(),makeTypeOperand(typeRef));
}
 else {
TypeOperand typeOp=makeTypeOperand(typeRef.peekType());
if (isNonNull(op2)) {
s=TypeCheck.create(CHECKCAST_NOTNULL,refinedOp2,op2.copy(),typeOp,getGuard(op2));
}
 else {
s=TypeCheck.create(CHECKCAST,refinedOp2,op2.copy(),typeOp);
}
}
}
refinedOp2.refine(typeRef);
push(refinedOp2.copyRO());
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangClassCastException);
if (classLoading) rectifyStateWithErrorHandler();
}
break;
case JBC_instanceof:
{
VM_TypeReference typeRef=bcodes.getTypeReference();
boolean classLoading=couldCauseClassLoading(typeRef);
Operand op2=pop();
if (VM.VerifyAssertions) VM._assert(op2.isRef());
if (CF_INSTANCEOF && !classLoading) {
if (op2.isDefinitelyNull()) {
push(new IntConstantOperand(0));
if (DBG_CF) db("String_Node_Str");
break;
}
VM_TypeReference type=getRefTypeOf(op2);
int answer=ClassLoaderProxy.includesType(typeRef,type);
if (answer == YES && isNonNull(op2)) {
push(new IntConstantOperand(1));
if (DBG_CF) {
db(op2 + "String_Node_Str" + typeRef+ "String_Node_Str");
}
break;
}
 else if (answer == NO) {
if (DBG_CF) {
db(op2 + "String_Node_Str" + typeRef+ "String_Node_Str");
}
push(new IntConstantOperand(0));
break;
}
}
RegisterOperand t=gc.temps.makeTempInt();
if (classLoading) {
s=InstanceOf.create(INSTANCEOF_UNRESOLVED,t,makeTypeOperand(typeRef),op2);
}
 else {
TypeOperand typeOp=makeTypeOperand(typeRef.peekType());
if (isNonNull(op2)) {
s=InstanceOf.create(INSTANCEOF_NOTNULL,t,typeOp,op2,getGuard(op2));
}
 else {
s=InstanceOf.create(INSTANCEOF,t,typeOp,op2);
}
}
push(t.copyD2U());
if (classLoading) rectifyStateWithErrorHandler();
}
break;
case JBC_monitorenter:
{
Operand op0=pop();
clearCurrentGuard();
if (do_NullCheck(op0)) {
break;
}
if (VM.VerifyAssertions) VM._assert(op0.isRef());
if (gc.options.MONITOR_NOP) {
s=null;
}
 else {
s=MonitorOp.create(MONITORENTER,op0,getCurrentGuard());
}
}
break;
case JBC_monitorexit:
{
Operand op0=pop();
clearCurrentGuard();
if (do_NullCheck(op0)) {
break;
}
if (gc.options.MONITOR_NOP) {
s=null;
}
 else {
s=MonitorOp.create(MONITOREXIT,op0,getCurrentGuard());
}
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangIllegalMonitorStateException);
}
break;
case JBC_wide:
{
int widecode=bcodes.getWideOpcode();
int index=bcodes.getWideLocalNumber();
switch (widecode) {
case JBC_iload:
s=do_iload(index);
break;
case JBC_lload:
s=do_lload(index);
break;
case JBC_fload:
s=do_fload(index);
break;
case JBC_dload:
s=do_dload(index);
break;
case JBC_aload:
s=do_aload(index);
break;
case JBC_istore:
s=do_store(index,popInt());
break;
case JBC_lstore:
s=do_store(index,popLong());
break;
case JBC_fstore:
s=do_store(index,popFloat());
break;
case JBC_dstore:
s=do_store(index,popDouble());
break;
case JBC_astore:
s=do_astore(index);
break;
case JBC_iinc:
s=do_iinc(index,bcodes.getWideIncrement());
break;
case JBC_ret:
s=_retHelper(index);
break;
default :
OptimizingCompilerException.UNREACHABLE();
break;
}
}
break;
case JBC_multianewarray:
{
VM_TypeReference arrayType=bcodes.getTypeReference();
int dimensions=bcodes.getArrayDimension();
if (dimensions == 1) {
s=generateAnewarray(arrayType,null);
}
 else {
TypeOperand typeOp=makeTypeOperand(arrayType);
RegisterOperand result=gc.temps.makeTemp(arrayType);
markGuardlessNonNull(result);
result.setPreciseType();
result.setExtant();
s=Multianewarray.create(NEWOBJMULTIARRAY,result,typeOp,dimensions);
for (int i=0; i < dimensions; i++) {
Multianewarray.setDimension(s,dimensions - i - 1,popInt());
}
push(result.copyD2U());
rectifyStateWithErrorHandler();
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangNegativeArraySizeException);
}
}
break;
case JBC_ifnull:
s=_refIfNullHelper(ConditionOperand.EQUAL());
break;
case JBC_ifnonnull:
s=_refIfNullHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_goto_w:
{
int offset=bcodes.getWideBranchOffset();
if (offset != 5) {
s=_gotoHelper(offset);
}
}
break;
case JBC_jsr_w:
s=_jsrHelper(bcodes.getWideBranchOffset());
break;
case JBC_impdep1:
{
if (VM.BuildForAdaptiveSystem) {
int pseudo_opcode=bcodes.nextPseudoInstruction();
switch (pseudo_opcode) {
case PSEUDO_LoadIntConst:
{
int value=bcodes.readIntConst();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
push(new IntConstantOperand(value));
param1=param2;
param2=value;
break;
}
case PSEUDO_LoadLongConst:
{
long value=bcodes.readLongConst();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
pushDual(new LongConstantOperand(value,Offset.zero()));
break;
}
case PSEUDO_LoadWordConst:
{
Address a=(VM.BuildFor32Addr) ? Address.fromIntSignExtend(bcodes.readIntConst()) : Address.fromLong(bcodes.readLongConst());
push(new AddressConstantOperand(a));
if (VM.TraceOnStackReplacement) {
VM.sysWrite("String_Node_Str");
}
VM.sysWrite(a);
VM.sysWriteln();
break;
}
case PSEUDO_LoadFloatConst:
{
int ibits=bcodes.readIntConst();
float value=Float.intBitsToFloat(ibits);
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
push(new FloatConstantOperand(value,Offset.zero()));
break;
}
case PSEUDO_LoadDoubleConst:
{
long lbits=bcodes.readLongConst();
double value=VM_Magic.longBitsAsDouble(lbits);
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + lbits);
}
pushDual(new DoubleConstantOperand(value,Offset.zero()));
break;
}
case PSEUDO_LoadRetAddrConst:
{
int value=bcodes.readIntConst();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
push(new ReturnAddressOperand(value));
break;
}
case PSEUDO_InvokeStatic:
{
VM_Method meth=null;
int targetidx=bcodes.readIntConst();
switch (targetidx) {
case GETREFAT:
meth=VM_AosEntrypoints.osrGetRefAtMethod;
break;
case CLEANREFS:
meth=VM_AosEntrypoints.osrCleanRefsMethod;
break;
default :
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + targetidx);
}
OptimizingCompilerException.UNREACHABLE();
break;
}
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + meth + "String_Node_Str");
}
s=_callHelper(meth.getMemberRef().asMethodReference(),MethodOperand.STATIC(meth));
if (s == null) break;
Call.setAddress(s,new AddressConstantOperand(meth.getOffset()));
if (targetidx == GETREFAT) {
Object realObj=OSR_ObjectHolder.getRefAt(param1,param2);
if (VM.VerifyAssertions) VM._assert(realObj != null);
VM_TypeReference klass=VM_Magic.getObjectType(realObj).getTypeRef();
RegisterOperand op0=gc.temps.makeTemp(klass);
Call.setResult(s,op0);
pop();
push(op0.copyD2U(),klass);
}
rectifyStateWithExceptionHandlers();
break;
}
case PSEUDO_InvokeCompiledMethod:
{
int cmid=bcodes.readIntConst();
int origBCIdx=bcodes.readIntConst();
VM_CompiledMethod cm=VM_CompiledMethods.getCompiledMethod(cmid);
VM_Method meth=cm.getMethod();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + meth + "String_Node_Str");
}
s=_callHelper(meth.getMemberRef().asMethodReference(),MethodOperand.COMPILED(meth,cm.getOsrJTOCoffset()));
if (s == null) break;
s.bcIndex=origBCIdx + bciAdjustment;
rectifyStateWithExceptionHandlers();
break;
}
case PSEUDO_ParamInitEnd:
{
break;
}
default :
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + pseudo_opcode);
}
OptimizingCompilerException.UNREACHABLE();
break;
}
break;
}
 else {
OptimizingCompilerException.UNREACHABLE();
}
}
default :
OptimizingCompilerException.UNREACHABLE();
break;
}
if (s != null && !currentBBLE.isSelfRegen()) {
appendInstruction(s);
}
if (VM.VerifyAssertions) VM._assert(bcodes.index() <= runoff);
if (!endOfBasicBlock && bcodes.index() == runoff) {
if (DBG_BB || DBG_SELECTED) {
db("String_Node_Str" + currentBBLE + "String_Node_Str"+ runoff);
}
endOfBasicBlock=fallThrough=true;
}
if (endOfBasicBlock) {
if (currentBBLE.isSelfRegen()) {
currentBBLE.block.deleteOut();
if (DBG_CFG || DBG_SELECTED) {
db("String_Node_Str" + currentBBLE.block);
}
return;
}
if (fallThrough) {
if (VM.VerifyAssertions) VM._assert(bcodes.index() < bcodes.length());
currentBBLE.fallThrough=getOrCreateBlock(bcodes.index());
currentBBLE.block.insertOut(currentBBLE.fallThrough.block);
}
return;
}
}
}

Fixed version (ground truth):
/** 
 * Generate instructions for a basic block. May discover other basic blocks that need to be generated along the way.
 * @param fromIndex bytecode index to start from
 */
private void generateFrom(int fromIndex){
  if (DBG_BB || DBG_SELECTED) {
    db("String_Node_Str" + currentBBLE + "String_Node_Str"+ runoff);
  }
  currentBBLE.setGenerated();
  endOfBasicBlock=fallThrough=false;
  lastInstr=null;
  bcodes.reset(fromIndex);
  while (true) {
    currentBBLE.high=instrIndex=bcodes.index();
    int code=bcodes.nextInstruction();
    if (DBG_BCPARSE) {
      db("String_Node_Str" + instrIndex + "String_Node_Str"+ code+ "String_Node_Str"+ Integer.toHexString(code)+ "String_Node_Str"+ ((code < JBC_name.length) ? JBC_name[code] : "String_Node_Str"));
    }
    Instruction s=null;
    lastOsrBarrier=null;
switch (code) {
case JBC_nop:
      break;
case JBC_aconst_null:
    push(new NullConstantOperand());
  break;
case JBC_iconst_m1:
case JBC_iconst_0:
case JBC_iconst_1:
case JBC_iconst_2:
case JBC_iconst_3:
case JBC_iconst_4:
case JBC_iconst_5:
push(new IntConstantOperand(code - JBC_iconst_0));
break;
case JBC_lconst_0:
case JBC_lconst_1:
pushDual(new LongConstantOperand(code - JBC_lconst_0));
break;
case JBC_fconst_0:
push(new FloatConstantOperand(0.f));
break;
case JBC_fconst_1:
push(new FloatConstantOperand(1.f));
break;
case JBC_fconst_2:
push(new FloatConstantOperand(2.f));
break;
case JBC_dconst_0:
pushDual(new DoubleConstantOperand(0.));
break;
case JBC_dconst_1:
pushDual(new DoubleConstantOperand(1.));
break;
case JBC_bipush:
push(new IntConstantOperand(bcodes.getByteValue()));
break;
case JBC_sipush:
push(new IntConstantOperand(bcodes.getShortValue()));
break;
case JBC_ldc:
push(getConstantOperand(bcodes.getConstantIndex()));
break;
case JBC_ldc_w:
push(getConstantOperand(bcodes.getWideConstantIndex()));
break;
case JBC_ldc2_w:
pushDual(getConstantOperand(bcodes.getWideConstantIndex()));
break;
case JBC_iload:
s=do_iload(bcodes.getLocalNumber());
break;
case JBC_lload:
s=do_lload(bcodes.getLocalNumber());
break;
case JBC_fload:
s=do_fload(bcodes.getLocalNumber());
break;
case JBC_dload:
s=do_dload(bcodes.getLocalNumber());
break;
case JBC_aload:
s=do_aload(bcodes.getLocalNumber());
break;
case JBC_iload_0:
case JBC_iload_1:
case JBC_iload_2:
case JBC_iload_3:
s=do_iload(code - JBC_iload_0);
break;
case JBC_lload_0:
case JBC_lload_1:
case JBC_lload_2:
case JBC_lload_3:
s=do_lload(code - JBC_lload_0);
break;
case JBC_fload_0:
case JBC_fload_1:
case JBC_fload_2:
case JBC_fload_3:
s=do_fload(code - JBC_fload_0);
break;
case JBC_dload_0:
case JBC_dload_1:
case JBC_dload_2:
case JBC_dload_3:
s=do_dload(code - JBC_dload_0);
break;
case JBC_aload_0:
case JBC_aload_1:
case JBC_aload_2:
case JBC_aload_3:
s=do_aload(code - JBC_aload_0);
break;
case JBC_iaload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.IntArray);
}
s=_aloadHelper(INT_ALOAD,ref,index,VM_TypeReference.Int);
}
break;
case JBC_laload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.LongArray);
}
s=_aloadHelper(LONG_ALOAD,ref,index,VM_TypeReference.Long);
}
break;
case JBC_faload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.FloatArray);
}
s=_aloadHelper(FLOAT_ALOAD,ref,index,VM_TypeReference.Float);
}
break;
case JBC_daload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.DoubleArray);
}
s=_aloadHelper(DOUBLE_ALOAD,ref,index,VM_TypeReference.Double);
}
break;
case JBC_aaload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getRefTypeOf(ref).getArrayElementType();
if (VM.VerifyAssertions) VM._assert(type.isReferenceType());
s=_aloadHelper(REF_ALOAD,ref,index,type);
}
break;
case JBC_baload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getArrayTypeOf(ref);
if (VM.VerifyAssertions) {
VM._assert(type == VM_TypeReference.ByteArray || type == VM_TypeReference.BooleanArray);
}
if (type == VM_TypeReference.ByteArray) {
s=_aloadHelper(BYTE_ALOAD,ref,index,VM_TypeReference.Byte);
}
 else {
s=_aloadHelper(UBYTE_ALOAD,ref,index,VM_TypeReference.Boolean);
}
}
break;
case JBC_caload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.CharArray);
}
s=_aloadHelper(USHORT_ALOAD,ref,index,VM_TypeReference.Char);
}
break;
case JBC_saload:
{
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.ShortArray);
}
s=_aloadHelper(SHORT_ALOAD,ref,index,VM_TypeReference.Short);
}
break;
case JBC_istore:
s=do_store(bcodes.getLocalNumber(),popInt());
break;
case JBC_lstore:
s=do_store(bcodes.getLocalNumber(),popLong());
break;
case JBC_fstore:
s=do_store(bcodes.getLocalNumber(),popFloat());
break;
case JBC_dstore:
s=do_store(bcodes.getLocalNumber(),popDouble());
break;
case JBC_astore:
s=do_astore(bcodes.getLocalNumber());
break;
case JBC_istore_0:
case JBC_istore_1:
case JBC_istore_2:
case JBC_istore_3:
s=do_store(code - JBC_istore_0,popInt());
break;
case JBC_lstore_0:
case JBC_lstore_1:
case JBC_lstore_2:
case JBC_lstore_3:
s=do_store(code - JBC_lstore_0,popLong());
break;
case JBC_fstore_0:
case JBC_fstore_1:
case JBC_fstore_2:
case JBC_fstore_3:
s=do_store(code - JBC_fstore_0,popFloat());
break;
case JBC_dstore_0:
case JBC_dstore_1:
case JBC_dstore_2:
case JBC_dstore_3:
s=do_store(code - JBC_dstore_0,popDouble());
break;
case JBC_astore_0:
case JBC_astore_1:
case JBC_astore_2:
case JBC_astore_3:
s=do_astore(code - JBC_astore_0);
break;
case JBC_iastore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.IntArray);
}
s=AStore.create(INT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Int),getCurrentGuard());
}
break;
case JBC_lastore:
{
Operand val=popLong();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.LongArray);
}
s=AStore.create(LONG_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Long),getCurrentGuard());
}
break;
case JBC_fastore:
{
Operand val=popFloat();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.FloatArray);
}
s=AStore.create(FLOAT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Float),getCurrentGuard());
}
break;
case JBC_dastore:
{
Operand val=popDouble();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.DoubleArray);
}
s=AStore.create(DOUBLE_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Double),getCurrentGuard());
}
break;
case JBC_aastore:
{
Operand val=pop();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getRefTypeOf(ref).getArrayElementType();
if (VM.VerifyAssertions) VM._assert(type.isReferenceType());
if (do_CheckStore(ref,val,type)) {
break;
}
s=AStore.create(REF_ASTORE,val,ref,index,new LocationOperand(type),getCurrentGuard());
}
break;
case JBC_bastore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
VM_TypeReference type=getArrayTypeOf(ref);
if (VM.VerifyAssertions) {
VM._assert(type == VM_TypeReference.ByteArray || type == VM_TypeReference.BooleanArray);
}
if (type == VM_TypeReference.ByteArray) {
type=VM_TypeReference.Byte;
}
 else {
type=VM_TypeReference.Boolean;
}
s=AStore.create(BYTE_ASTORE,val,ref,index,new LocationOperand(type),getCurrentGuard());
}
break;
case JBC_castore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.CharArray);
}
s=AStore.create(SHORT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Char),getCurrentGuard());
}
break;
case JBC_sastore:
{
Operand val=popInt();
Operand index=popInt();
Operand ref=pop();
clearCurrentGuard();
if (do_NullCheck(ref) || do_BoundsCheck(ref,index)) {
break;
}
if (VM.VerifyAssertions) {
assertIsType(ref,VM_TypeReference.ShortArray);
}
s=AStore.create(SHORT_ASTORE,val,ref,index,new LocationOperand(VM_TypeReference.Short),getCurrentGuard());
}
break;
case JBC_pop:
stack.pop();
break;
case JBC_pop2:
stack.pop2();
break;
case JBC_dup:
{
Operand op1=stack.pop();
stack.push(op1);
s=pushCopy(op1);
}
break;
case JBC_dup_x1:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
stack.push(op1);
stack.push(op2);
s=pushCopy(op1);
}
break;
case JBC_dup_x2:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
Operand op3=stack.pop();
stack.push(op1);
stack.push(op3);
stack.push(op2);
s=pushCopy(op1);
}
break;
case JBC_dup2:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
stack.push(op2);
stack.push(op1);
s=pushCopy(op2);
if (s != null) {
appendInstruction(s);
s=null;
}
s=pushCopy(op1);
}
break;
case JBC_dup2_x1:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
Operand op3=stack.pop();
stack.push(op2);
stack.push(op1);
stack.push(op3);
s=pushCopy(op2);
if (s != null) {
appendInstruction(s);
s=null;
}
s=pushCopy(op1);
}
break;
case JBC_dup2_x2:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
Operand op3=stack.pop();
Operand op4=stack.pop();
stack.push(op2);
stack.push(op1);
stack.push(op4);
stack.push(op3);
s=pushCopy(op2);
if (s != null) {
appendInstruction(s);
s=null;
}
s=pushCopy(op1);
}
break;
case JBC_swap:
{
Operand op1=stack.pop();
Operand op2=stack.pop();
stack.push(op1);
stack.push(op2);
}
break;
case JBC_iadd:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_ADD,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_ladd:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_ADD,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_fadd:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_ADD,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_dadd:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_ADD,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_isub:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_SUB,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lsub:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_SUB,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_fsub:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_SUB,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_dsub:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_SUB,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_imul:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_MUL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lmul:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_MUL,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_fmul:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_MUL,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_dmul:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_MUL,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_idiv:
{
clearCurrentGuard();
Operand op2=popInt();
Operand op1=popInt();
if (do_IntZeroCheck(op2)) {
break;
}
s=_guardedBinaryHelper(INT_DIV,op1,op2,getCurrentGuard(),VM_TypeReference.Int);
}
break;
case JBC_ldiv:
{
clearCurrentGuard();
Operand op2=popLong();
Operand op1=popLong();
if (do_LongZeroCheck(op2)) {
break;
}
s=_guardedBinaryDualHelper(LONG_DIV,op1,op2,getCurrentGuard(),VM_TypeReference.Long);
}
break;
case JBC_fdiv:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_DIV,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_ddiv:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_DIV,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_irem:
{
clearCurrentGuard();
Operand op2=popInt();
Operand op1=popInt();
if (do_IntZeroCheck(op2)) {
break;
}
s=_guardedBinaryHelper(INT_REM,op1,op2,getCurrentGuard(),VM_TypeReference.Int);
}
break;
case JBC_lrem:
{
clearCurrentGuard();
Operand op2=popLong();
Operand op1=popLong();
if (do_LongZeroCheck(op2)) {
break;
}
s=_guardedBinaryDualHelper(LONG_REM,op1,op2,getCurrentGuard(),VM_TypeReference.Long);
}
break;
case JBC_frem:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_REM,op1,op2,VM_TypeReference.Float);
}
break;
case JBC_drem:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryDualHelper(DOUBLE_REM,op1,op2,VM_TypeReference.Double);
}
break;
case JBC_ineg:
s=_unaryHelper(INT_NEG,popInt(),VM_TypeReference.Int);
break;
case JBC_lneg:
s=_unaryDualHelper(LONG_NEG,popLong(),VM_TypeReference.Long);
break;
case JBC_fneg:
s=_unaryHelper(FLOAT_NEG,popFloat(),VM_TypeReference.Float);
break;
case JBC_dneg:
s=_unaryDualHelper(DOUBLE_NEG,popDouble(),VM_TypeReference.Double);
break;
case JBC_ishl:
{
Operand op2=popShiftInt(false);
Operand op1=popInt();
s=_binaryHelper(INT_SHL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lshl:
{
Operand op2=popShiftInt(true);
Operand op1=popLong();
s=_binaryDualHelper(LONG_SHL,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_ishr:
{
Operand op2=popShiftInt(false);
Operand op1=popInt();
s=_binaryHelper(INT_SHR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lshr:
{
Operand op2=popShiftInt(true);
Operand op1=popLong();
s=_binaryDualHelper(LONG_SHR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_iushr:
{
Operand op2=popShiftInt(false);
Operand op1=popInt();
s=_binaryHelper(INT_USHR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lushr:
{
Operand op2=popShiftInt(true);
Operand op1=popLong();
s=_binaryDualHelper(LONG_USHR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_iand:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_AND,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_land:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_AND,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_ior:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_OR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lor:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_OR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_ixor:
{
Operand op2=popInt();
Operand op1=popInt();
s=_binaryHelper(INT_XOR,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_lxor:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryDualHelper(LONG_XOR,op1,op2,VM_TypeReference.Long);
}
break;
case JBC_iinc:
{
int index=bcodes.getLocalNumber();
s=do_iinc(index,bcodes.getIncrement());
}
break;
case JBC_i2l:
s=_unaryDualHelper(INT_2LONG,popInt(),VM_TypeReference.Long);
break;
case JBC_i2f:
s=_unaryHelper(INT_2FLOAT,popInt(),VM_TypeReference.Float);
break;
case JBC_i2d:
s=_unaryDualHelper(INT_2DOUBLE,popInt(),VM_TypeReference.Double);
break;
case JBC_l2i:
s=_unaryHelper(LONG_2INT,popLong(),VM_TypeReference.Int);
break;
case JBC_l2f:
s=_unaryHelper(LONG_2FLOAT,popLong(),VM_TypeReference.Float);
break;
case JBC_l2d:
s=_unaryDualHelper(LONG_2DOUBLE,popLong(),VM_TypeReference.Double);
break;
case JBC_f2i:
s=_unaryHelper(FLOAT_2INT,popFloat(),VM_TypeReference.Int);
break;
case JBC_f2l:
s=_unaryDualHelper(FLOAT_2LONG,popFloat(),VM_TypeReference.Long);
break;
case JBC_f2d:
s=_unaryDualHelper(FLOAT_2DOUBLE,popFloat(),VM_TypeReference.Double);
break;
case JBC_d2i:
s=_unaryHelper(DOUBLE_2INT,popDouble(),VM_TypeReference.Int);
break;
case JBC_d2l:
s=_unaryDualHelper(DOUBLE_2LONG,popDouble(),VM_TypeReference.Long);
break;
case JBC_d2f:
s=_unaryHelper(DOUBLE_2FLOAT,popDouble(),VM_TypeReference.Float);
break;
case JBC_int2byte:
s=_unaryHelper(INT_2BYTE,popInt(),VM_TypeReference.Byte);
break;
case JBC_int2char:
s=_unaryHelper(INT_2USHORT,popInt(),VM_TypeReference.Char);
break;
case JBC_int2short:
s=_unaryHelper(INT_2SHORT,popInt(),VM_TypeReference.Short);
break;
case JBC_lcmp:
{
Operand op2=popLong();
Operand op1=popLong();
s=_binaryHelper(LONG_CMP,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_fcmpl:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_CMPL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_fcmpg:
{
Operand op2=popFloat();
Operand op1=popFloat();
s=_binaryHelper(FLOAT_CMPG,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_dcmpl:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryHelper(DOUBLE_CMPL,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_dcmpg:
{
Operand op2=popDouble();
Operand op1=popDouble();
s=_binaryHelper(DOUBLE_CMPG,op1,op2,VM_TypeReference.Int);
}
break;
case JBC_ifeq:
s=_intIfHelper(ConditionOperand.EQUAL());
break;
case JBC_ifne:
s=_intIfHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_iflt:
s=_intIfHelper(ConditionOperand.LESS());
break;
case JBC_ifge:
s=_intIfHelper(ConditionOperand.GREATER_EQUAL());
break;
case JBC_ifgt:
s=_intIfHelper(ConditionOperand.GREATER());
break;
case JBC_ifle:
s=_intIfHelper(ConditionOperand.LESS_EQUAL());
break;
case JBC_if_icmpeq:
s=_intIfCmpHelper(ConditionOperand.EQUAL());
break;
case JBC_if_icmpne:
s=_intIfCmpHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_if_icmplt:
s=_intIfCmpHelper(ConditionOperand.LESS());
break;
case JBC_if_icmpge:
s=_intIfCmpHelper(ConditionOperand.GREATER_EQUAL());
break;
case JBC_if_icmpgt:
s=_intIfCmpHelper(ConditionOperand.GREATER());
break;
case JBC_if_icmple:
s=_intIfCmpHelper(ConditionOperand.LESS_EQUAL());
break;
case JBC_if_acmpeq:
s=_refIfCmpHelper(ConditionOperand.EQUAL());
break;
case JBC_if_acmpne:
s=_refIfCmpHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_goto:
{
int offset=bcodes.getBranchOffset();
if (offset != 3) {
s=_gotoHelper(offset);
}
}
break;
case JBC_jsr:
s=_jsrHelper(bcodes.getBranchOffset());
break;
case JBC_ret:
s=_retHelper(bcodes.getLocalNumber());
break;
case JBC_tableswitch:
{
bcodes.alignSwitch();
Operand op0=popInt();
int defaultoff=bcodes.getDefaultSwitchOffset();
int low=bcodes.getLowSwitchValue();
int high=bcodes.getHighSwitchValue();
int number=high - low + 1;
if (CF_TABLESWITCH && op0 instanceof IntConstantOperand) {
int v1=((IntConstantOperand)op0).value;
int match=bcodes.computeTableSwitchOffset(v1,low,high);
int offset=match == 0 ? defaultoff : match;
bcodes.skipTableSwitchOffsets(number);
if (DBG_CF) {
db("String_Node_Str" + v1 + "String_Node_Str");
}
s=_gotoHelper(offset);
break;
}
s=TableSwitch.create(TABLESWITCH,op0,null,null,new IntConstantOperand(low),new IntConstantOperand(high),generateTarget(defaultoff),null,number * 2);
for (int i=0; i < number; ++i) {
TableSwitch.setTarget(s,i,generateTarget(bcodes.getTableSwitchOffset(i)));
}
bcodes.skipTableSwitchOffsets(number);
VM_SwitchBranchProfile sp=gc.getSwitchProfile(instrIndex - bciAdjustment);
if (sp == null) {
float approxProb=1.0f / (number + 1);
TableSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(approxProb));
for (int i=0; i < number; ++i) {
TableSwitch.setBranchProfile(s,i,new BranchProfileOperand(approxProb));
}
}
 else {
TableSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(sp.getDefaultProbability()));
for (int i=0; i < number; ++i) {
TableSwitch.setBranchProfile(s,i,new BranchProfileOperand(sp.getCaseProbability(i)));
}
}
}
break;
case JBC_lookupswitch:
{
bcodes.alignSwitch();
Operand op0=popInt();
int defaultoff=bcodes.getDefaultSwitchOffset();
int numpairs=bcodes.getSwitchLength();
if (numpairs == 0) {
s=_gotoHelper(defaultoff);
break;
}
if (CF_LOOKUPSWITCH && op0 instanceof IntConstantOperand) {
int v1=((IntConstantOperand)op0).value;
int match=bcodes.computeLookupSwitchOffset(v1,numpairs);
int offset=match == 0 ? defaultoff : match;
bcodes.skipLookupSwitchPairs(numpairs);
if (DBG_CF) {
db("String_Node_Str" + v1 + "String_Node_Str");
}
s=_gotoHelper(offset);
break;
}
s=LookupSwitch.create(LOOKUPSWITCH,op0,null,null,generateTarget(defaultoff),null,numpairs * 3);
for (int i=0; i < numpairs; ++i) {
LookupSwitch.setMatch(s,i,new IntConstantOperand(bcodes.getLookupSwitchValue(i)));
LookupSwitch.setTarget(s,i,generateTarget(bcodes.getLookupSwitchOffset(i)));
}
bcodes.skipLookupSwitchPairs(numpairs);
VM_SwitchBranchProfile sp=gc.getSwitchProfile(instrIndex - bciAdjustment);
if (sp == null) {
float approxProb=1.0f / (float)(numpairs + 1);
LookupSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(approxProb));
for (int i=0; i < numpairs; ++i) {
LookupSwitch.setBranchProfile(s,i,new BranchProfileOperand(approxProb));
}
}
 else {
LookupSwitch.setDefaultBranchProfile(s,new BranchProfileOperand(sp.getDefaultProbability()));
for (int i=0; i < numpairs; ++i) {
LookupSwitch.setBranchProfile(s,i,new BranchProfileOperand(sp.getCaseProbability(i)));
}
}
}
break;
case JBC_ireturn:
_returnHelper(INT_MOVE,popInt());
break;
case JBC_lreturn:
_returnHelper(LONG_MOVE,popLong());
break;
case JBC_freturn:
_returnHelper(FLOAT_MOVE,popFloat());
break;
case JBC_dreturn:
_returnHelper(DOUBLE_MOVE,popDouble());
break;
case JBC_areturn:
{
Operand op0=popRef();
if (VM.VerifyAssertions && !op0.isDefinitelyNull()) {
VM_TypeReference retType=op0.getType();
assertIsAssignable(gc.method.getReturnType(),retType);
}
_returnHelper(REF_MOVE,op0);
}
break;
case JBC_return:
_returnHelper(null,null);
break;
case JBC_getstatic:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeStaticFieldRef(ref);
Operand offsetOp;
VM_TypeReference fieldType=ref.getFieldContentsType();
RegisterOperand t=gc.temps.makeTemp(fieldType);
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
VM_Field field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
VM_Type ft=fieldType.peekType();
if (ft != null && ft.isClassType()) {
VM_TypeReference concreteType=FieldAnalysis.getConcreteType(field);
if (concreteType != null) {
if (concreteType == fieldType) {
t.setDeclaredType();
t.setPreciseType();
}
 else {
fieldType=concreteType;
t.setType(concreteType);
t.setPreciseType();
}
}
}
if (field.isFinal()) {
VM_Class declaringClass=field.getDeclaringClass();
if (declaringClass.isInitialized() || declaringClass.isInBootImage()) {
try {
ConstantOperand rhs=StaticFieldReader.getStaticFieldValue(field);
push(rhs,fieldType);
break;
}
 catch (NoSuchFieldException e) {
if (VM.runningVM) {
throw new Error("String_Node_Str",e);
}
 else {
}
}
}
}
 else if (field.isRuntimeFinal()) {
if (VM.VerifyAssertions) VM._assert(fieldType.isBooleanType());
boolean rhsBool=field.getRuntimeFinalValue();
push(new IntConstantOperand(rhsBool ? 1 : 0));
break;
}
}
s=GetStatic.create(GETSTATIC,t,offsetOp,fieldOp);
push(t.copyD2U(),fieldType);
}
break;
case JBC_putstatic:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeStaticFieldRef(ref);
Operand offsetOp;
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
VM_Field field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
}
VM_TypeReference fieldType=ref.getFieldContentsType();
Operand r=pop(fieldType);
s=PutStatic.create(PUTSTATIC,r,offsetOp,fieldOp);
}
break;
case JBC_getfield:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeInstanceFieldRef(ref);
Operand offsetOp;
VM_TypeReference fieldType=ref.getFieldContentsType();
VM_Field field=null;
RegisterOperand t=gc.temps.makeTemp(fieldType);
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
VM_Type ft=fieldType.peekType();
if (ft != null && ft.isClassType()) {
VM_TypeReference concreteType=FieldAnalysis.getConcreteType(field);
if (concreteType != null) {
if (concreteType == fieldType) {
t.setDeclaredType();
t.setPreciseType();
}
 else {
fieldType=concreteType;
t.setType(concreteType);
t.setPreciseType();
}
}
}
}
Operand op1=pop();
clearCurrentGuard();
if (do_NullCheck(op1)) {
break;
}
if (op1.isConstant() && field.isFinal()) {
try {
ConstantOperand rhs=StaticFieldReader.getFieldValueAsConstant(field,op1.asObjectConstant().value);
push(rhs,fieldType);
break;
}
 catch (NoSuchFieldException e) {
if (VM.runningVM) {
throw new Error("String_Node_Str",e);
}
 else {
}
}
}
s=GetField.create(GETFIELD,t,op1,offsetOp,fieldOp,getCurrentGuard());
push(t.copyD2U(),fieldType);
}
break;
case JBC_putfield:
{
VM_FieldReference ref=bcodes.getFieldReference();
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
LocationOperand fieldOp=makeInstanceFieldRef(ref);
VM_TypeReference fieldType=ref.getFieldContentsType();
Operand offsetOp;
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),fieldOp.copy()));
offsetOp=offsetrop;
rectifyStateWithErrorHandler();
}
 else {
VM_Field field=ref.peekResolvedField();
offsetOp=new AddressConstantOperand(field.getOffset());
}
Operand val=pop(fieldType);
Operand obj=popRef();
clearCurrentGuard();
if (do_NullCheck(obj)) {
break;
}
s=PutField.create(PUTFIELD,val,obj,offsetOp,fieldOp,getCurrentGuard());
}
break;
case JBC_invokevirtual:
{
VM_MethodReference ref=bcodes.getMethodReference();
if (ref.isMagic()) {
boolean generated=GenerateMagic.generateMagic(this,gc,ref);
if (generated) break;
}
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
if (ref.isMiranda()) {
s=_callHelper(ref,MethodOperand.INTERFACE(ref,null));
if (s == null) break;
Operand receiver=Call.getParam(s,0);
VM_Class receiverType=(VM_Class)receiver.getType().peekType();
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
VM_Method vmeth=null;
if (receiverType != null && receiverType.isInitialized() && !receiverType.isInterface()) {
vmeth=ClassLoaderProxy.lookupMethod(receiverType,ref);
}
if (vmeth != null) {
VM_MethodReference vmethRef=vmeth.getMemberRef().asMethodReference();
MethodOperand mop=MethodOperand.VIRTUAL(vmethRef,vmeth);
if (receiver.isConstant() || (receiver.isRegister() && receiver.asRegister().isPreciseType())) {
mop.refine(vmeth,true);
}
Call.setMethod(s,mop);
boolean unresolved=vmethRef.needsDynamicLink(bcodes.getMethod());
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(vmeth.getOffset()));
}
if (maybeInlineMethod(shouldInline(s,receiver.isConstant() || (receiver.isRegister() && receiver.asRegister().isExtant())),s)) {
return;
}
}
}
 else {
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
VM_Method target=ref.peekResolvedMethod();
MethodOperand methOp=MethodOperand.VIRTUAL(ref,target);
s=_callHelper(ref,methOp);
if (s == null) break;
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
if (VM.VerifyAssertions) VM._assert(target != null);
Call.setAddress(s,new AddressConstantOperand(target.getOffset()));
}
Operand receiver=Call.getParam(s,0);
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
boolean isExtant=false;
boolean isPreciseType=false;
VM_TypeReference tr=null;
if (receiver.isRegister()) {
RegisterOperand rop=receiver.asRegister();
isExtant=rop.isExtant();
isPreciseType=rop.isPreciseType();
tr=rop.getType();
}
 else {
isExtant=true;
isPreciseType=true;
tr=receiver.getType();
}
VM_Type type=tr.peekType();
if (type != null && type.isResolved()) {
if (type.isClassType()) {
VM_Method vmeth=target;
if (target == null || type != target.getDeclaringClass()) {
vmeth=ClassLoaderProxy.lookupMethod(type.asClass(),ref);
}
if (vmeth != null) {
methOp.refine(vmeth,isPreciseType || type.asClass().isFinal());
}
}
 else {
if (VM.VerifyAssertions) VM._assert(target != null,"String_Node_Str");
methOp.refine(target,true);
}
}
if (maybeInlineMethod(shouldInline(s,isExtant),s)) {
return;
}
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_invokespecial:
{
VM_MethodReference ref=bcodes.getMethodReference();
VM_Method target=ref.resolveInvokeSpecial();
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
s=_callHelper(ref,MethodOperand.SPECIAL(ref,target));
if (s == null) break;
if (target == null) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(target.getOffset()));
}
Operand receiver=Call.getParam(s,0);
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
if (maybeInlineMethod(shouldInline(s,false),s)) {
return;
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_invokestatic:
{
VM_MethodReference ref=bcodes.getMethodReference();
if (ref.isMagic()) {
boolean generated=GenerateMagic.generateMagic(this,gc,ref);
if (generated) break;
}
boolean unresolved=ref.needsDynamicLink(bcodes.getMethod());
VM_Method target=ref.peekResolvedMethod();
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
s=_callHelper(ref,MethodOperand.STATIC(ref,target));
if (s == null) break;
if (Call.conforms(s)) {
MethodOperand methOp=Call.getMethod(s);
if (methOp.getTarget() == target) {
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(target.getOffset()));
}
if (maybeInlineMethod(shouldInline(s,false),s)) {
return;
}
}
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_invokeinterface:
{
VM_MethodReference ref=bcodes.getMethodReference();
bcodes.alignInvokeInterface();
VM_Method resolvedMethod=null;
resolvedMethod=ref.peekInterfaceMethod();
if (this.osrGuardedInline) {
lastOsrBarrier=_createOsrBarrier();
}
s=_callHelper(ref,MethodOperand.INTERFACE(ref,resolvedMethod));
if (s == null) break;
Operand receiver=Call.getParam(s,0);
VM_Class receiverType=(VM_Class)receiver.getType().peekType();
clearCurrentGuard();
if (do_NullCheck(receiver)) {
s=null;
break;
}
Call.setGuard(s,getCurrentGuard());
boolean requiresImplementsTest=VM.BuildForIMTInterfaceInvocation;
if (requiresImplementsTest) {
if (resolvedMethod == null) {
RegisterOperand tibPtr=gc.temps.makeTemp(VM_TypeReference.TIB);
Instruction getTib=GuardedUnary.create(GET_OBJ_TIB,tibPtr,receiver.copy(),getCurrentGuard());
appendInstruction(getTib);
getTib.bcIndex=RUNTIME_SERVICES_BCI;
VM_Method target=VM_Entrypoints.unresolvedInvokeinterfaceImplementsTestMethod;
Instruction callCheck=Call.create2(CALL,null,new AddressConstantOperand(target.getOffset()),MethodOperand.STATIC(target),new IntConstantOperand(ref.getId()),tibPtr.copyD2U());
if (gc.options.NO_CALLEE_EXCEPTIONS) {
callCheck.markAsNonPEI();
}
appendInstruction(callCheck);
callCheck.bcIndex=RUNTIME_SERVICES_BCI;
requiresImplementsTest=false;
rectifyStateWithErrorHandler();
}
 else {
VM_Type interfaceType=resolvedMethod.getDeclaringClass();
if (receiverType != null && receiverType.isResolved() && !receiverType.isInterface()) {
byte doesImplement=ClassLoaderProxy.includesType(interfaceType.getTypeRef(),receiverType.getTypeRef());
requiresImplementsTest=doesImplement != YES;
}
}
}
VM_Method vmeth=null;
if (receiverType != null && receiverType.isInitialized() && !receiverType.isInterface()) {
vmeth=ClassLoaderProxy.lookupMethod(receiverType,ref);
}
if (vmeth != null) {
VM_MethodReference vmethRef=vmeth.getMemberRef().asMethodReference();
if (requiresImplementsTest) {
RegisterOperand checkedReceiver=gc.temps.makeTemp(receiver);
appendInstruction(TypeCheck.create(MUST_IMPLEMENT_INTERFACE,checkedReceiver,receiver.copy(),makeTypeOperand(resolvedMethod.getDeclaringClass()),getCurrentGuard()));
checkedReceiver.refine(resolvedMethod.getDeclaringClass().getTypeRef());
Call.setParam(s,0,checkedReceiver.copyRO());
receiver=checkedReceiver;
rectifyStateWithErrorHandler();
}
MethodOperand mop=MethodOperand.VIRTUAL(vmethRef,vmeth);
if (receiver.isConstant() || receiver.asRegister().isPreciseType()) {
mop.refine(vmeth,true);
}
Call.setMethod(s,mop);
boolean unresolved=vmethRef.needsDynamicLink(bcodes.getMethod());
if (unresolved) {
RegisterOperand offsetrop=gc.temps.makeTempOffset();
appendInstruction(Unary.create(RESOLVE_MEMBER,offsetrop.copyRO(),Call.getMethod(s).copy()));
Call.setAddress(s,offsetrop);
rectifyStateWithErrorHandler();
}
 else {
Call.setAddress(s,new AddressConstantOperand(vmeth.getOffset()));
}
if (maybeInlineMethod(shouldInline(s,receiver.isConstant() || receiver.asRegister().isExtant()),s)) {
return;
}
}
 else {
if (resolvedMethod != null && maybeInlineMethod(shouldInline(s,false),s)) {
return;
}
 else {
if (requiresImplementsTest) {
RegisterOperand checkedReceiver=gc.temps.makeTemp(receiver);
appendInstruction(TypeCheck.create(MUST_IMPLEMENT_INTERFACE,checkedReceiver,receiver.copy(),makeTypeOperand(resolvedMethod.getDeclaringClass()),getCurrentGuard()));
checkedReceiver.refine(resolvedMethod.getDeclaringClass().getTypeRef());
Call.setParam(s,0,checkedReceiver.copyRO());
}
}
}
rectifyStateWithExceptionHandlers();
}
break;
case JBC_xxxunusedxxx:
OptimizingCompilerException.UNREACHABLE();
break;
case JBC_new:
{
VM_TypeReference klass=bcodes.getTypeReference();
RegisterOperand t=gc.temps.makeTemp(klass);
t.setPreciseType();
markGuardlessNonNull(t);
Operator operator;
TypeOperand klassOp;
VM_Class klassType=(VM_Class)klass.peekType();
if (klassType != null && (klassType.isInitialized() || klassType.isInBootImage())) {
klassOp=makeTypeOperand(klassType);
operator=NEW;
t.setExtant();
}
 else {
operator=NEW_UNRESOLVED;
klassOp=makeTypeOperand(klass);
}
s=New.create(operator,t,klassOp);
push(t.copyD2U());
rectifyStateWithErrorHandler();
}
break;
case JBC_newarray:
{
VM_Type array=bcodes.getPrimitiveArrayType();
TypeOperand arrayOp=makeTypeOperand(array);
RegisterOperand t=gc.temps.makeTemp(array.getTypeRef());
t.setPreciseType();
t.setExtant();
markGuardlessNonNull(t);
s=NewArray.create(NEWARRAY,t,arrayOp,popInt());
push(t.copyD2U());
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangNegativeArraySizeException);
}
break;
case JBC_anewarray:
{
VM_TypeReference elementTypeRef=bcodes.getTypeReference();
s=generateAnewarray(null,elementTypeRef);
}
break;
case JBC_arraylength:
{
Operand op1=pop();
clearCurrentGuard();
if (do_NullCheck(op1)) {
break;
}
if (VM.VerifyAssertions) {
VM._assert(getArrayTypeOf(op1).isArrayType());
}
RegisterOperand t=gc.temps.makeTempInt();
s=GuardedUnary.create(ARRAYLENGTH,t,op1,getCurrentGuard());
push(t.copyD2U());
}
break;
case JBC_athrow:
{
Operand op0=pop();
clearCurrentGuard();
if (do_NullCheck(op0)) {
break;
}
VM_TypeReference type=getRefTypeOf(op0);
if (VM.VerifyAssertions) assertIsAssignable(VM_TypeReference.JavaLangThrowable,type);
if (!gc.method.isInterruptible()) {
appendInstruction(Empty.create(UNINT_END));
}
endOfBasicBlock=true;
BasicBlock definiteTarget=rectifyStateWithExceptionHandler(type,true);
if (definiteTarget != null) {
appendInstruction(CacheOp.create(SET_CAUGHT_EXCEPTION,op0));
s=Goto.create(GOTO,definiteTarget.makeJumpTarget());
definiteTarget.setExceptionHandlerWithNormalIn();
}
 else {
s=Athrow.create(ATHROW,op0);
}
}
break;
case JBC_checkcast:
{
VM_TypeReference typeRef=bcodes.getTypeReference();
boolean classLoading=couldCauseClassLoading(typeRef);
Operand op2=pop();
if (typeRef.isWordType()) {
op2=op2.copy();
if (op2 instanceof RegisterOperand) {
((RegisterOperand)op2).setType(typeRef);
}
push(op2);
if (DBG_CF) db("String_Node_Str" + typeRef);
break;
}
if (VM.VerifyAssertions) VM._assert(op2.isRef());
if (CF_CHECKCAST && !classLoading) {
if (op2.isDefinitelyNull()) {
push(op2);
if (DBG_CF) db("String_Node_Str");
break;
}
VM_TypeReference type=getRefTypeOf(op2);
if (ClassLoaderProxy.includesType(typeRef,type) == YES) {
push(op2);
if (DBG_CF) {
db("String_Node_Str" + op2 + "String_Node_Str"+ typeRef+ "String_Node_Str"+ type);
}
break;
}
}
RegisterOperand refinedOp2=gc.temps.makeTemp(op2);
if (!gc.options.NO_CHECKCAST) {
if (classLoading) {
s=TypeCheck.create(CHECKCAST_UNRESOLVED,refinedOp2,op2.copy(),makeTypeOperand(typeRef));
}
 else {
TypeOperand typeOp=makeTypeOperand(typeRef.peekType());
if (isNonNull(op2)) {
s=TypeCheck.create(CHECKCAST_NOTNULL,refinedOp2,op2.copy(),typeOp,getGuard(op2));
}
 else {
s=TypeCheck.create(CHECKCAST,refinedOp2,op2.copy(),typeOp);
}
}
}
refinedOp2.refine(typeRef);
push(refinedOp2.copyRO());
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangClassCastException);
if (classLoading) rectifyStateWithErrorHandler();
}
break;
case JBC_instanceof:
{
VM_TypeReference typeRef=bcodes.getTypeReference();
boolean classLoading=couldCauseClassLoading(typeRef);
Operand op2=pop();
if (VM.VerifyAssertions) VM._assert(op2.isRef());
if (CF_INSTANCEOF && !classLoading) {
if (op2.isDefinitelyNull()) {
push(new IntConstantOperand(0));
if (DBG_CF) db("String_Node_Str");
break;
}
VM_TypeReference type=getRefTypeOf(op2);
int answer=ClassLoaderProxy.includesType(typeRef,type);
if (answer == YES && isNonNull(op2)) {
push(new IntConstantOperand(1));
if (DBG_CF) {
db(op2 + "String_Node_Str" + typeRef+ "String_Node_Str");
}
break;
}
 else if (answer == NO) {
if (DBG_CF) {
db(op2 + "String_Node_Str" + typeRef+ "String_Node_Str");
}
push(new IntConstantOperand(0));
break;
}
}
RegisterOperand t=gc.temps.makeTempInt();
if (classLoading) {
s=InstanceOf.create(INSTANCEOF_UNRESOLVED,t,makeTypeOperand(typeRef),op2);
}
 else {
TypeOperand typeOp=makeTypeOperand(typeRef.peekType());
if (isNonNull(op2)) {
s=InstanceOf.create(INSTANCEOF_NOTNULL,t,typeOp,op2,getGuard(op2));
}
 else {
s=InstanceOf.create(INSTANCEOF,t,typeOp,op2);
}
}
push(t.copyD2U());
if (classLoading) rectifyStateWithErrorHandler();
}
break;
case JBC_monitorenter:
{
Operand op0=pop();
clearCurrentGuard();
if (do_NullCheck(op0)) {
break;
}
if (VM.VerifyAssertions) VM._assert(op0.isRef());
if (gc.options.MONITOR_NOP) {
s=null;
}
 else {
s=MonitorOp.create(MONITORENTER,op0,getCurrentGuard());
}
}
break;
case JBC_monitorexit:
{
Operand op0=pop();
clearCurrentGuard();
if (do_NullCheck(op0)) {
break;
}
if (gc.options.MONITOR_NOP) {
s=null;
}
 else {
s=MonitorOp.create(MONITOREXIT,op0,getCurrentGuard());
}
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangIllegalMonitorStateException);
}
break;
case JBC_wide:
{
int widecode=bcodes.getWideOpcode();
int index=bcodes.getWideLocalNumber();
switch (widecode) {
case JBC_iload:
s=do_iload(index);
break;
case JBC_lload:
s=do_lload(index);
break;
case JBC_fload:
s=do_fload(index);
break;
case JBC_dload:
s=do_dload(index);
break;
case JBC_aload:
s=do_aload(index);
break;
case JBC_istore:
s=do_store(index,popInt());
break;
case JBC_lstore:
s=do_store(index,popLong());
break;
case JBC_fstore:
s=do_store(index,popFloat());
break;
case JBC_dstore:
s=do_store(index,popDouble());
break;
case JBC_astore:
s=do_astore(index);
break;
case JBC_iinc:
s=do_iinc(index,bcodes.getWideIncrement());
break;
case JBC_ret:
s=_retHelper(index);
break;
default :
OptimizingCompilerException.UNREACHABLE();
break;
}
}
break;
case JBC_multianewarray:
{
VM_TypeReference arrayType=bcodes.getTypeReference();
int dimensions=bcodes.getArrayDimension();
if (dimensions == 1) {
s=generateAnewarray(arrayType,null);
}
 else {
TypeOperand typeOp=makeTypeOperand(arrayType);
RegisterOperand result=gc.temps.makeTemp(arrayType);
markGuardlessNonNull(result);
result.setPreciseType();
VM_TypeReference innermostElementTypeRef=arrayType.getInnermostElementType();
VM_Type innermostElementType=innermostElementTypeRef.peekType();
if (innermostElementType != null && (innermostElementType.isInitialized() || innermostElementType.isInBootImage())) {
result.setExtant();
}
s=Multianewarray.create(NEWOBJMULTIARRAY,result,typeOp,dimensions);
for (int i=0; i < dimensions; i++) {
Multianewarray.setDimension(s,dimensions - i - 1,popInt());
}
push(result.copyD2U());
rectifyStateWithErrorHandler();
rectifyStateWithExceptionHandler(VM_TypeReference.JavaLangNegativeArraySizeException);
}
}
break;
case JBC_ifnull:
s=_refIfNullHelper(ConditionOperand.EQUAL());
break;
case JBC_ifnonnull:
s=_refIfNullHelper(ConditionOperand.NOT_EQUAL());
break;
case JBC_goto_w:
{
int offset=bcodes.getWideBranchOffset();
if (offset != 5) {
s=_gotoHelper(offset);
}
}
break;
case JBC_jsr_w:
s=_jsrHelper(bcodes.getWideBranchOffset());
break;
case JBC_impdep1:
{
if (VM.BuildForAdaptiveSystem) {
int pseudo_opcode=bcodes.nextPseudoInstruction();
switch (pseudo_opcode) {
case PSEUDO_LoadIntConst:
{
int value=bcodes.readIntConst();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
push(new IntConstantOperand(value));
param1=param2;
param2=value;
break;
}
case PSEUDO_LoadLongConst:
{
long value=bcodes.readLongConst();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
pushDual(new LongConstantOperand(value,Offset.zero()));
break;
}
case PSEUDO_LoadWordConst:
{
Address a=(VM.BuildFor32Addr) ? Address.fromIntSignExtend(bcodes.readIntConst()) : Address.fromLong(bcodes.readLongConst());
push(new AddressConstantOperand(a));
if (VM.TraceOnStackReplacement) {
VM.sysWrite("String_Node_Str");
}
VM.sysWrite(a);
VM.sysWriteln();
break;
}
case PSEUDO_LoadFloatConst:
{
int ibits=bcodes.readIntConst();
float value=Float.intBitsToFloat(ibits);
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
push(new FloatConstantOperand(value,Offset.zero()));
break;
}
case PSEUDO_LoadDoubleConst:
{
long lbits=bcodes.readLongConst();
double value=VM_Magic.longBitsAsDouble(lbits);
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + lbits);
}
pushDual(new DoubleConstantOperand(value,Offset.zero()));
break;
}
case PSEUDO_LoadRetAddrConst:
{
int value=bcodes.readIntConst();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + value);
}
push(new ReturnAddressOperand(value));
break;
}
case PSEUDO_InvokeStatic:
{
VM_Method meth=null;
int targetidx=bcodes.readIntConst();
switch (targetidx) {
case GETREFAT:
meth=VM_AosEntrypoints.osrGetRefAtMethod;
break;
case CLEANREFS:
meth=VM_AosEntrypoints.osrCleanRefsMethod;
break;
default :
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + targetidx);
}
OptimizingCompilerException.UNREACHABLE();
break;
}
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + meth + "String_Node_Str");
}
s=_callHelper(meth.getMemberRef().asMethodReference(),MethodOperand.STATIC(meth));
if (s == null) break;
Call.setAddress(s,new AddressConstantOperand(meth.getOffset()));
if (targetidx == GETREFAT) {
Object realObj=OSR_ObjectHolder.getRefAt(param1,param2);
if (VM.VerifyAssertions) VM._assert(realObj != null);
VM_TypeReference klass=VM_Magic.getObjectType(realObj).getTypeRef();
RegisterOperand op0=gc.temps.makeTemp(klass);
Call.setResult(s,op0);
pop();
push(op0.copyD2U(),klass);
}
rectifyStateWithExceptionHandlers();
break;
}
case PSEUDO_InvokeCompiledMethod:
{
int cmid=bcodes.readIntConst();
int origBCIdx=bcodes.readIntConst();
VM_CompiledMethod cm=VM_CompiledMethods.getCompiledMethod(cmid);
VM_Method meth=cm.getMethod();
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + meth + "String_Node_Str");
}
s=_callHelper(meth.getMemberRef().asMethodReference(),MethodOperand.COMPILED(meth,cm.getOsrJTOCoffset()));
if (s == null) break;
s.bcIndex=origBCIdx + bciAdjustment;
rectifyStateWithExceptionHandlers();
break;
}
case PSEUDO_ParamInitEnd:
{
break;
}
default :
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("String_Node_Str" + pseudo_opcode);
}
OptimizingCompilerException.UNREACHABLE();
break;
}
break;
}
 else {
OptimizingCompilerException.UNREACHABLE();
}
}
default :
OptimizingCompilerException.UNREACHABLE();
break;
}
if (s != null && !currentBBLE.isSelfRegen()) {
appendInstruction(s);
}
if (VM.VerifyAssertions) VM._assert(bcodes.index() <= runoff);
if (!endOfBasicBlock && bcodes.index() == runoff) {
if (DBG_BB || DBG_SELECTED) {
db("String_Node_Str" + currentBBLE + "String_Node_Str"+ runoff);
}
endOfBasicBlock=fallThrough=true;
}
if (endOfBasicBlock) {
if (currentBBLE.isSelfRegen()) {
currentBBLE.block.deleteOut();
if (DBG_CFG || DBG_SELECTED) {
db("String_Node_Str" + currentBBLE.block);
}
return;
}
if (fallThrough) {
if (VM.VerifyAssertions) VM._assert(bcodes.index() < bcodes.length());
currentBBLE.fallThrough=getOrCreateBlock(bcodes.index());
currentBBLE.block.insertOut(currentBBLE.fallThrough.block);
}
return;
}
}
}