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


Java HotSpotCodeCacheProvider类代码示例

本文整理汇总了Java中jdk.vm.ci.hotspot.HotSpotCodeCacheProvider的典型用法代码示例。如果您正苦于以下问题:Java HotSpotCodeCacheProvider类的具体用法?Java HotSpotCodeCacheProvider怎么用?Java HotSpotCodeCacheProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: main

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {
    HotSpotJVMCIRuntime jvmciRuntime = HotSpotJVMCIRuntime.runtime();
    HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) jvmciRuntime.getCompiler();
    HotSpotGraalRuntimeProvider graalRuntime = compiler.getGraalRuntime();
    HotSpotCodeCacheProvider codeCache = graalRuntime.getHostProviders().getCodeCache();
    OptionValues options = loadOptions(graalRuntime.getOptions());

    int iterations = Options.Iterations.getValue(options);
    for (int i = 0; i < iterations; i++) {
        codeCache.resetCompilationStatistics();
        TTY.println("CompileTheWorld : iteration " + i);

        CompileTheWorld ctw = new CompileTheWorld(jvmciRuntime, compiler, options);
        ctw.compile();
    }
    // This is required as non-daemon threads can be started by class initializers
    System.exit(0);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:CompileTheWorld.java

示例2: compileMethod

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
private CompilationResult compileMethod(ResolvedJavaMethod javaMethod, CompilationIdentifier compilationId) {
    HotSpotProviders providers = getHotSpotProviders();
    SuitesProvider suitesProvider = providers.getSuites();
    OptionValues options = getOptions();
    Suites suites = suitesProvider.getDefaultSuites(options).copy();
    LIRSuites lirSuites = suitesProvider.getDefaultLIRSuites(options);
    removeInliningPhase(suites);
    StructuredGraph graph = new StructuredGraph.Builder(options, AllowAssumptions.NO).method(javaMethod).compilationId(compilationId).build();

    MetaAccessProvider metaAccess = providers.getMetaAccess();
    Plugins plugins = new Plugins(new InvocationPlugins());
    HotSpotCodeCacheProvider codeCache = providers.getCodeCache();
    boolean infoPoints = codeCache.shouldDebugNonSafepoints();
    GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true).withNodeSourcePosition(infoPoints);
    new GraphBuilderPhase.Instance(metaAccess, providers.getStampProvider(), providers.getConstantReflection(), providers.getConstantFieldProvider(), config, OptimisticOptimizations.ALL,
                    null).apply(graph);

    PhaseSuite<HighTierContext> graphBuilderSuite = getGraphBuilderSuite(codeCache, suitesProvider);
    Backend backend = getHotSpotBackend();
    CompilationResultBuilderFactory factory = getOptimizedCallTargetInstrumentationFactory(backend.getTarget().arch.getName());
    return compileGraph(graph, javaMethod, providers, backend, graphBuilderSuite, OptimisticOptimizations.ALL, graph.getProfilingInfo(), suites, lirSuites, new CompilationResult(), factory);
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:23,代码来源:HotSpotTruffleRuntime.java

示例3: installNativeFunctionStub

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
/**
 * Creates and installs a stub for calling a native function.
 */
@SuppressWarnings("try")
void installNativeFunctionStub(HotSpotNativeFunctionHandle function) {
    Plugins plugins = new Plugins(providers.getGraphBuilderPlugins());
    plugins.prependParameterPlugin(new ConstantBindingParameterPlugin(new Object[]{function, null}, providers.getMetaAccess(), providers.getSnippetReflection()));

    PhaseSuite<HighTierContext> graphBuilder = new PhaseSuite<>();
    graphBuilder.appendPhase(new GraphBuilderPhase(GraphBuilderConfiguration.getDefault(plugins)));

    Suites suites = providers.getSuites().getDefaultSuites(options);
    LIRSuites lirSuites = providers.getSuites().getDefaultLIRSuites(options);

    StructuredGraph g = new StructuredGraph.Builder(options).method(callStubMethod).compilationId(backend.getCompilationIdentifier(callStubMethod)).build();
    CompilationResult compResult = GraalCompiler.compileGraph(g, callStubMethod, providers, backend, graphBuilder, OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites,
                    lirSuites, new CompilationResult(), CompilationResultBuilderFactory.Default);

    HotSpotCodeCacheProvider codeCache = providers.getCodeCache();
    try (Scope s = Debug.scope("CodeInstall", codeCache, g.method(), compResult)) {
        HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(codeCache, g.method(), null, compResult);
        function.code = codeCache.addCode(g.method(), compiledCode, null, null);
    } catch (Throwable e) {
        throw Debug.handle(e);
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:27,代码来源:NativeCallStubGraphBuilder.java

示例4: main

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {
    Services.exportJVMCITo(CompileTheWorld.class);
    HotSpotJVMCIRuntime jvmciRuntime = HotSpotJVMCIRuntime.runtime();
    HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) jvmciRuntime.getCompiler();
    HotSpotGraalRuntimeProvider graalRuntime = compiler.getGraalRuntime();
    HotSpotCodeCacheProvider codeCache = graalRuntime.getHostProviders().getCodeCache();
    OptionValues options = loadOptions(graalRuntime.getOptions());

    int iterations = Options.Iterations.getValue(options);
    for (int i = 0; i < iterations; i++) {
        codeCache.resetCompilationStatistics();
        TTY.println("CompileTheWorld : iteration " + i);

        CompileTheWorld ctw = new CompileTheWorld(jvmciRuntime, compiler, options);
        ctw.compile();
    }
    // This is required as non-daemon threads can be started by class initializers
    System.exit(0);
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:20,代码来源:CompileTheWorld.java

示例5: HotSpotProviders

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
public HotSpotProviders(MetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, ConstantFieldProvider constantField,
                HotSpotForeignCallsProvider foreignCalls, LoweringProvider lowerer, Replacements replacements, SuitesProvider suites,
                HotSpotRegistersProvider registers,
                SnippetReflectionProvider snippetReflection, HotSpotWordTypes wordTypes, Plugins graphBuilderPlugins) {
    super(metaAccess, codeCache, constantReflection, constantField, foreignCalls, lowerer, replacements, new HotSpotStampProvider());
    this.suites = suites;
    this.registers = registers;
    this.snippetReflection = snippetReflection;
    this.wordTypes = wordTypes;
    this.graphBuilderPlugins = graphBuilderPlugins;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:HotSpotProviders.java

示例6: notifyInstall

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public void notifyInstall(HotSpotCodeCacheProvider codeCache, InstalledCode installedCode, CompiledCode compiledCode) {
    DebugContext debug = DebugContext.forCurrentThread();
    if (debug.isDumpEnabled(DebugContext.BASIC_LEVEL)) {
        CompilationResult compResult = debug.contextLookup(CompilationResult.class);
        assert compResult != null : "can't dump installed code properly without CompilationResult";
        debug.dump(DebugContext.BASIC_LEVEL, installedCode, "After code installation");
    }
    if (debug.isLogEnabled()) {
        debug.log("%s", codeCache.disassemble(installedCode));
    }
    for (HotSpotCodeCacheListener listener : listeners) {
        listener.notifyInstall(codeCache, installedCode, compiledCode);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:HotSpotGraalVMEventListener.java

示例7: notifyInstall

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public void notifyInstall(HotSpotCodeCacheProvider codeCache, InstalledCode installedCode, CompiledCode compiledCode) {
    if (Debug.isDumpEnabled(Debug.BASIC_LEVEL)) {
        CompilationResult compResult = Debug.contextLookup(CompilationResult.class);
        assert compResult != null : "can't dump installed code properly without CompilationResult";
        Debug.dump(Debug.BASIC_LEVEL, installedCode, "After code installation");
    }
    if (Debug.isLogEnabled()) {
        Debug.log("%s", codeCache.disassemble(installedCode));
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:12,代码来源:HotSpotGraalVMEventListener.java

示例8: createForeignCalls

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected AMD64HotSpotForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess,
                HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) {
    return new AMD64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:AMD64HotSpotBackendFactory.java

示例9: createForeignCalls

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected HotSpotHostForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess,
                HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) {
    return new AArch64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:AArch64HotSpotBackendFactory.java

示例10: getCodeCache

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public HotSpotCodeCacheProvider getCodeCache() {
    return (HotSpotCodeCacheProvider) super.getCodeCache();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:HotSpotProviders.java

示例11: disassembleInstalledCode

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public String disassembleInstalledCode(CodeCacheProvider codeCache, CompilationResult compResult, InstalledCode code) {
    return ((HotSpotCodeCacheProvider) codeCache).disassemble(code);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:HotSpotDisassemblerProvider.java

示例12: createCodeCache

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) {
    return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:AArch64HotSpotJVMCIBackendFactory.java

示例13: createBackend

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection,
                StackIntrospection stackIntrospection) {
    return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:AArch64HotSpotJVMCIBackendFactory.java

示例14: createBackend

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, HotSpotConstantReflectionProvider constantReflection,
                StackIntrospection stackIntrospection) {
    return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:SPARCHotSpotJVMCIBackendFactory.java

示例15: notifyInstall

import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider,
        InstalledCode installedCode, CompiledCode compiledCode) {
    gotInstallNotification++;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:JvmciNotifyInstallEventTest.java


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