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


Java Symbol.equals方法代码示例

本文整理汇总了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());
        }
    }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:25,代码来源:ArrayTypeImpl.java

示例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;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:39,代码来源:VirtualMachineImpl.java


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