當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。