return new OPT_StringConstantOperand(val, slot);
return new OPT_StringConstantOperand(val, off);
  public static OPT_ConstantOperand getStaticFieldValue(VM_Field field)     throws NoSuchFieldException {    if (VM.VerifyAssertions) VM._assert(field.isStatic());    VM_TypeReference fieldType = field.getType();    int slot = field.getOffsetAsInt() >>> LOG_BYTES_IN_INT;    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, slot);    } else if (fieldType.isFloatType()) {      float val = getFloatStaticFieldValue(field);      return new OPT_FloatConstantOperand(val, slot);    } else if (fieldType.isDoubleType()) {      double val = getDoubleStaticFieldValue(field);      return new OPT_DoubleConstantOperand(val, slot);    } else if (fieldType == VM_TypeReference.JavaLangString) {      String val = (String)getObjectStaticFieldValue(field);      return new OPT_StringConstantOperand(val, slot);    } else {      // TODO: Add array and scalar reference constant operands      throw new OPT_OptimizingCompilerException("Unsupported type " + fieldType);    }  }