sun.jvm.hotspot.oops.Symbol Java Examples

The following examples show how to use sun.jvm.hotspot.oops.Symbol. 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: ArrayTypeImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
boolean isAssignableTo(ReferenceType destType) {
    if (destType instanceof ArrayType) {
        try {
            Type destComponentType = ((ArrayType)destType).componentType();
            return isComponentAssignable(destComponentType, componentType());
        } catch (ClassNotLoadedException e) {
            // One or both component types has not yet been
            // loaded => can't assign
            return false;
        }
    } else {
        Symbol typeName = ((ReferenceTypeImpl)destType).typeNameAsSymbol();
        if (destType instanceof InterfaceType) {
            // Every array type implements java.io.Serializable and
            // java.lang.Cloneable. fixme in JVMDI-JDI, includes only
            // Cloneable but not Serializable.
            return typeName.equals(vm.javaLangCloneable()) ||
                   typeName.equals(vm.javaIoSerializable());
        } else {
            // Only valid ClassType assignee is Object
            return typeName.equals(vm.javaLangObject());
        }
    }
}
 
Example #2
Source File: ArrayTypeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
boolean isAssignableTo(ReferenceType destType) {
    if (destType instanceof ArrayType) {
        try {
            Type destComponentType = ((ArrayType)destType).componentType();
            return isComponentAssignable(destComponentType, componentType());
        } catch (ClassNotLoadedException e) {
            // One or both component types has not yet been
            // loaded => can't assign
            return false;
        }
    } else {
        Symbol typeName = ((ReferenceTypeImpl)destType).typeNameAsSymbol();
        if (destType instanceof InterfaceType) {
            // Every array type implements java.io.Serializable and
            // java.lang.Cloneable. fixme in JVMDI-JDI, includes only
            // Cloneable but not Serializable.
            return typeName.equals(vm.javaLangCloneable()) ||
                   typeName.equals(vm.javaIoSerializable());
        } else {
            // Only valid ClassType assignee is Object
            return typeName.equals(vm.javaLangObject());
        }
    }
}
 
Example #3
Source File: ArrayTypeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
boolean isAssignableTo(ReferenceType destType) {
    if (destType instanceof ArrayType) {
        try {
            Type destComponentType = ((ArrayType)destType).componentType();
            return isComponentAssignable(destComponentType, componentType());
        } catch (ClassNotLoadedException e) {
            // One or both component types has not yet been
            // loaded => can't assign
            return false;
        }
    } else {
        Symbol typeName = ((ReferenceTypeImpl)destType).typeNameAsSymbol();
        if (destType instanceof InterfaceType) {
            // Every array type implements java.io.Serializable and
            // java.lang.Cloneable. fixme in JVMDI-JDI, includes only
            // Cloneable but not Serializable.
            return typeName.equals(vm.javaLangCloneable()) ||
                   typeName.equals(vm.javaIoSerializable());
        } else {
            // Only valid ClassType assignee is Object
            return typeName.equals(vm.javaLangObject());
        }
    }
}
 
Example #4
Source File: ReferenceTypeImpl.java    From jdk8u60 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 #5
Source File: ReferenceTypeImpl.java    From openjdk-jdk8u 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 #6
Source File: MethodImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private JNITypeParser getParser() {
    if (signatureParser == null) {
        Symbol sig1 = saMethod.getSignature();
        signature = sig1.asString();
        signatureParser = new JNITypeParser(signature);
    }
    return signatureParser;
}
 
Example #7
Source File: CommandProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #8
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 #9
Source File: VirtualMachineImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private synchronized List findReferenceTypes(String signature) {
    if (typesByID == null) {
        return new ArrayList(0);
    }

    // we haven't sorted types by signatures. But we can take
    // advantage of comparing symbols instead of name. In the worst
    // case, we will be comparing N addresses rather than N strings
    // where N being total no. of classes in allClasses() list.

    // The signature could be Lx/y/z; or [....
    // If it is Lx/y/z; the internal type name is x/y/x
    // for array klasses internal type name is same as
    // signature
    String typeName = null;
    if (signature.charAt(0) == 'L') {
        typeName = signature.substring(1, signature.length() - 1);
    } else {
        typeName = signature;
    }

    Symbol typeNameSym = saSymbolTable().probe(typeName);
    // if there is no symbol in VM, then we wouldn't have that type
    if (typeNameSym == null) {
        return new ArrayList(0);
    }

    Iterator iter = typesBySignature.iterator();
    List list = new ArrayList();
    while (iter.hasNext()) {
        // We have cached type name as symbol in reference type
        ReferenceTypeImpl type = (ReferenceTypeImpl)iter.next();
        if (typeNameSym.equals(type.typeNameAsSymbol())) {
            list.add(type);
        }
    }
    return list;
}
 
Example #10
Source File: FieldImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void getParser() {
    if (signatureParser == null) {
        Symbol sig1 = saField.getSignature();
        signature = sig1.asString();
        signatureParser = new JNITypeParser(signature);
    }
}
 
Example #11
Source File: CommandProcessor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #12
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #13
Source File: CommandProcessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #14
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
void printOopValue(Oop oop) {
    if (oop != null) {
        Klass k = oop.getKlass();
        Symbol s = k.getName();
        if (s != null) {
            out.print("Oop for " + s.asString() + " @ ");
        } else {
            out.print("Oop @ ");
        }
        Oop.printOopAddressOn(oop, out);
    } else {
        out.print("null");
    }
}
 
Example #15
Source File: VirtualMachineImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private synchronized List findReferenceTypes(String signature) {
    if (typesByID == null) {
        return new ArrayList(0);
    }

    // we haven't sorted types by signatures. But we can take
    // advantage of comparing symbols instead of name. In the worst
    // case, we will be comparing N addresses rather than N strings
    // where N being total no. of classes in allClasses() list.

    // The signature could be Lx/y/z; or [....
    // If it is Lx/y/z; the internal type name is x/y/x
    // for array klasses internal type name is same as
    // signature
    String typeName = null;
    if (signature.charAt(0) == 'L') {
        typeName = signature.substring(1, signature.length() - 1);
    } else {
        typeName = signature;
    }

    Symbol typeNameSym = saSymbolTable().probe(typeName);
    // if there is no symbol in VM, then we wouldn't have that type
    if (typeNameSym == null) {
        return new ArrayList(0);
    }

    Iterator iter = typesBySignature.iterator();
    List list = new ArrayList();
    while (iter.hasNext()) {
        // We have cached type name as symbol in reference type
        ReferenceTypeImpl type = (ReferenceTypeImpl)iter.next();
        if (typeNameSym.equals(type.typeNameAsSymbol())) {
            list.add(type);
        }
    }
    return list;
}
 
Example #16
Source File: FieldImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void getParser() {
    if (signatureParser == null) {
        Symbol sig1 = saField.getSignature();
        signature = sig1.asString();
        signatureParser = new JNITypeParser(signature);
    }
}
 
Example #17
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() {
            public void visit(Symbol sym) {
                sym.printValueOn(out);
                out.println();
            }
        });
}
 
Example #18
Source File: FieldImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void getParser() {
    if (signatureParser == null) {
        Symbol sig1 = saField.getSignature();
        signature = sig1.asString();
        signatureParser = new JNITypeParser(signature);
    }
}
 
Example #19
Source File: CommandProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() {
            public void visit(Symbol sym) {
                sym.printValueOn(out);
                out.println();
            }
        });
}
 
Example #20
Source File: CommandProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void printOopValue(Oop oop) {
    if (oop != null) {
        Klass k = oop.getKlass();
        Symbol s = k.getName();
        if (s != null) {
            out.print("Oop for " + s.asString() + " @ ");
        } else {
            out.print("Oop @ ");
        }
        Oop.printOopAddressOn(oop, out);
    } else {
        out.print("null");
    }
}
 
Example #21
Source File: CommandProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #22
Source File: CommandProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() {
            public void visit(Symbol sym) {
                sym.printValueOn(out);
                out.println();
            }
        });
}
 
Example #23
Source File: ReferenceTypeImpl.java    From openjdk-jdk8u-backup 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 #24
Source File: FieldImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void getParser() {
    if (signatureParser == null) {
        Symbol sig1 = saField.getSignature();
        signature = sig1.asString();
        signatureParser = new JNITypeParser(signature);
    }
}
 
Example #25
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 #26
Source File: CommandProcessor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() {
            public void visit(Symbol sym) {
                sym.printValueOn(out);
                out.println();
            }
        });
}
 
Example #27
Source File: CommandProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void printOopValue(Oop oop) {
    if (oop != null) {
        Klass k = oop.getKlass();
        Symbol s = k.getName();
        if (s != null) {
            out.print("Oop for " + s.asString() + " @ ");
        } else {
            out.print("Oop @ ");
        }
        Oop.printOopAddressOn(oop, out);
    } else {
        out.print("null");
    }
}
 
Example #28
Source File: CommandProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #29
Source File: CommandProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() {
            public void visit(Symbol sym) {
                sym.printValueOn(out);
                out.println();
            }
        });
}
 
Example #30
Source File: CommandProcessor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
void printOopValue(Oop oop) {
    if (oop != null) {
        Klass k = oop.getKlass();
        Symbol s = k.getName();
        if (s != null) {
            out.print("Oop for " + s.asString() + " @ ");
        } else {
            out.print("Oop @ ");
        }
        Oop.printOopAddressOn(oop, out);
    } else {
        out.print("null");
    }
}