sun.jvm.hotspot.oops.ArrayKlass Java Examples

The following examples show how to use sun.jvm.hotspot.oops.ArrayKlass. 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: ReferenceTypeImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
List getInterfaces() {
    List myInterfaces;
    if (saKlass instanceof ArrayKlass) {
        // Actually, JLS says arrays implement Cloneable and Serializable
        // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
        // the same for consistency.
        myInterfaces = new ArrayList(0);
    } else {
        // Get a list of the sa InstanceKlass types
        List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();

        // Create a list of our InterfaceTypes
        int len = saInterfaces.size();
        myInterfaces = new ArrayList(len);
        for (int ii = 0; ii < len; ii++) {
            myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
        }
    }
    return myInterfaces;
}
 
Example #2
Source File: ReferenceTypeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
List getInterfaces() {
    List myInterfaces;
    if (saKlass instanceof ArrayKlass) {
        // Actually, JLS says arrays implement Cloneable and Serializable
        // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
        // the same for consistency.
        myInterfaces = new ArrayList(0);
    } else {
        // Get a list of the sa InstanceKlass types
        List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();

        // Create a list of our InterfaceTypes
        int len = saInterfaces.size();
        myInterfaces = new ArrayList(len);
        for (int ii = 0; ii < len; ii++) {
            myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
        }
    }
    return myInterfaces;
}
 
Example #3
Source File: VirtualMachineImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
    if (typesByID == null) {
        initReferenceTypes();
    }
    ReferenceTypeImpl newRefType = null;
    if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
        newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
    } else if (kk instanceof InstanceKlass) {
        if (kk.isInterface()) {
            newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
        } else {
            newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
        }
    } else {
        throw new RuntimeException("should not reach here:" + kk);
    }

    typesByID.put(kk, newRefType);
    typesBySignature.add(newRefType);
    return newRefType;
}
 
Example #4
Source File: ReferenceTypeImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
List getInterfaces() {
    List myInterfaces;
    if (saKlass instanceof ArrayKlass) {
        // Actually, JLS says arrays implement Cloneable and Serializable
        // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
        // the same for consistency.
        myInterfaces = new ArrayList(0);
    } else {
        // Get a list of the sa InstanceKlass types
        List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();

        // Create a list of our InterfaceTypes
        int len = saInterfaces.size();
        myInterfaces = new ArrayList(len);
        for (int ii = 0; ii < len; ii++) {
            myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
        }
    }
    return myInterfaces;
}
 
Example #5
Source File: ReferenceTypeImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
List getInterfaces() {
    List myInterfaces;
    if (saKlass instanceof ArrayKlass) {
        // Actually, JLS says arrays implement Cloneable and Serializable
        // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
        // the same for consistency.
        myInterfaces = new ArrayList(0);
    } else {
        // Get a list of the sa InstanceKlass types
        List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();

        // Create a list of our InterfaceTypes
        int len = saInterfaces.size();
        myInterfaces = new ArrayList(len);
        for (int ii = 0; ii < len; ii++) {
            myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
        }
    }
    return myInterfaces;
}
 
Example #6
Source File: VirtualMachineImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
    if (typesByID == null) {
        initReferenceTypes();
    }
    ReferenceTypeImpl newRefType = null;
    if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
        newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
    } else if (kk instanceof InstanceKlass) {
        if (kk.isInterface()) {
            newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
        } else {
            newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
        }
    } else {
        throw new RuntimeException("should not reach here:" + kk);
    }

    typesByID.put(kk, newRefType);
    typesBySignature.add(newRefType);
    return newRefType;
}
 
Example #7
Source File: VirtualMachineImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
    if (typesByID == null) {
        initReferenceTypes();
    }
    ReferenceTypeImpl newRefType = null;
    if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
        newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
    } else if (kk instanceof InstanceKlass) {
        if (kk.isInterface()) {
            newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
        } else {
            newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
        }
    } else {
        throw new RuntimeException("should not reach here:" + kk);
    }

    typesByID.put(kk, newRefType);
    typesBySignature.add(newRefType);
    return newRefType;
}
 
Example #8
Source File: VirtualMachineImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
    if (typesByID == null) {
        initReferenceTypes();
    }
    ReferenceTypeImpl newRefType = null;
    if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
        newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
    } else if (kk instanceof InstanceKlass) {
        if (kk.isInterface()) {
            newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
        } else {
            newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
        }
    } else {
        throw new RuntimeException("should not reach here:" + kk);
    }

    typesByID.put(kk, newRefType);
    typesBySignature.add(newRefType);
    return newRefType;
}
 
Example #9
Source File: ReferenceTypeImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
List getInterfaces() {
    List myInterfaces;
    if (saKlass instanceof ArrayKlass) {
        // Actually, JLS says arrays implement Cloneable and Serializable
        // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
        // the same for consistency.
        myInterfaces = new ArrayList(0);
    } else {
        // Get a list of the sa InstanceKlass types
        List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();

        // Create a list of our InterfaceTypes
        int len = saInterfaces.size();
        myInterfaces = new ArrayList(len);
        for (int ii = 0; ii < len; ii++) {
            myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
        }
    }
    return myInterfaces;
}
 
Example #10
Source File: ReferenceTypeImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
List getInterfaces() {
    List myInterfaces;
    if (saKlass instanceof ArrayKlass) {
        // Actually, JLS says arrays implement Cloneable and Serializable
        // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
        // the same for consistency.
        myInterfaces = new ArrayList(0);
    } else {
        // Get a list of the sa InstanceKlass types
        List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();

        // Create a list of our InterfaceTypes
        int len = saInterfaces.size();
        myInterfaces = new ArrayList(len);
        for (int ii = 0; ii < len; ii++) {
            myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
        }
    }
    return myInterfaces;
}
 
Example #11
Source File: VirtualMachineImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
    if (typesByID == null) {
        initReferenceTypes();
    }
    ReferenceTypeImpl newRefType = null;
    if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
        newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
    } else if (kk instanceof InstanceKlass) {
        if (kk.isInterface()) {
            newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
        } else {
            newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
        }
    } else {
        throw new RuntimeException("should not reach here:" + kk);
    }

    typesByID.put(kk, newRefType);
    typesBySignature.add(newRefType);
    return newRefType;
}
 
Example #12
Source File: VirtualMachineImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
    if (typesByID == null) {
        initReferenceTypes();
    }
    ReferenceTypeImpl newRefType = null;
    if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
        newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
    } else if (kk instanceof InstanceKlass) {
        if (kk.isInterface()) {
            newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
        } else {
            newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
        }
    } else {
        throw new RuntimeException("should not reach here:" + kk);
    }

    typesByID.put(kk, newRefType);
    typesBySignature.add(newRefType);
    return newRefType;
}
 
Example #13
Source File: ReferenceTypeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
List getInterfaces() {
    List myInterfaces;
    if (saKlass instanceof ArrayKlass) {
        // Actually, JLS says arrays implement Cloneable and Serializable
        // But, JVMDI-JDI just returns 0 interfaces for arrays. We follow
        // the same for consistency.
        myInterfaces = new ArrayList(0);
    } else {
        // Get a list of the sa InstanceKlass types
        List saInterfaces = ((InstanceKlass)saKlass).getDirectImplementedInterfaces();

        // Create a list of our InterfaceTypes
        int len = saInterfaces.size();
        myInterfaces = new ArrayList(len);
        for (int ii = 0; ii < len; ii++) {
            myInterfaces.add(new InterfaceTypeImpl(vm, (InstanceKlass)saInterfaces.get(ii)));
        }
    }
    return myInterfaces;
}
 
Example #14
Source File: VirtualMachineImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized ReferenceTypeImpl addReferenceType(Klass kk) {
    if (typesByID == null) {
        initReferenceTypes();
    }
    ReferenceTypeImpl newRefType = null;
    if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
        newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
    } else if (kk instanceof InstanceKlass) {
        if (kk.isInterface()) {
            newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
        } else {
            newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
        }
    } else {
        throw new RuntimeException("should not reach here:" + kk);
    }

    typesByID.put(kk, newRefType);
    typesBySignature.add(newRefType);
    return newRefType;
}
 
Example #15
Source File: ArrayTypeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Type componentType() throws ClassNotLoadedException {
    ArrayKlass k = (ArrayKlass) ref();
    if (k instanceof ObjArrayKlass) {
        Klass elementKlass = ((ObjArrayKlass)k).getElementKlass();
        if (elementKlass == null) {
            throw new ClassNotLoadedException(componentSignature());
        } else {
            return vm.referenceType(elementKlass);
        }
    } else {
        // It's a primitive type
        return vm.primitiveTypeMirror(signature().charAt(1));
    }
}
 
Example #16
Source File: ReferenceTypeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public String genericSignature() {
    if (saKlass instanceof ArrayKlass) {
        return null;
    } else {
        Symbol genSig = ((InstanceKlass)saKlass).getGenericSignature();
        return (genSig != null)? genSig.asString() : null;
    }
}
 
Example #17
Source File: ReferenceTypeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
String baseSourceName() throws AbsentInformationException {
  if (saKlass instanceof ArrayKlass) {
        throw new AbsentInformationException();
  }
  Symbol sym = ((InstanceKlass)saKlass).getSourceFileName();
  if (sym != null) {
      return sym.asString();
  } else {
      throw new AbsentInformationException();
  }
}
 
Example #18
Source File: ReferenceTypeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public int constantPoolCount() {
    if (!vm.canGetConstantPool()) {
        throw new UnsupportedOperationException("Cannot get constant pool");
    }
    if (saKlass instanceof ArrayKlass) {
        return 0;
    } else {
        return (int)((InstanceKlass)saKlass).getConstants().getLength();
    }
}
 
Example #19
Source File: ArrayTypeImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Type componentType() throws ClassNotLoadedException {
    ArrayKlass k = (ArrayKlass) ref();
    if (k instanceof ObjArrayKlass) {
        Klass elementKlass = ((ObjArrayKlass)k).getElementKlass();
        if (elementKlass == null) {
            throw new ClassNotLoadedException(componentSignature());
        } else {
            return vm.referenceType(elementKlass);
        }
    } else {
        // It's a primitive type
        return vm.primitiveTypeMirror(signature().charAt(1));
    }
}
 
Example #20
Source File: ReferenceTypeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public int constantPoolCount() {
    if (!vm.canGetConstantPool()) {
        throw new UnsupportedOperationException("Cannot get constant pool");
    }
    if (saKlass instanceof ArrayKlass) {
        return 0;
    } else {
        return (int)((InstanceKlass)saKlass).getConstants().getLength();
    }
}
 
Example #21
Source File: ArrayTypeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Type componentType() throws ClassNotLoadedException {
    ArrayKlass k = (ArrayKlass) ref();
    if (k instanceof ObjArrayKlass) {
        Klass elementKlass = ((ObjArrayKlass)k).getElementKlass();
        if (elementKlass == null) {
            throw new ClassNotLoadedException(componentSignature());
        } else {
            return vm.referenceType(elementKlass);
        }
    } else {
        // It's a primitive type
        return vm.primitiveTypeMirror(signature().charAt(1));
    }
}
 
Example #22
Source File: ReferenceTypeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public String genericSignature() {
    if (saKlass instanceof ArrayKlass) {
        return null;
    } else {
        Symbol genSig = ((InstanceKlass)saKlass).getGenericSignature();
        return (genSig != null)? genSig.asString() : null;
    }
}
 
Example #23
Source File: ReferenceTypeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
String baseSourceName() throws AbsentInformationException {
  if (saKlass instanceof ArrayKlass) {
        throw new AbsentInformationException();
  }
  Symbol sym = ((InstanceKlass)saKlass).getSourceFileName();
  if (sym != null) {
      return sym.asString();
  } else {
      throw new AbsentInformationException();
  }
}
 
Example #24
Source File: ReferenceTypeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public int constantPoolCount() {
    if (!vm.canGetConstantPool()) {
        throw new UnsupportedOperationException("Cannot get constant pool");
    }
    if (saKlass instanceof ArrayKlass) {
        return 0;
    } else {
        return (int)((InstanceKlass)saKlass).getConstants().getLength();
    }
}
 
Example #25
Source File: ArrayTypeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Type componentType() throws ClassNotLoadedException {
    ArrayKlass k = (ArrayKlass) ref();
    if (k instanceof ObjArrayKlass) {
        Klass elementKlass = ((ObjArrayKlass)k).getElementKlass();
        if (elementKlass == null) {
            throw new ClassNotLoadedException(componentSignature());
        } else {
            return vm.referenceType(elementKlass);
        }
    } else {
        // It's a primitive type
        return vm.primitiveTypeMirror(signature().charAt(1));
    }
}
 
Example #26
Source File: ReferenceTypeImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public String genericSignature() {
    if (saKlass instanceof ArrayKlass) {
        return null;
    } else {
        Symbol genSig = ((InstanceKlass)saKlass).getGenericSignature();
        return (genSig != null)? genSig.asString() : null;
    }
}
 
Example #27
Source File: ReferenceTypeImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
String baseSourceName() throws AbsentInformationException {
  if (saKlass instanceof ArrayKlass) {
        throw new AbsentInformationException();
  }
  Symbol sym = ((InstanceKlass)saKlass).getSourceFileName();
  if (sym != null) {
      return sym.asString();
  } else {
      throw new AbsentInformationException();
  }
}
 
Example #28
Source File: ReferenceTypeImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public int constantPoolCount() {
    if (!vm.canGetConstantPool()) {
        throw new UnsupportedOperationException("Cannot get constant pool");
    }
    if (saKlass instanceof ArrayKlass) {
        return 0;
    } else {
        return (int)((InstanceKlass)saKlass).getConstants().getLength();
    }
}
 
Example #29
Source File: ReferenceTypeImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public String genericSignature() {
    if (saKlass instanceof ArrayKlass) {
        return null;
    } else {
        Symbol genSig = ((InstanceKlass)saKlass).getGenericSignature();
        return (genSig != null)? genSig.asString() : null;
    }
}
 
Example #30
Source File: ArrayTypeImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Type componentType() throws ClassNotLoadedException {
    ArrayKlass k = (ArrayKlass) ref();
    if (k instanceof ObjArrayKlass) {
        Klass elementKlass = ((ObjArrayKlass)k).getElementKlass();
        if (elementKlass == null) {
            throw new ClassNotLoadedException(componentSignature());
        } else {
            return vm.referenceType(elementKlass);
        }
    } else {
        // It's a primitive type
        return vm.primitiveTypeMirror(signature().charAt(1));
    }
}