当前位置: 首页>>代码示例>>Java>>正文


Java BasicType类代码示例

本文整理汇总了Java中sun.jvm.hotspot.runtime.BasicType的典型用法代码示例。如果您正苦于以下问题:Java BasicType类的具体用法?Java BasicType怎么用?Java BasicType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BasicType类属于sun.jvm.hotspot.runtime包,在下文中一共展示了BasicType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: thisObject

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
public ObjectReference thisObject() {
    validateStackFrame();
    MethodImpl currentMethod = (MethodImpl)location.method();
    if (currentMethod.isStatic() || currentMethod.isNative()) {
        return null;
    }
    if (thisObject == null) {
        StackValueCollection values = saFrame.getLocals();
        if (Assert.ASSERTS_ENABLED) {
            Assert.that(values.size() > 0, "this is missing");
        }
        // 'this' at index 0.
        if (values.get(0).getType() == BasicType.getTConflict()) {
          return null;
        }
        OopHandle handle = values.oopHandleAt(0);
        ObjectHeap heap = vm.saObjectHeap();
        thisObject = vm.objectMirror(heap.newOop(handle));
    }
    return thisObject;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:22,代码来源:StackFrameImpl.java

示例2: getValues

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
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;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:22,代码来源:StackFrameImpl.java

示例3: getArgumentValues

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
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;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:22,代码来源:StackFrameImpl.java

示例4: basicType

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
public BasicType basicType() {
  switch (tag) {
  case JVM_CONSTANT_Integer :
    return BasicType.T_INT;
  case JVM_CONSTANT_Float :
    return BasicType.T_FLOAT;
  case JVM_CONSTANT_Long :
    return BasicType.T_LONG;
  case JVM_CONSTANT_Double :
    return BasicType.T_DOUBLE;

  case JVM_CONSTANT_Class :
  case JVM_CONSTANT_String :
  case JVM_CONSTANT_UnresolvedClass :
  case JVM_CONSTANT_UnresolvedClassInError :
  case JVM_CONSTANT_MethodHandleInError :
  case JVM_CONSTANT_MethodTypeInError :
  case JVM_CONSTANT_ClassIndex :
  case JVM_CONSTANT_StringIndex :
  case JVM_CONSTANT_MethodHandle :
  case JVM_CONSTANT_MethodType :
    return BasicType.T_OBJECT;
  default:
    throw new InternalError("unexpected tag: " + tag);
  }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:27,代码来源:ConstantTag.java

示例5: getArgumentValues

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
public List getArgumentValues() {
    validateStackFrame();
    StackValueCollection values = saFrame.getLocals();
    MethodImpl mmm = (MethodImpl)location.method();
    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;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:20,代码来源:StackFrameImpl.java

示例6: basicType

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
public BasicType basicType() {
  switch (tag) {
  case JVM_CONSTANT_Integer :
    return BasicType.T_INT;
  case JVM_CONSTANT_Float :
    return BasicType.T_FLOAT;
  case JVM_CONSTANT_Long :
    return BasicType.T_LONG;
  case JVM_CONSTANT_Double :
    return BasicType.T_DOUBLE;

  case JVM_CONSTANT_Class :
  case JVM_CONSTANT_String :
  case JVM_CONSTANT_UnresolvedClass :
  case JVM_CONSTANT_UnresolvedClassInError :
  case JVM_CONSTANT_ClassIndex :
  case JVM_CONSTANT_UnresolvedString :
  case JVM_CONSTANT_StringIndex :
  case JVM_CONSTANT_MethodHandle :
  case JVM_CONSTANT_MethodType :
  case JVM_CONSTANT_Object :
    return BasicType.T_OBJECT;
  default:
    throw new InternalError("unexpected tag: " + tag);
  }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:27,代码来源:ConstantTag.java

示例7: getArrayInfo

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
/** Only valid for T_ARRAY; throws unspecified exception otherwise */
public ArrayInfo getArrayInfo() {
  int index = 1;
  int dim   = 1;
  index = skipOptionalSize(signature, index);
  while (signature.getByteAt(index) == '[') {
    index++;
    dim++;
    skipOptionalSize(signature, index);
  }
  int elementType = BasicType.charToType((char) signature.getByteAt(index));
  return new ArrayInfo(dim, elementType);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:14,代码来源:FieldType.java

示例8: getSlotValue

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
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;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:38,代码来源:StackFrameImpl.java

示例9: getValues

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
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;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:56,代码来源:ArrayReferenceImpl.java

示例10: getSlotValue

import sun.jvm.hotspot.runtime.BasicType; //导入依赖的package包/类
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;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:71,代码来源:StackFrameImpl.java


注:本文中的sun.jvm.hotspot.runtime.BasicType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。