Search in sources :

Example 1 with HotSpotPlatformConfigurationProvider

use of org.graalvm.compiler.hotspot.meta.HotSpotPlatformConfigurationProvider in project graal by oracle.

the class HotSpotBackendFactory method createBackend.

@SuppressWarnings("try")
public final HotSpotBackend createBackend(HotSpotGraalRuntimeProvider graalRuntime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntime jvmciRuntime, HotSpotBackend host) {
    assert host == null;
    OptionValues options = graalRuntime.getOptions();
    JVMCIBackend jvmci = jvmciRuntime.getHostJVMCIBackend();
    GraalHotSpotVMConfig config = graalRuntime.getVMConfig();
    if (IS_BUILDING_NATIVE_IMAGE || IS_IN_NATIVE_IMAGE) {
        SnippetSignature.initPrimitiveKindCache(jvmci.getMetaAccess());
    }
    HotSpotCodeCacheProvider codeCache = (HotSpotCodeCacheProvider) jvmci.getCodeCache();
    TargetDescription target = codeCache.getTarget();
    MetaAccessProvider metaAccess = new HotSpotSnippetMetaAccessProvider(jvmci.getMetaAccess());
    HotSpotConstantReflectionProvider constantReflection = (HotSpotConstantReflectionProvider) jvmci.getConstantReflection();
    ConstantFieldProvider constantFieldProvider = new HotSpotGraalConstantFieldProvider(config, metaAccess);
    HotSpotProviders providers;
    try (InitTimer t = timer("create providers")) {
        HotSpotRegistersProvider registers;
        try (InitTimer rt = timer("create HotSpotRegisters provider")) {
            registers = createRegisters();
        }
        Value[] nativeABICallerSaveRegisters;
        try (InitTimer rt = timer("create NativeABICallerSaveRegisters")) {
            nativeABICallerSaveRegisters = createNativeABICallerSaveRegisters(config, codeCache.getRegisterConfig());
        }
        HotSpotWordTypes wordTypes;
        try (InitTimer rt = timer("create WordTypes")) {
            wordTypes = createWordTypes(metaAccess, target);
        }
        HotSpotHostForeignCallsProvider foreignCalls;
        try (InitTimer rt = timer("create ForeignCalls provider")) {
            foreignCalls = createForeignCalls(jvmciRuntime, graalRuntime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters);
        }
        HotSpotPlatformConfigurationProvider platformConfigurationProvider;
        try (InitTimer rt = timer("create platform configuration provider")) {
            platformConfigurationProvider = createConfigInfoProvider(config, metaAccess);
        }
        HotSpotMetaAccessExtensionProvider metaAccessExtensionProvider;
        try (InitTimer rt = timer("create MetaAccessExtensionProvider")) {
            metaAccessExtensionProvider = createMetaAccessExtensionProvider();
        }
        HotSpotStampProvider stampProvider;
        try (InitTimer rt = timer("create stamp provider")) {
            stampProvider = createStampProvider();
        }
        HotSpotLoweringProvider lowerer;
        try (InitTimer rt = timer("create Lowerer provider")) {
            lowerer = createLowerer(graalRuntime, metaAccess, foreignCalls, registers, constantReflection, platformConfigurationProvider, metaAccessExtensionProvider, target);
        }
        LoopsDataProvider loopsDataProvider;
        try (InitTimer rt = timer("create loopsdata provider")) {
            loopsDataProvider = createLoopsDataProvider();
        }
        HotSpotSnippetReflectionProvider snippetReflection;
        try (InitTimer rt = timer("create SnippetReflection provider")) {
            snippetReflection = createSnippetReflection(graalRuntime, constantReflection, wordTypes);
        }
        BytecodeProvider bytecodeProvider;
        try (InitTimer rt = timer("create Bytecode provider")) {
            bytecodeProvider = createBytecodeProvider(metaAccess, snippetReflection);
        }
        providers = new HotSpotProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, null, null, registers, snippetReflection, wordTypes, stampProvider, platformConfigurationProvider, metaAccessExtensionProvider, loopsDataProvider, config);
        HotSpotReplacementsImpl replacements;
        try (InitTimer rt = timer("create Replacements provider")) {
            replacements = createReplacements(target, providers, snippetReflection, bytecodeProvider);
            providers = replacements.getProviders();
            replacements.maybeInitializeEncoder();
        }
        GraphBuilderConfiguration.Plugins plugins;
        try (InitTimer rt = timer("create GraphBuilderPhase plugins")) {
            plugins = createGraphBuilderPlugins(graalRuntime, compilerConfiguration, config, target, constantReflection, foreignCalls, metaAccess, snippetReflection, replacements, wordTypes, options);
            replacements.setGraphBuilderPlugins(plugins);
        }
        try (InitTimer rt = timer("create Suites provider")) {
            HotSpotSuitesProvider suites = createSuites(config, graalRuntime, compilerConfiguration, plugins, registers, replacements, options);
            providers.setSuites(suites);
        }
        assert replacements == replacements.getProviders().getReplacements();
        assert providers.getGraphBuilderPlugins() == plugins;
    }
    try (InitTimer rt = timer("instantiate backend")) {
        return createBackend(config, graalRuntime, providers);
    }
}
Also used : InitTimer(jdk.vm.ci.common.InitTimer) OptionValues(org.graalvm.compiler.options.OptionValues) JVMCIBackend(jdk.vm.ci.runtime.JVMCIBackend) TargetDescription(jdk.vm.ci.code.TargetDescription) HotSpotProviders(org.graalvm.compiler.hotspot.meta.HotSpotProviders) HotSpotPlatformConfigurationProvider(org.graalvm.compiler.hotspot.meta.HotSpotPlatformConfigurationProvider) HotSpotMetaAccessExtensionProvider(org.graalvm.compiler.hotspot.meta.HotSpotMetaAccessExtensionProvider) HotSpotRegistersProvider(org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider) HotSpotSuitesProvider(org.graalvm.compiler.hotspot.meta.HotSpotSuitesProvider) HotSpotStampProvider(org.graalvm.compiler.hotspot.meta.HotSpotStampProvider) HotSpotHostForeignCallsProvider(org.graalvm.compiler.hotspot.meta.HotSpotHostForeignCallsProvider) HotSpotCodeCacheProvider(jdk.vm.ci.hotspot.HotSpotCodeCacheProvider) GraphBuilderConfiguration(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration) BytecodeProvider(org.graalvm.compiler.bytecode.BytecodeProvider) ClassfileBytecodeProvider(org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider) HotSpotSnippetReflectionProvider(org.graalvm.compiler.hotspot.meta.HotSpotSnippetReflectionProvider) HotSpotWordTypes(org.graalvm.compiler.hotspot.word.HotSpotWordTypes) HotSpotLoweringProvider(org.graalvm.compiler.hotspot.meta.HotSpotLoweringProvider) LoopsDataProvider(org.graalvm.compiler.nodes.spi.LoopsDataProvider) Value(jdk.vm.ci.meta.Value) HotSpotConstantReflectionProvider(jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider) HotSpotGraalConstantFieldProvider(org.graalvm.compiler.hotspot.meta.HotSpotGraalConstantFieldProvider) MetaAccessProvider(jdk.vm.ci.meta.MetaAccessProvider) HotSpotGraalConstantFieldProvider(org.graalvm.compiler.hotspot.meta.HotSpotGraalConstantFieldProvider) ConstantFieldProvider(org.graalvm.compiler.core.common.spi.ConstantFieldProvider)

Aggregations

TargetDescription (jdk.vm.ci.code.TargetDescription)1 InitTimer (jdk.vm.ci.common.InitTimer)1 HotSpotCodeCacheProvider (jdk.vm.ci.hotspot.HotSpotCodeCacheProvider)1 HotSpotConstantReflectionProvider (jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider)1 MetaAccessProvider (jdk.vm.ci.meta.MetaAccessProvider)1 Value (jdk.vm.ci.meta.Value)1 JVMCIBackend (jdk.vm.ci.runtime.JVMCIBackend)1 BytecodeProvider (org.graalvm.compiler.bytecode.BytecodeProvider)1 ConstantFieldProvider (org.graalvm.compiler.core.common.spi.ConstantFieldProvider)1 HotSpotGraalConstantFieldProvider (org.graalvm.compiler.hotspot.meta.HotSpotGraalConstantFieldProvider)1 HotSpotHostForeignCallsProvider (org.graalvm.compiler.hotspot.meta.HotSpotHostForeignCallsProvider)1 HotSpotLoweringProvider (org.graalvm.compiler.hotspot.meta.HotSpotLoweringProvider)1 HotSpotMetaAccessExtensionProvider (org.graalvm.compiler.hotspot.meta.HotSpotMetaAccessExtensionProvider)1 HotSpotPlatformConfigurationProvider (org.graalvm.compiler.hotspot.meta.HotSpotPlatformConfigurationProvider)1 HotSpotProviders (org.graalvm.compiler.hotspot.meta.HotSpotProviders)1 HotSpotRegistersProvider (org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider)1 HotSpotSnippetReflectionProvider (org.graalvm.compiler.hotspot.meta.HotSpotSnippetReflectionProvider)1 HotSpotStampProvider (org.graalvm.compiler.hotspot.meta.HotSpotStampProvider)1 HotSpotSuitesProvider (org.graalvm.compiler.hotspot.meta.HotSpotSuitesProvider)1 HotSpotWordTypes (org.graalvm.compiler.hotspot.word.HotSpotWordTypes)1