private ValueImpl getSlotValue()

in core/src/main/java/com/jetbrains/sa/jdi/StackFrameImpl.java [147:214]


    private ValueImpl getSlotValue(StackValueCollection values, BasicType variableType, int ss) {
        ValueImpl valueImpl;
        OopHandle handle;
        if (values.get(ss).getType() == BasicType.getTConflict()) {
          // Dead locals, so just represent them as a zero of the appropriate type
          if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = vm().mirrorOf(false);
          } else if (variableType == BasicType.T_CHAR) {
            valueImpl = vm().mirrorOf((char)0);
          } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = vm().mirrorOf((float)0);
          } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl = vm().mirrorOf((double)0);
          } else if (variableType == BasicType.T_BYTE) {
            valueImpl = vm().mirrorOf((byte)0);
          } else if (variableType == BasicType.T_SHORT) {
            valueImpl = vm().mirrorOf((short)0);
          } else if (variableType == BasicType.T_INT) {
            valueImpl = vm().mirrorOf(0);
          } else if (variableType == BasicType.T_LONG) {
            valueImpl = vm().mirrorOf((long)0);
          } else if (variableType == BasicType.T_OBJECT) {
            // we may have an [Ljava/lang/Object; - i.e., Object[] with the
            // elements themselves may be arrays because every array is an Object.
            handle = null;
            valueImpl = vm().objectMirror(handle);
          } else if (variableType == BasicType.T_ARRAY) {
            handle = null;
            valueImpl = vm().objectMirror(handle);
          } else if (variableType == BasicType.T_VOID) {
            valueImpl = vm().voidVal;
          } else {
            throw new RuntimeException("Should not read here");
          }
        } else {
          if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = vm().mirrorOf(values.booleanAt(ss));
          } else if (variableType == BasicType.T_CHAR) {
            valueImpl = vm().mirrorOf(values.charAt(ss));
          } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = vm().mirrorOf(values.floatAt(ss));
          } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl = vm().mirrorOf(doubleAt(values, ss));
          } else if (variableType == BasicType.T_BYTE) {
            valueImpl = vm().mirrorOf(values.byteAt(ss));
          } else if (variableType == BasicType.T_SHORT) {
            valueImpl = vm().mirrorOf(values.shortAt(ss));
          } else if (variableType == BasicType.T_INT) {
            valueImpl = vm().mirrorOf(values.intAt(ss));
          } else if (variableType == BasicType.T_LONG) {
            valueImpl = vm().mirrorOf(longAt(values, ss));
          } else if (variableType == BasicType.T_OBJECT) {
            // we may have an [Ljava/lang/Object; - i.e., Object[] with the
            // elements themselves may be arrays because every array is an Object.
            handle = values.oopHandleAt(ss);
            valueImpl = vm().objectMirror(handle);
          } else if (variableType == BasicType.T_ARRAY) {
            handle = values.oopHandleAt(ss);
            valueImpl = vm().objectMirror(handle);
          } else if (variableType == BasicType.T_VOID) {
            valueImpl = new VoidValueImpl();
          } else {
            throw new RuntimeException("Should not read here");
          }
        }

        return valueImpl;
    }