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


Java ResolvedJavaMethod.isNative方法代码示例

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


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

示例1: 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

示例2: createGraph

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
public StructuredGraph createGraph(ResolvedJavaMethod method, int entryBCI, boolean useProfilingInfo, CompilationIdentifier compilationId, OptionValues options, DebugContext debug) {
    HotSpotBackend backend = graalRuntime.getHostBackend();
    HotSpotProviders providers = backend.getProviders();
    final boolean isOSR = entryBCI != JVMCICompiler.INVOCATION_ENTRY_BCI;
    StructuredGraph graph = method.isNative() || isOSR ? null : getIntrinsicGraph(method, providers, compilationId, options, debug);

    if (graph == null) {
        SpeculationLog speculationLog = method.getSpeculationLog();
        if (speculationLog != null) {
            speculationLog.collectFailedSpeculations();
        }
        graph = new StructuredGraph.Builder(options, debug, AllowAssumptions.ifTrue(OptAssumptions.getValue(options))).method(method).entryBCI(entryBCI).speculationLog(
                        speculationLog).useProfilingInfo(useProfilingInfo).compilationId(compilationId).build();
    }
    return graph;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:HotSpotGraalCompiler.java

示例3: getCodeTest

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * @see ResolvedJavaMethod#getCode()
 */
@Test
public void getCodeTest() {
    for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) {
        ResolvedJavaMethod m = e.getValue();
        byte[] code = m.getCode();
        if (code == null) {
            assertTrue(m.getCodeSize() == 0);
        } else {
            if (m.isAbstract()) {
                assertTrue(code.length == 0);
            } else if (!m.isNative()) {
                assertTrue(code.length > 0);
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:TestResolvedJavaMethod.java

示例4: test

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
@Test
@SuppressWarnings("try")
public void test() throws ClassNotFoundException {
    HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) JVMCI.getRuntime().getCompiler();
    HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
    HotSpotProviders providers = rt.getHostBackend().getProviders();
    Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
    InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();

    EconomicMap<String, List<Binding>> bindings = invocationPlugins.getBindings(true);
    HotSpotVMConfigStore store = rt.getVMConfig().getStore();
    List<VMIntrinsicMethod> intrinsics = store.getIntrinsics();
    OptionValues options = getInitialOptions();
    DebugContext debug = getDebugContext(options);
    for (VMIntrinsicMethod intrinsic : intrinsics) {
        InvocationPlugin plugin = CheckGraalIntrinsics.findPlugin(bindings, intrinsic);
        if (plugin != null) {
            if (plugin instanceof MethodSubstitutionPlugin) {
                ResolvedJavaMethod method = CheckGraalIntrinsics.resolveIntrinsic(getMetaAccess(), intrinsic);
                if (!method.isNative()) {
                    StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, INVALID_COMPILATION_ID, options, debug);
                    getCode(method, graph);
                }
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:TestIntrinsicCompiles.java

示例5: getCodeSizeTest

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * @see ResolvedJavaMethod#getCodeSize()
 */
@Test
public void getCodeSizeTest() {
    for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) {
        ResolvedJavaMethod m = e.getValue();
        int codeSize = m.getCodeSize();
        if (m.isAbstract()) {
            assertTrue(codeSize == 0);
        } else if (!m.isNative()) {
            assertTrue(codeSize > 0);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:TestResolvedJavaMethod.java


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