本文整理汇总了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;
}
示例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;
}
示例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));
}
}