Java Code Examples for sun.jvm.hotspot.oops.ShortField

Following code examples demonstrate how to use sun.jvm.hotspot.oops.ShortFieldfrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use sun.jvm.hotspot.oops.ShortFieldand various code implementation of this class.

    switch (typeCode) {
      case JVM_SIGNATURE_BOOLEAN:
        out.writeBoolean(((BooleanField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_CHAR:
        out.writeChar(((CharField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_BYTE:
        out.writeByte(((ByteField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_SHORT:
        out.writeShort(((ShortField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_INT:
        out.writeInt(((IntField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_LONG:
        out.writeLong(((LongField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_FLOAT:
        out.writeFloat(((FloatField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_DOUBLE:
        out.writeDouble(((DoubleField)field).getValue(oop));
        break;
      case JVM_SIGNATURE_CLASS:
      case JVM_SIGNATURE_ARRAY: {
        if (VM.getVM().isCompressedOopsEnabled()) {
          OopHandle handle = ((NarrowOopField)field).getValueAsOopHandle(oop);
          writeObjectID(getAddressValue(handle));
        } else {
          OopHandle handle = ((OopField)field).getValueAsOopHandle(oop);
          writeObjectID(getAddressValue(handle));
        }
        break;
      }
      default:
        throw new RuntimeException("should not reach here");
    }