type = getTypeRefFromClass(klass).resolve();
type = VM_TypeReference.findOrCreate(klass).resolve();
  public static OPT_ConstantOperand getStaticFieldValue(VM_Field field)     throws NoSuchFieldException {    if (VM.VerifyAssertions) VM._assert(field.isStatic());    VM_TypeReference fieldType = field.getType();    Offset off = field.getOffset();    if (fieldType == VM_TypeReference.Address) {      Object obj = getObjectStaticFieldValue(field);      Address val = (VM.runningVM) ? VM_Magic.objectAsAddress(obj) : (Address) obj;      return new OPT_AddressConstantOperand(val);    } else if (fieldType == VM_TypeReference.Word) {      Object obj = getObjectStaticFieldValue(field);      Word val = (VM.runningVM) ? VM_Magic.objectAsAddress(obj).toWord() : (Word) obj;      return new OPT_AddressConstantOperand(val.toAddress());    } else if (fieldType == VM_TypeReference.Offset) {      Object obj = getObjectStaticFieldValue(field);      Word val = (VM.runningVM) ? VM_Magic.objectAsAddress(obj).toWord() : ((Offset) obj).toWord();      return new OPT_AddressConstantOperand(val.toAddress());    } else if (fieldType == VM_TypeReference.Extent) {      Object obj = getObjectStaticFieldValue(field);      Word val = (VM.runningVM) ? VM_Magic.objectAsAddress(obj).toWord() : ((Extent) obj).toWord();      return new OPT_AddressConstantOperand(val.toAddress());    } else if (fieldType.isIntLikeType()) {      int val = getIntStaticFieldValue(field);      return new OPT_IntConstantOperand(val);    } else if (fieldType.isLongType()) {      long val = getLongStaticFieldValue(field);      return new OPT_LongConstantOperand(val, off);    } else if (fieldType.isFloatType()) {      float val = getFloatStaticFieldValue(field);      return new OPT_FloatConstantOperand(val, off);    } else if (fieldType.isDoubleType()) {      double val = getDoubleStaticFieldValue(field);      return new OPT_DoubleConstantOperand(val, off);    } else { // Reference type      if (VM.VerifyAssertions) VM._assert(fieldType.isReferenceType());      Object val = getObjectStaticFieldValue(field);      if (val == null) {        return new OPT_NullConstantOperand();      } else if (fieldType == VM_TypeReference.JavaLangString) {        return new OPT_StringConstantOperand((String)val, off);      } else if (fieldType == VM_TypeReference.JavaLangClass) {        Class klass = (Class)getObjectStaticFieldValue(field);        VM_Type type;        if (VM.runningVM) {          type = java.lang.JikesRVMSupport.getTypeForClass(klass);        } else {          type = getTypeRefFromClass(klass).resolve();        }        return new OPT_ClassConstantOperand(type.getClassForType(), off);      } else {        return new OPT_ObjectConstantOperand(val, off);      }    }  }