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


Java JavaTypeProfile.getNotRecordedProbability方法代码示例

本文整理汇总了Java中jdk.vm.ci.meta.JavaTypeProfile.getNotRecordedProbability方法的典型用法代码示例。如果您正苦于以下问题:Java JavaTypeProfile.getNotRecordedProbability方法的具体用法?Java JavaTypeProfile.getNotRecordedProbability怎么用?Java JavaTypeProfile.getNotRecordedProbability使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.vm.ci.meta.JavaTypeProfile的用法示例。


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

示例1: adjustProfileForInvocationPlugin

import jdk.vm.ci.meta.JavaTypeProfile; //导入方法依赖的package包/类
/**
 * Adjusts the profile for an indirect invocation of a virtual method for which there is an
 * intrinsic. The adjustment made by this method is to remove all types from the profile that do
 * not override {@code targetMethod}.
 *
 * @param profile the profile to adjust
 * @param targetMethod the virtual method for which there is an intrinsic
 * @return the adjusted profile or the original {@code profile} object if no adjustment was made
 */
protected JavaTypeProfile adjustProfileForInvocationPlugin(JavaTypeProfile profile, ResolvedJavaMethod targetMethod) {
    if (profile.getTypes().length > 0) {
        List<ProfiledType> retained = new ArrayList<>();
        double notRecordedProbability = profile.getNotRecordedProbability();
        for (ProfiledType ptype : profile.getTypes()) {
            if (!ptype.getType().resolveMethod(targetMethod, method.getDeclaringClass()).equals(targetMethod)) {
                retained.add(ptype);
            } else {
                notRecordedProbability += ptype.getProbability();
            }
        }
        if (!retained.isEmpty()) {
            if (retained.size() != profile.getTypes().length) {
                return new JavaTypeProfile(profile.getNullSeen(), notRecordedProbability, retained.toArray(new ProfiledType[retained.size()]));
            }
        } else {
            return new JavaTypeProfile(profile.getNullSeen(), notRecordedProbability, new ProfiledType[0]);
        }
    }
    return profile;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:BytecodeParser.java

示例2: makeHints

import jdk.vm.ci.meta.JavaTypeProfile; //导入方法依赖的package包/类
private static Hint[] makeHints(TypeReference targetType, JavaTypeProfile profile, double minHintHitProbability, int maxHints, Double[] hitProbability) {
    double hitProb = 0.0d;
    Hint[] hintsBuf = NO_HINTS;
    if (profile != null) {
        double notRecordedTypes = profile.getNotRecordedProbability();
        ProfiledType[] ptypes = profile.getTypes();
        if (notRecordedTypes < (1D - minHintHitProbability) && ptypes != null && ptypes.length > 0) {
            hintsBuf = new Hint[ptypes.length];
            int hintCount = 0;
            for (ProfiledType ptype : ptypes) {
                if (targetType != null) {
                    ResolvedJavaType hintType = ptype.getType();
                    hintsBuf[hintCount++] = new Hint(hintType, targetType.getType().isAssignableFrom(hintType));
                    hitProb += ptype.getProbability();
                }
                if (hintCount == maxHints) {
                    break;
                }
            }
            if (hitProb >= minHintHitProbability) {
                if (hintsBuf.length != hintCount || hintCount > maxHints) {
                    hintsBuf = Arrays.copyOf(hintsBuf, Math.min(maxHints, hintCount));
                }
            } else {
                hintsBuf = NO_HINTS;
                hitProb = 0.0d;
            }
        }
    }
    hitProbability[0] = hitProb;
    return hintsBuf;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:TypeCheckHints.java

示例3: createAnchor

import jdk.vm.ci.meta.JavaTypeProfile; //导入方法依赖的package包/类
protected AnchoringNode createAnchor(JavaTypeProfile profile) {
    if (profile == null || profile.getNotRecordedProbability() > 0.0) {
        return null;
    } else {
        return append(new ValueAnchorNode(null));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:BytecodeParser.java


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