case PUTSTATIC_opcode:case PUTSTATIC_UNRESOLVED_opcode:
case PUTSTATIC_opcode:
  static void convert (OPT_IR ir, OPT_Options options) {    for (OPT_Instruction s = ir.firstInstructionInCodeOrder(); 	 s != null; 	 s = s.nextInstructionInCodeOrder()) {      switch (s.getOpcode()) {      case GETSTATIC_opcode:case GETSTATIC_UNRESOLVED_opcode:	{	  OPT_LocationOperand loc = GetStatic.getClearLocation(s);	  VM_Field field = loc.field;	  OPT_RegisterOperand result = GetStatic.getClearResult(s);	  OPT_Operand address = ir.regpool.makeJTOCOp(ir,s);	  OPT_Operand offset;	  if (s.operator() == GETSTATIC_UNRESOLVED) {	    offset = resolve(loc, s, ir, false);	  } else {	    offset = I(field.getOffset());	  }	  Load.mutate(s, OPT_IRTools.getLoadOp(field), result, 		      address, offset, loc);	}      break;      case PUTSTATIC_opcode:case PUTSTATIC_UNRESOLVED_opcode:	{	  OPT_LocationOperand loc = PutStatic.getClearLocation(s);	  VM_Field field = loc.field;	  OPT_Operand value = PutStatic.getClearValue(s);	  OPT_Operand address = ir.regpool.makeJTOCOp(ir,s);	  OPT_Operand offset;	  if (s.operator() == PUTSTATIC_UNRESOLVED) {	    offset = resolve(loc, s, ir, false);	  } else {	    offset = I(field.getOffset());	  }	  Store.mutate(s, OPT_IRTools.getStoreOp(field), value, 		       address, offset, loc);	}      break;      case PUTFIELD_opcode:case PUTFIELD_UNRESOLVED_opcode:	{	  OPT_LocationOperand loc = PutField.getClearLocation(s);	  VM_Field field = loc.field;	  OPT_Operand value = PutField.getClearValue(s);	  OPT_Operand address = PutField.getClearRef(s);	  OPT_Operand offset;	  if (s.operator() == PUTFIELD_UNRESOLVED) {	    // when executing this code, the object is non-null and therefore	    // the object MUST exist so the offset MUST be valid.	    // TODO: However as a short-term fix for dynamic linking with	    //       dummy references we pretend the offset might actually	    //       be invalid to give us an easy hook to resolve the 	    //       reference and find the real field declaration.	    offset = resolve(loc, s, ir, false);	  } else {	    offset = I(field.getOffset());	  }	  Store.mutate(s, OPT_IRTools.getStoreOp(field), value, 		       address, offset, loc, PutField.getClearGuard(s));	}      break;      case GETFIELD_opcode:case GETFIELD_UNRESOLVED_opcode:	{	  OPT_LocationOperand loc = GetField.getClearLocation(s);	  VM_Field field = loc.field;	  OPT_RegisterOperand result = GetField.getClearResult(s);	  OPT_Operand address = GetField.getClearRef(s);	  OPT_Operand offset;	  if (s.operator() == GETFIELD_UNRESOLVED) {	    // when executing this code, the object is non-null and therefore	    // the object MUST exist so the offset MUST be valid.	    // TODO: However as a short-term fix for dynamic linking with	    //       dummy references we pretend the offset might actually	    //       be invalid to give us an easy hook to resolve the 	    //       reference and find the real field declaration.	    offset = resolve(loc, s, ir, false);	  } else {	    offset = I(field.getOffset());	  }	  Load.mutate(s, OPT_IRTools.getLoadOp(field), result, 		      address, offset, loc, GetField.getClearGuard(s));	}      break;      case INT_ALOAD_opcode:	doArrayLoad(s, ir, INT_LOAD, 2);	break;      case LONG_ALOAD_opcode:	doArrayLoad(s, ir, LONG_LOAD, 3);	break;      case FLOAT_ALOAD_opcode:	doArrayLoad(s, ir, FLOAT_LOAD, 2);	break;      case DOUBLE_ALOAD_opcode:	doArrayLoad(s, ir, DOUBLE_LOAD, 3);	break;      case REF_ALOAD_opcode:	doArrayLoad(s, ir, REF_LOAD, 2);	break;      case BYTE_ALOAD_opcode:	doArrayLoad(s, ir, BYTE_LOAD, 0);	break;      case UBYTE_ALOAD_opcode:	doArrayLoad(s, ir, UBYTE_LOAD, 0);	break;      case USHORT_ALOAD_opcode:	doArrayLoad(s, ir, USHORT_LOAD, 1);	break;      case SHORT_ALOAD_opcode:	doArrayLoad(s, ir, SHORT_LOAD, 1);	break;      case INT_ASTORE_opcode:	doArrayStore(s, ir, INT_STORE, 2);	break;      case LONG_ASTORE_opcode:	doArrayStore(s, ir, LONG_STORE, 3);	break;      case FLOAT_ASTORE_opcode:	doArrayStore(s, ir, FLOAT_STORE, 2);	break;      case DOUBLE_ASTORE_opcode:	doArrayStore(s, ir, DOUBLE_STORE, 3);	break;      case REF_ASTORE_opcode:	doArrayStore(s, ir, REF_STORE, 2);	break;      case BYTE_ASTORE_opcode:	doArrayStore(s, ir, BYTE_STORE, 0);	break;      case SHORT_ASTORE_opcode:	doArrayStore(s, ir, SHORT_STORE, 1);	break;	// Calls      case CALL_opcode:	s = call(s, ir);	break;      case SYSCALL_opcode:	OPT_CallingConvention.expandSysCall(s, ir);	break;      case TABLESWITCH_opcode:	s = tableswitch(s, ir);	break;      case LOOKUPSWITCH_opcode:	s = lookup(s, ir);	break;      case OBJARRAY_STORE_CHECK_opcode:	s = OPT_DynamicTypeCheckExpansion.arrayStoreCheck(s, ir, true);	break;      case OBJARRAY_STORE_CHECK_NOTNULL_opcode:	s = OPT_DynamicTypeCheckExpansion.arrayStoreCheck(s, ir, false);	break;      case CHECKCAST_opcode:      case CHECKCAST_UNRESOLVED_opcode:	s = OPT_DynamicTypeCheckExpansion.checkcast(s, ir);	break;      case CHECKCAST_NOTNULL_opcode:	s = OPT_DynamicTypeCheckExpansion.checkcastNotNull(s, ir);	break;      case MUST_IMPLEMENT_INTERFACE_opcode:	s = OPT_DynamicTypeCheckExpansion.mustImplementInterface(s, ir);	break;      case IG_CLASS_TEST_opcode:	IfCmp.mutate(s, INT_IFCMP, null, 		     getTIB(s, ir, 			    InlineGuard.getClearValue(s), 			    InlineGuard.getClearGuard(s)), 		     getTIB(s, ir, InlineGuard.getGoal(s).asType()), 		     OPT_ConditionOperand.NOT_EQUAL(), 		     InlineGuard.getClearTarget(s),		     InlineGuard.getClearBranchProfile(s));	break;      case IG_METHOD_TEST_opcode:	{	  OPT_MethodOperand methOp = InlineGuard.getClearGoal(s).asMethod();	  OPT_RegisterOperand t1 = 	    getTIB(s, ir, 		   InlineGuard.getClearValue(s), 		   InlineGuard.getClearGuard(s));	  OPT_RegisterOperand t2 = 	    getTIB(s, ir, methOp.method.getDeclaringClass());	  IfCmp.mutate(s, INT_IFCMP, null, 		       getInstanceMethod(s, ir, t1, methOp), 		       getInstanceMethod(s, ir, t2, methOp), 		       OPT_ConditionOperand.NOT_EQUAL(), 		       InlineGuard.getClearTarget(s),		       InlineGuard.getClearBranchProfile(s));	  break;	}	      case INSTANCEOF_opcode:      case INSTANCEOF_UNRESOLVED_opcode:	s = OPT_DynamicTypeCheckExpansion.instanceOf(s, ir);	break;      case INSTANCEOF_NOTNULL_opcode:	s = OPT_DynamicTypeCheckExpansion.instanceOfNotNull(s, ir);	break;      case INT_ZERO_CHECK_opcode:	{	  TrapIf.mutate(s, TRAP_IF, 			ZeroCheck.getClearGuardResult(s),			ZeroCheck.getClearValue(s), I(0), 			OPT_ConditionOperand.EQUAL(), 			OPT_TrapCodeOperand.DivByZero());	}	break;      case LONG_ZERO_CHECK_opcode:	{	  TrapIf.mutate(s, TRAP_IF, 			ZeroCheck.getClearGuardResult(s),			ZeroCheck.getClearValue(s), I(0), 			OPT_ConditionOperand.EQUAL(), 			OPT_TrapCodeOperand.DivByZero());	}	break;      case BOUNDS_CHECK_opcode:	{	  // get array_length from array_ref	  OPT_RegisterOperand array_length = 	    InsertGuardedUnary(s, ir, ARRAYLENGTH, VM_Type.IntType, 			       BoundsCheck.getClearRef(s), 			       BoundsCheck.getClearGuard(s));	  //  In UN-signed comparison, a negative index will look like a very	  //  large positive number, greater than array length.	  //  Thus length LLT index is false iff 0 <= index <= length	  TrapIf.mutate(s, TRAP_IF, 			BoundsCheck.getClearGuardResult(s),			array_length.copyD2U(), 			BoundsCheck.getClearIndex(s), 			OPT_ConditionOperand.LOWER_EQUAL(), 			OPT_TrapCodeOperand.ArrayBounds());	}	break;      case GET_CLASS_OBJECT_opcode:	{	  OPT_RegisterOperand TIB = 	    getTIB(s, ir, (OPT_TypeOperand)Unary.getClearVal(s));	  OPT_RegisterOperand type = 	    ir.regpool.makeTemp(OPT_ClassLoaderProxy.VM_Type_type);	  s.insertBefore(Unary.create(GET_TYPE_FROM_TIB, type, TIB));	  // Get the java.lang.Class object from the VM_Type object	  // TODO: Valid location operand?	  Load.mutate(s, REF_LOAD, Unary.getClearResult(s), type.copyD2U(), 		      I(VM_Entrypoints.classForTypeField.getOffset()), null);	}	break;      default:	break;      }    }  }