Search in sources :

Example 1 with SubstrateBackendFactory

use of com.oracle.svm.core.graal.code.SubstrateBackendFactory in project graal by oracle.

the class SubstrateAMD64Feature method afterRegistration.

@Override
public void afterRegistration(AfterRegistrationAccess access) {
    ImageSingletons.add(SubstrateRegisterConfigFactory.class, new SubstrateRegisterConfigFactory() {

        @Override
        public RegisterConfig newRegisterFactory(ConfigKind config, MetaAccessProvider metaAccess, TargetDescription target, Boolean preserveFramePointer) {
            return new SubstrateAMD64RegisterConfig(config, metaAccess, target, preserveFramePointer);
        }
    });
    ImageSingletons.add(ReservedRegisters.class, new AMD64ReservedRegisters());
    if (!SubstrateOptions.useLLVMBackend()) {
        AMD64CalleeSavedRegisters.createAndRegister();
        ImageSingletons.add(SubstrateBackendFactory.class, new SubstrateBackendFactory() {

            @Override
            public SubstrateBackend newBackend(Providers newProviders) {
                return new SubstrateAMD64Backend(newProviders);
            }
        });
        ImageSingletons.add(SubstrateLoweringProviderFactory.class, new SubstrateLoweringProviderFactory() {

            @Override
            public DefaultJavaLoweringProvider newLoweringProvider(MetaAccessProvider metaAccess, ForeignCallsProvider foreignCalls, PlatformConfigurationProvider platformConfig, MetaAccessExtensionProvider metaAccessExtensionProvider, TargetDescription target) {
                return new SubstrateAMD64LoweringProvider(metaAccess, foreignCalls, platformConfig, metaAccessExtensionProvider, target);
            }
        });
        ImageSingletons.add(TargetGraphBuilderPlugins.class, new AMD64GraphBuilderPlugins());
        ImageSingletons.add(SubstrateSuitesCreatorProvider.class, new SubstrateAMD64SuitesCreatorProvider());
    }
}
Also used : ForeignCallsProvider(org.graalvm.compiler.core.common.spi.ForeignCallsProvider) RegisterConfig(jdk.vm.ci.code.RegisterConfig) AMD64GraphBuilderPlugins(org.graalvm.compiler.replacements.amd64.AMD64GraphBuilderPlugins) TargetDescription(jdk.vm.ci.code.TargetDescription) SubstrateBackendFactory(com.oracle.svm.core.graal.code.SubstrateBackendFactory) ConfigKind(com.oracle.svm.core.graal.meta.SubstrateRegisterConfig.ConfigKind) Providers(org.graalvm.compiler.phases.util.Providers) SubstrateBackend(com.oracle.svm.core.graal.code.SubstrateBackend) MetaAccessExtensionProvider(org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider) SubstrateRegisterConfigFactory(com.oracle.svm.core.graal.code.SubstrateRegisterConfigFactory) DefaultJavaLoweringProvider(org.graalvm.compiler.replacements.DefaultJavaLoweringProvider) MetaAccessProvider(jdk.vm.ci.meta.MetaAccessProvider) SubstrateLoweringProviderFactory(com.oracle.svm.core.graal.code.SubstrateLoweringProviderFactory) PlatformConfigurationProvider(org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider)

Example 2 with SubstrateBackendFactory

use of com.oracle.svm.core.graal.code.SubstrateBackendFactory in project graal by oracle.

the class LLVMFeature method afterRegistration.

@Override
public void afterRegistration(AfterRegistrationAccess access) {
    ImageSingletons.add(SubstrateBackendFactory.class, new SubstrateBackendFactory() {

        @Override
        public SubstrateBackend newBackend(Providers newProviders) {
            return new SubstrateLLVMBackend(newProviders);
        }
    });
    ImageSingletons.add(SubstrateLoweringProviderFactory.class, SubstrateLLVMLoweringProvider::new);
    ImageSingletons.add(NativeImageCodeCacheFactory.class, new NativeImageCodeCacheFactory() {

        @Override
        public NativeImageCodeCache newCodeCache(CompileQueue compileQueue, NativeImageHeap heap, Platform platform, Path tempDir) {
            return new LLVMNativeImageCodeCache(compileQueue.getCompilations(), heap, platform, tempDir);
        }
    });
    ImageSingletons.add(ExceptionUnwind.class, LLVMExceptionUnwind.createRaiseExceptionHandler());
    ImageSingletons.add(TargetGraphBuilderPlugins.class, new LLVMGraphBuilderPlugins());
    ImageSingletons.add(SubstrateSuitesCreatorProvider.class, new SubstrateSuitesCreatorProvider());
}
Also used : Path(java.nio.file.Path) CompileQueue(com.oracle.svm.hosted.code.CompileQueue) Platform(org.graalvm.nativeimage.Platform) NativeImageHeap(com.oracle.svm.hosted.image.NativeImageHeap) NativeImageCodeCache(com.oracle.svm.hosted.image.NativeImageCodeCache) SubstrateBackendFactory(com.oracle.svm.core.graal.code.SubstrateBackendFactory) Providers(org.graalvm.compiler.phases.util.Providers) SubstrateBackend(com.oracle.svm.core.graal.code.SubstrateBackend) NativeImageCodeCacheFactory(com.oracle.svm.hosted.image.NativeImageCodeCacheFactory) SubstrateLLVMLoweringProvider(com.oracle.svm.core.graal.llvm.lowering.SubstrateLLVMLoweringProvider) SubstrateSuitesCreatorProvider(com.oracle.svm.core.graal.code.SubstrateSuitesCreatorProvider) LLVMGraphBuilderPlugins(com.oracle.svm.core.graal.llvm.replacements.LLVMGraphBuilderPlugins)

Example 3 with SubstrateBackendFactory

use of com.oracle.svm.core.graal.code.SubstrateBackendFactory in project graal by oracle.

the class SubstrateAArch64Feature method afterRegistration.

@Override
public void afterRegistration(AfterRegistrationAccess access) {
    ImageSingletons.add(SubstrateRegisterConfigFactory.class, new SubstrateRegisterConfigFactory() {

        @Override
        public RegisterConfig newRegisterFactory(ConfigKind config, MetaAccessProvider metaAccess, TargetDescription target, Boolean preserveFramePointer) {
            return new SubstrateAArch64RegisterConfig(config, metaAccess, target, preserveFramePointer);
        }
    });
    ImageSingletons.add(ReservedRegisters.class, new AArch64ReservedRegisters());
    if (!SubstrateOptions.useLLVMBackend()) {
        AArch64CalleeSavedRegisters.createAndRegister();
        ImageSingletons.add(SubstrateBackendFactory.class, new SubstrateBackendFactory() {

            @Override
            public SubstrateBackend newBackend(Providers newProviders) {
                return new SubstrateAArch64Backend(newProviders);
            }
        });
        ImageSingletons.add(SubstrateLoweringProviderFactory.class, new SubstrateLoweringProviderFactory() {

            @Override
            public DefaultJavaLoweringProvider newLoweringProvider(MetaAccessProvider metaAccess, ForeignCallsProvider foreignCalls, PlatformConfigurationProvider platformConfig, MetaAccessExtensionProvider metaAccessExtensionProvider, TargetDescription target) {
                return new SubstrateAArch64LoweringProvider(metaAccess, foreignCalls, platformConfig, metaAccessExtensionProvider, target);
            }
        });
        ImageSingletons.add(TargetGraphBuilderPlugins.class, new AArch64GraphBuilderPlugins());
        ImageSingletons.add(SubstrateSuitesCreatorProvider.class, new SubstrateAArch64SuitesCreatorProvider());
    }
}
Also used : ForeignCallsProvider(org.graalvm.compiler.core.common.spi.ForeignCallsProvider) RegisterConfig(jdk.vm.ci.code.RegisterConfig) TargetDescription(jdk.vm.ci.code.TargetDescription) SubstrateBackendFactory(com.oracle.svm.core.graal.code.SubstrateBackendFactory) ConfigKind(com.oracle.svm.core.graal.meta.SubstrateRegisterConfig.ConfigKind) Providers(org.graalvm.compiler.phases.util.Providers) SubstrateBackend(com.oracle.svm.core.graal.code.SubstrateBackend) MetaAccessExtensionProvider(org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider) AArch64GraphBuilderPlugins(org.graalvm.compiler.replacements.aarch64.AArch64GraphBuilderPlugins) SubstrateRegisterConfigFactory(com.oracle.svm.core.graal.code.SubstrateRegisterConfigFactory) DefaultJavaLoweringProvider(org.graalvm.compiler.replacements.DefaultJavaLoweringProvider) MetaAccessProvider(jdk.vm.ci.meta.MetaAccessProvider) SubstrateLoweringProviderFactory(com.oracle.svm.core.graal.code.SubstrateLoweringProviderFactory) PlatformConfigurationProvider(org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider)

Aggregations

SubstrateBackend (com.oracle.svm.core.graal.code.SubstrateBackend)3 SubstrateBackendFactory (com.oracle.svm.core.graal.code.SubstrateBackendFactory)3 Providers (org.graalvm.compiler.phases.util.Providers)3 SubstrateLoweringProviderFactory (com.oracle.svm.core.graal.code.SubstrateLoweringProviderFactory)2 SubstrateRegisterConfigFactory (com.oracle.svm.core.graal.code.SubstrateRegisterConfigFactory)2 ConfigKind (com.oracle.svm.core.graal.meta.SubstrateRegisterConfig.ConfigKind)2 RegisterConfig (jdk.vm.ci.code.RegisterConfig)2 TargetDescription (jdk.vm.ci.code.TargetDescription)2 MetaAccessProvider (jdk.vm.ci.meta.MetaAccessProvider)2 ForeignCallsProvider (org.graalvm.compiler.core.common.spi.ForeignCallsProvider)2 MetaAccessExtensionProvider (org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider)2 PlatformConfigurationProvider (org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider)2 DefaultJavaLoweringProvider (org.graalvm.compiler.replacements.DefaultJavaLoweringProvider)2 SubstrateSuitesCreatorProvider (com.oracle.svm.core.graal.code.SubstrateSuitesCreatorProvider)1 SubstrateLLVMLoweringProvider (com.oracle.svm.core.graal.llvm.lowering.SubstrateLLVMLoweringProvider)1 LLVMGraphBuilderPlugins (com.oracle.svm.core.graal.llvm.replacements.LLVMGraphBuilderPlugins)1 CompileQueue (com.oracle.svm.hosted.code.CompileQueue)1 NativeImageCodeCache (com.oracle.svm.hosted.image.NativeImageCodeCache)1 NativeImageCodeCacheFactory (com.oracle.svm.hosted.image.NativeImageCodeCacheFactory)1 NativeImageHeap (com.oracle.svm.hosted.image.NativeImageHeap)1