本文整理汇总了Java中sun.jvm.hotspot.runtime.BasicType.T_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java BasicType.T_ARRAY属性的具体用法?Java BasicType.T_ARRAY怎么用?Java BasicType.T_ARRAY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sun.jvm.hotspot.runtime.BasicType
的用法示例。
在下文中一共展示了BasicType.T_ARRAY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSlotValue
private ValueImpl getSlotValue(StackValueCollection values,
BasicType variableType, int ss) {
ValueImpl valueImpl = null;
OopHandle handle = null;
ObjectHeap heap = vm.saObjectHeap();
if (variableType == BasicType.T_BOOLEAN) {
valueImpl = (BooleanValueImpl) vm.mirrorOf(values.booleanAt(ss));
} else if (variableType == BasicType.T_CHAR) {
valueImpl = (CharValueImpl) vm.mirrorOf(values.charAt(ss));
} else if (variableType == BasicType.T_FLOAT) {
valueImpl = (FloatValueImpl) vm.mirrorOf(values.floatAt(ss));
} else if (variableType == BasicType.T_DOUBLE) {
valueImpl = (DoubleValueImpl) vm.mirrorOf(values.doubleAt(ss));
} else if (variableType == BasicType.T_BYTE) {
valueImpl = (ByteValueImpl) vm.mirrorOf(values.byteAt(ss));
} else if (variableType == BasicType.T_SHORT) {
valueImpl = (ShortValueImpl) vm.mirrorOf(values.shortAt(ss));
} else if (variableType == BasicType.T_INT) {
valueImpl = (IntegerValueImpl) vm.mirrorOf(values.intAt(ss));
} else if (variableType == BasicType.T_LONG) {
valueImpl = (LongValueImpl) vm.mirrorOf(values.longAt(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 = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
} else if (variableType == BasicType.T_ARRAY) {
handle = values.oopHandleAt(ss);
valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
} else if (variableType == BasicType.T_VOID) {
valueImpl = new VoidValueImpl(vm);
} else {
throw new RuntimeException("Should not read here");
}
return valueImpl;
}
示例2: getValues
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;
}
示例3: getSlotValue
private ValueImpl getSlotValue(StackValueCollection values,
BasicType variableType, int ss) {
ValueImpl valueImpl = null;
OopHandle handle = null;
ObjectHeap heap = vm.saObjectHeap();
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 = (BooleanValueImpl) vm.mirrorOf(false);
} else if (variableType == BasicType.T_CHAR) {
valueImpl = (CharValueImpl) vm.mirrorOf((char)0);
} else if (variableType == BasicType.T_FLOAT) {
valueImpl = (FloatValueImpl) vm.mirrorOf((float)0);
} else if (variableType == BasicType.T_DOUBLE) {
valueImpl = (DoubleValueImpl) vm.mirrorOf((double)0);
} else if (variableType == BasicType.T_BYTE) {
valueImpl = (ByteValueImpl) vm.mirrorOf((byte)0);
} else if (variableType == BasicType.T_SHORT) {
valueImpl = (ShortValueImpl) vm.mirrorOf((short)0);
} else if (variableType == BasicType.T_INT) {
valueImpl = (IntegerValueImpl) vm.mirrorOf((int)0);
} else if (variableType == BasicType.T_LONG) {
valueImpl = (LongValueImpl) 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 = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
} else if (variableType == BasicType.T_ARRAY) {
handle = null;
valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
} else if (variableType == BasicType.T_VOID) {
valueImpl = new VoidValueImpl(vm);
} else {
throw new RuntimeException("Should not read here");
}
} else {
if (variableType == BasicType.T_BOOLEAN) {
valueImpl = (BooleanValueImpl) vm.mirrorOf(values.booleanAt(ss));
} else if (variableType == BasicType.T_CHAR) {
valueImpl = (CharValueImpl) vm.mirrorOf(values.charAt(ss));
} else if (variableType == BasicType.T_FLOAT) {
valueImpl = (FloatValueImpl) vm.mirrorOf(values.floatAt(ss));
} else if (variableType == BasicType.T_DOUBLE) {
valueImpl = (DoubleValueImpl) vm.mirrorOf(values.doubleAt(ss));
} else if (variableType == BasicType.T_BYTE) {
valueImpl = (ByteValueImpl) vm.mirrorOf(values.byteAt(ss));
} else if (variableType == BasicType.T_SHORT) {
valueImpl = (ShortValueImpl) vm.mirrorOf(values.shortAt(ss));
} else if (variableType == BasicType.T_INT) {
valueImpl = (IntegerValueImpl) vm.mirrorOf(values.intAt(ss));
} else if (variableType == BasicType.T_LONG) {
valueImpl = (LongValueImpl) vm.mirrorOf(values.longAt(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 = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
} else if (variableType == BasicType.T_ARRAY) {
handle = values.oopHandleAt(ss);
valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
} else if (variableType == BasicType.T_VOID) {
valueImpl = new VoidValueImpl(vm);
} else {
throw new RuntimeException("Should not read here");
}
}
return valueImpl;
}