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


Java ResolvedJavaMethod.canBeInlined方法代码示例

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


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

示例1: shouldInlineInvoke

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
@Override
public InlineInfo shouldInlineInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args) {
    // @formatter:off
    if (method.hasBytecodes() &&
        method.getDeclaringClass().isLinked() &&
        method.canBeInlined()) {

        // Test force inlining first
        if (method.shouldBeInlined()) {
            return createStandardInlineInfo(method);
        }

        if (!method.isSynchronized() &&
            checkSize(method, args, b.getGraph()) &&
            b.getDepth() < InlineDuringParsingMaxDepth.getValue(b.getOptions())) {
            return createStandardInlineInfo(method);
        }
    }
    // @formatter:on
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:InlineDuringParsingPlugin.java

示例2: checkTargetConditionsHelper

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
private String checkTargetConditionsHelper(ResolvedJavaMethod method, int invokeBci) {
    OptionValues options = rootGraph.getOptions();
    if (method == null) {
        return "the method is not resolved";
    } else if (method.isNative() && (!Intrinsify.getValue(options) || !InliningUtil.canIntrinsify(context.getReplacements(), method, invokeBci))) {
        return "it is a non-intrinsic native method";
    } else if (method.isAbstract()) {
        return "it is an abstract method";
    } else if (!method.getDeclaringClass().isInitialized()) {
        return "the method's class is not initialized";
    } else if (!method.canBeInlined()) {
        return "it is marked non-inlinable";
    } else if (countRecursiveInlining(method) > MaximumRecursiveInlining.getValue(options)) {
        return "it exceeds the maximum recursive inlining depth";
    } else {
        if (new OptimisticOptimizations(rootGraph.getProfilingInfo(method), options).lessOptimisticThan(context.getOptimisticOptimizations())) {
            return "the callee uses less optimistic optimizations than caller";
        } else {
            return null;
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:InliningData.java

示例3: tryInline

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * Try to inline a method. If the method was inlined, returns {@link #SUCCESSFULLY_INLINED}.
 * Otherwise, it returns the {@link InlineInfo} that lead to the decision to not inline it, or
 * {@code null} if there is no {@link InlineInfo} for this method.
 */
private InlineInfo tryInline(ValueNode[] args, ResolvedJavaMethod targetMethod) {
    boolean canBeInlined = forceInliningEverything || parsingIntrinsic() || targetMethod.canBeInlined();
    if (!canBeInlined) {
        return null;
    }

    if (forceInliningEverything) {
        if (inline(targetMethod, targetMethod, null, args)) {
            return SUCCESSFULLY_INLINED;
        } else {
            return null;
        }
    }

    for (InlineInvokePlugin plugin : graphBuilderConfig.getPlugins().getInlineInvokePlugins()) {
        InlineInfo inlineInfo = plugin.shouldInlineInvoke(this, targetMethod, args);
        if (inlineInfo != null) {
            if (inlineInfo.getMethodToInline() != null) {
                if (inline(targetMethod, inlineInfo.getMethodToInline(), inlineInfo.getIntrinsicBytecodeProvider(), args)) {
                    return SUCCESSFULLY_INLINED;
                }
                inlineInfo = null;
            }
            /* Do not inline, and do not ask the remaining plugins. */
            return inlineInfo;
        }
    }

    // There was no inline plugin with a definite answer to whether or not
    // to inline. If we're parsing an intrinsic, then we need to enforce the
    // invariant here that methods are always force inlined in intrinsics/snippets.
    if (parsingIntrinsic()) {
        if (inline(targetMethod, targetMethod, this.bytecodeProvider, args)) {
            return SUCCESSFULLY_INLINED;
        }
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:44,代码来源:BytecodeParser.java


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