本文整理汇总了Java中sun.jvm.hotspot.oops.Symbol.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Symbol.equals方法的具体用法?Java Symbol.equals怎么用?Java Symbol.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.jvm.hotspot.oops.Symbol
的用法示例。
在下文中一共展示了Symbol.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isAssignableTo
import sun.jvm.hotspot.oops.Symbol; //导入方法依赖的package包/类
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());
}
}
}
示例2: findReferenceTypes
import sun.jvm.hotspot.oops.Symbol; //导入方法依赖的package包/类
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;
}