Java Code Examples for sun.jvm.hotspot.runtime.BasicType#charToBasicType()

The following examples show how to use sun.jvm.hotspot.runtime.BasicType#charToBasicType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StackFrameImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    if (mmm.isNative())
        return null;
    List argSigs = mmm.argumentSignatures();
    int count = argSigs.size();
    List res = new ArrayList(0);

    int slot = mmm.isStatic()? 0 : 1;
    for (int ii = 0; ii < count; ++slot, ++ii) {
        char sigChar = ((String)argSigs.get(ii)).charAt(0);
        BasicType variableType = BasicType.charToBasicType(sigChar);
        res.add(getSlotValue(values, variableType, slot));
        if (sigChar == 'J' || sigChar == 'D') {
            slot++;
        }
    }
    return res;
}
 
Example 2
Source File: StackFrameImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    if (mmm.isNative())
        return null;
    List argSigs = mmm.argumentSignatures();
    int count = argSigs.size();
    List res = new ArrayList(0);

    int slot = mmm.isStatic()? 0 : 1;
    for (int ii = 0; ii < count; ++slot, ++ii) {
        char sigChar = ((String)argSigs.get(ii)).charAt(0);
        BasicType variableType = BasicType.charToBasicType(sigChar);
        res.add(getSlotValue(values, variableType, slot));
        if (sigChar == 'J' || sigChar == 'D') {
            slot++;
        }
    }
    return res;
}
 
Example 3
Source File: StackFrameImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public Map getValues(List variables) {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();

    int count = variables.size();
    Map map = new HashMap(count);
    for (int ii=0; ii<count; ++ii) {
        LocalVariableImpl variable = (LocalVariableImpl)variables.get(ii);
        if (!variable.isVisible(this)) {
            throw new IllegalArgumentException(variable.name() +
                             " is not valid at this frame location");
        }
        ValueImpl valueImpl;
        int ss = variable.slot();
        char c = variable.signature().charAt(0);
        BasicType variableType = BasicType.charToBasicType(c);
        valueImpl = getSlotValue(values, variableType, ss);
        map.put(variable, valueImpl);
    }
    return map;
}
 
Example 4
Source File: StackFrameImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    if (mmm.isNative())
        return null;
    List argSigs = mmm.argumentSignatures();
    int count = argSigs.size();
    List res = new ArrayList(0);

    int slot = mmm.isStatic()? 0 : 1;
    for (int ii = 0; ii < count; ++slot, ++ii) {
        char sigChar = ((String)argSigs.get(ii)).charAt(0);
        BasicType variableType = BasicType.charToBasicType(sigChar);
        res.add(getSlotValue(values, variableType, slot));
        if (sigChar == 'J' || sigChar == 'D') {
            slot++;
        }
    }
    return res;
}
 
Example 5
Source File: StackFrameImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    if (mmm.isNative())
        return null;
    List argSigs = mmm.argumentSignatures();
    int count = argSigs.size();
    List res = new ArrayList(0);

    int slot = mmm.isStatic()? 0 : 1;
    for (int ii = 0; ii < count; ++slot, ++ii) {
        char sigChar = ((String)argSigs.get(ii)).charAt(0);
        BasicType variableType = BasicType.charToBasicType(sigChar);
        res.add(getSlotValue(values, variableType, slot));
        if (sigChar == 'J' || sigChar == 'D') {
            slot++;
        }
    }
    return res;
}
 
Example 6
Source File: StackFrameImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public Map getValues(List variables) {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();

    int count = variables.size();
    Map map = new HashMap(count);
    for (int ii=0; ii<count; ++ii) {
        LocalVariableImpl variable = (LocalVariableImpl)variables.get(ii);
        if (!variable.isVisible(this)) {
            throw new IllegalArgumentException(variable.name() +
                             " is not valid at this frame location");
        }
        ValueImpl valueImpl;
        int ss = variable.slot();
        char c = variable.signature().charAt(0);
        BasicType variableType = BasicType.charToBasicType(c);
        valueImpl = getSlotValue(values, variableType, ss);
        map.put(variable, valueImpl);
    }
    return map;
}
 
Example 7
Source File: StackFrameImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public Map getValues(List variables) {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();

    int count = variables.size();
    Map map = new HashMap(count);
    for (int ii=0; ii<count; ++ii) {
        LocalVariableImpl variable = (LocalVariableImpl)variables.get(ii);
        if (!variable.isVisible(this)) {
            throw new IllegalArgumentException(variable.name() +
                             " is not valid at this frame location");
        }
        ValueImpl valueImpl;
        int ss = variable.slot();
        char c = variable.signature().charAt(0);
        BasicType variableType = BasicType.charToBasicType(c);
        valueImpl = getSlotValue(values, variableType, ss);
        map.put(variable, valueImpl);
    }
    return map;
}
 
Example 8
Source File: StackFrameImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public Map getValues(List variables) {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();

    int count = variables.size();
    Map map = new HashMap(count);
    for (int ii=0; ii<count; ++ii) {
        LocalVariableImpl variable = (LocalVariableImpl)variables.get(ii);
        if (!variable.isVisible(this)) {
            throw new IllegalArgumentException(variable.name() +
                             " is not valid at this frame location");
        }
        ValueImpl valueImpl;
        int ss = variable.slot();
        char c = variable.signature().charAt(0);
        BasicType variableType = BasicType.charToBasicType(c);
        valueImpl = getSlotValue(values, variableType, ss);
        map.put(variable, valueImpl);
    }
    return map;
}
 
Example 9
Source File: StackFrameImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    if (mmm.isNative())
        return null;
    List argSigs = mmm.argumentSignatures();
    int count = argSigs.size();
    List res = new ArrayList(0);

    int slot = mmm.isStatic()? 0 : 1;
    for (int ii = 0; ii < count; ++slot, ++ii) {
        char sigChar = ((String)argSigs.get(ii)).charAt(0);
        BasicType variableType = BasicType.charToBasicType(sigChar);
        res.add(getSlotValue(values, variableType, slot));
        if (sigChar == 'J' || sigChar == 'D') {
            slot++;
        }
    }
    return res;
}
 
Example 10
Source File: StackFrameImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public Map getValues(List variables) {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();

    int count = variables.size();
    Map map = new HashMap(count);
    for (int ii=0; ii<count; ++ii) {
        LocalVariableImpl variable = (LocalVariableImpl)variables.get(ii);
        if (!variable.isVisible(this)) {
            throw new IllegalArgumentException(variable.name() +
                             " is not valid at this frame location");
        }
        ValueImpl valueImpl;
        int ss = variable.slot();
        char c = variable.signature().charAt(0);
        BasicType variableType = BasicType.charToBasicType(c);
        valueImpl = getSlotValue(values, variableType, ss);
        map.put(variable, valueImpl);
    }
    return map;
}
 
Example 11
Source File: StackFrameImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    if (mmm.isNative())
        return null;
    List argSigs = mmm.argumentSignatures();
    int count = argSigs.size();
    List res = new ArrayList(0);

    int slot = mmm.isStatic()? 0 : 1;
    for (int ii = 0; ii < count; ++slot, ++ii) {
        char sigChar = ((String)argSigs.get(ii)).charAt(0);
        BasicType variableType = BasicType.charToBasicType(sigChar);
        res.add(getSlotValue(values, variableType, slot));
        if (sigChar == 'J' || sigChar == 'D') {
            slot++;
        }
    }
    return res;
}
 
Example 12
Source File: StackFrameImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public Map getValues(List variables) {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();

    int count = variables.size();
    Map map = new HashMap(count);
    for (int ii=0; ii<count; ++ii) {
        LocalVariableImpl variable = (LocalVariableImpl)variables.get(ii);
        if (!variable.isVisible(this)) {
            throw new IllegalArgumentException(variable.name() +
                             " is not valid at this frame location");
        }
        ValueImpl valueImpl;
        int ss = variable.slot();
        char c = variable.signature().charAt(0);
        BasicType variableType = BasicType.charToBasicType(c);
        valueImpl = getSlotValue(values, variableType, ss);
        map.put(variable, valueImpl);
    }
    return map;
}
 
Example 13
Source File: StackFrameImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    if (mmm.isNative())
        return null;
    List argSigs = mmm.argumentSignatures();
    int count = argSigs.size();
    List res = new ArrayList(0);

    int slot = mmm.isStatic()? 0 : 1;
    for (int ii = 0; ii < count; ++slot, ++ii) {
        char sigChar = ((String)argSigs.get(ii)).charAt(0);
        BasicType variableType = BasicType.charToBasicType(sigChar);
        res.add(getSlotValue(values, variableType, slot));
        if (sigChar == 'J' || sigChar == 'D') {
            slot++;
        }
    }
    return res;
}
 
Example 14
Source File: ArrayReferenceImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public List getValues(int index, int len) {
    if (len == -1) { // -1 means the rest of the array
       len = length() - index;
    }
    validateArrayAccess(index, len);
    List vals = new ArrayList();
    if (len == 0) {
        return vals;
    }

    sun.jvm.hotspot.oops.TypeArray typeArray = null;
    sun.jvm.hotspot.oops.ObjArray objArray = null;
    if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
        typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
    } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
        objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
    } else {
        throw new RuntimeException("should not reach here");
    }

    char c = arrayType().componentSignature().charAt(0);
    BasicType variableType = BasicType.charToBasicType(c);

    final int limit = index + len;
    for (int ii = index; ii < limit; ii++) {
        ValueImpl valueImpl;
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
        } else if (variableType == BasicType.T_INT) {
            valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
        } 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.
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
        } else if (variableType == BasicType.T_ARRAY) {
            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
        } else {
            throw new RuntimeException("should not reach here");
        }
        vals.add (valueImpl);
    }
    return vals;
}
 
Example 15
Source File: ArrayReferenceImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public List getValues(int index, int len) {
    if (len == -1) { // -1 means the rest of the array
       len = length() - index;
    }
    validateArrayAccess(index, len);
    List vals = new ArrayList();
    if (len == 0) {
        return vals;
    }

    sun.jvm.hotspot.oops.TypeArray typeArray = null;
    sun.jvm.hotspot.oops.ObjArray objArray = null;
    if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
        typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
    } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
        objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
    } else {
        throw new RuntimeException("should not reach here");
    }

    char c = arrayType().componentSignature().charAt(0);
    BasicType variableType = BasicType.charToBasicType(c);

    final int limit = index + len;
    for (int ii = index; ii < limit; ii++) {
        ValueImpl valueImpl;
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
        } else if (variableType == BasicType.T_INT) {
            valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
        } 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.
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
        } else if (variableType == BasicType.T_ARRAY) {
            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
        } else {
            throw new RuntimeException("should not reach here");
        }
        vals.add (valueImpl);
    }
    return vals;
}
 
Example 16
Source File: ArrayReferenceImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public List getValues(int index, int len) {
    if (len == -1) { // -1 means the rest of the array
       len = length() - index;
    }
    validateArrayAccess(index, len);
    List vals = new ArrayList();
    if (len == 0) {
        return vals;
    }

    sun.jvm.hotspot.oops.TypeArray typeArray = null;
    sun.jvm.hotspot.oops.ObjArray objArray = null;
    if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
        typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
    } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
        objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
    } else {
        throw new RuntimeException("should not reach here");
    }

    char c = arrayType().componentSignature().charAt(0);
    BasicType variableType = BasicType.charToBasicType(c);

    final int limit = index + len;
    for (int ii = index; ii < limit; ii++) {
        ValueImpl valueImpl;
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
        } else if (variableType == BasicType.T_INT) {
            valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
        } 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.
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
        } else if (variableType == BasicType.T_ARRAY) {
            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
        } else {
            throw new RuntimeException("should not reach here");
        }
        vals.add (valueImpl);
    }
    return vals;
}
 
Example 17
Source File: ArrayReferenceImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public List getValues(int index, int len) {
    if (len == -1) { // -1 means the rest of the array
       len = length() - index;
    }
    validateArrayAccess(index, len);
    List vals = new ArrayList();
    if (len == 0) {
        return vals;
    }

    sun.jvm.hotspot.oops.TypeArray typeArray = null;
    sun.jvm.hotspot.oops.ObjArray objArray = null;
    if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
        typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
    } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
        objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
    } else {
        throw new RuntimeException("should not reach here");
    }

    char c = arrayType().componentSignature().charAt(0);
    BasicType variableType = BasicType.charToBasicType(c);

    final int limit = index + len;
    for (int ii = index; ii < limit; ii++) {
        ValueImpl valueImpl;
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
        } else if (variableType == BasicType.T_INT) {
            valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
        } 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.
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
        } else if (variableType == BasicType.T_ARRAY) {
            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
        } else {
            throw new RuntimeException("should not reach here");
        }
        vals.add (valueImpl);
    }
    return vals;
}
 
Example 18
Source File: ArrayReferenceImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public List getValues(int index, int len) {
    if (len == -1) { // -1 means the rest of the array
       len = length() - index;
    }
    validateArrayAccess(index, len);
    List vals = new ArrayList();
    if (len == 0) {
        return vals;
    }

    sun.jvm.hotspot.oops.TypeArray typeArray = null;
    sun.jvm.hotspot.oops.ObjArray objArray = null;
    if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
        typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
    } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
        objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
    } else {
        throw new RuntimeException("should not reach here");
    }

    char c = arrayType().componentSignature().charAt(0);
    BasicType variableType = BasicType.charToBasicType(c);

    final int limit = index + len;
    for (int ii = index; ii < limit; ii++) {
        ValueImpl valueImpl;
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
        } else if (variableType == BasicType.T_INT) {
            valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
        } 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.
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
        } else if (variableType == BasicType.T_ARRAY) {
            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
        } else {
            throw new RuntimeException("should not reach here");
        }
        vals.add (valueImpl);
    }
    return vals;
}
 
Example 19
Source File: ArrayReferenceImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public List getValues(int index, int len) {
    if (len == -1) { // -1 means the rest of the array
       len = length() - index;
    }
    validateArrayAccess(index, len);
    List vals = new ArrayList();
    if (len == 0) {
        return vals;
    }

    sun.jvm.hotspot.oops.TypeArray typeArray = null;
    sun.jvm.hotspot.oops.ObjArray objArray = null;
    if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
        typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
    } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
        objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
    } else {
        throw new RuntimeException("should not reach here");
    }

    char c = arrayType().componentSignature().charAt(0);
    BasicType variableType = BasicType.charToBasicType(c);

    final int limit = index + len;
    for (int ii = index; ii < limit; ii++) {
        ValueImpl valueImpl;
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
        } else if (variableType == BasicType.T_INT) {
            valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
        } 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.
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
        } else if (variableType == BasicType.T_ARRAY) {
            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
        } else {
            throw new RuntimeException("should not reach here");
        }
        vals.add (valueImpl);
    }
    return vals;
}
 
Example 20
Source File: ArrayReferenceImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public List getValues(int index, int len) {
    if (len == -1) { // -1 means the rest of the array
       len = length() - index;
    }
    validateArrayAccess(index, len);
    List vals = new ArrayList();
    if (len == 0) {
        return vals;
    }

    sun.jvm.hotspot.oops.TypeArray typeArray = null;
    sun.jvm.hotspot.oops.ObjArray objArray = null;
    if (ref() instanceof sun.jvm.hotspot.oops.TypeArray) {
        typeArray = (sun.jvm.hotspot.oops.TypeArray)ref();
    } else if (ref() instanceof sun.jvm.hotspot.oops.ObjArray) {
        objArray = (sun.jvm.hotspot.oops.ObjArray)ref();
    } else {
        throw new RuntimeException("should not reach here");
    }

    char c = arrayType().componentSignature().charAt(0);
    BasicType variableType = BasicType.charToBasicType(c);

    final int limit = index + len;
    for (int ii = index; ii < limit; ii++) {
        ValueImpl valueImpl;
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(typeArray.getBooleanAt(ii));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(typeArray.getCharAt(ii));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(typeArray.getFloatAt(ii));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl =  (DoubleValueImpl) vm.mirrorOf(typeArray.getDoubleAt(ii));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl =  (ByteValueImpl) vm.mirrorOf(typeArray.getByteAt(ii));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl =  (ShortValueImpl) vm.mirrorOf(typeArray.getShortAt(ii));
        } else if (variableType == BasicType.T_INT) {
            valueImpl =  (IntegerValueImpl) vm.mirrorOf(typeArray.getIntAt(ii));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl =  (LongValueImpl) vm.mirrorOf(typeArray.getLongAt(ii));
        } 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.
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(objArray.getObjAt(ii));
        } else if (variableType == BasicType.T_ARRAY) {
            valueImpl = (ArrayReferenceImpl) vm.arrayMirror((Array) objArray.getObjAt(ii));
        } else {
            throw new RuntimeException("should not reach here");
        }
        vals.add (valueImpl);
    }
    return vals;
}