use of com.oracle.svm.core.graal.meta.SubstrateRegisterConfig.ConfigKind 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());
}
}
use of com.oracle.svm.core.graal.meta.SubstrateRegisterConfig.ConfigKind in project graal by oracle.
the class SharedRuntimeConfigurationBuilder method build.
public SharedRuntimeConfigurationBuilder build() {
EnumMap<ConfigKind, RegisterConfig> registerConfigs = new EnumMap<>(ConfigKind.class);
for (ConfigKind config : ConfigKind.values()) {
registerConfigs.put(config, ImageSingletons.lookup(SubstrateRegisterConfigFactory.class).newRegisterFactory(config, metaAccess, ConfigurationValues.getTarget(), SubstrateOptions.PreserveFramePointer.getValue()));
}
wordTypes = new SubstrateWordTypes(metaAccess, FrameAccess.getWordKind());
Providers p = createProviders(null, null, null, null, null, null, null, null, null, null, null);
StampProvider stampProvider = createStampProvider(p);
p = createProviders(null, null, null, null, null, null, stampProvider, null, null, null, null);
ConstantReflectionProvider constantReflection = createConstantReflectionProvider(p);
p = createProviders(null, constantReflection, null, null, null, null, stampProvider, null, null, null, null);
ConstantFieldProvider constantFieldProvider = createConstantFieldProvider(p);
SnippetReflectionProvider snippetReflection = createSnippetReflectionProvider();
ForeignCallsProvider foreignCalls = createForeignCallsProvider(registerConfigs.get(ConfigKind.NORMAL));
p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, null, null, stampProvider, snippetReflection, null, null, null);
BarrierSet barrierSet = ImageSingletons.lookup(Heap.class).createBarrierSet(metaAccess);
PlatformConfigurationProvider platformConfig = new SubstratePlatformConfigurationProvider(barrierSet);
MetaAccessExtensionProvider metaAccessExtensionProvider = new SubstrateMetaAccessExtensionProvider();
p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, null, null, stampProvider, snippetReflection, platformConfig, metaAccessExtensionProvider, null);
LoweringProvider lowerer = createLoweringProvider(p);
p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, lowerer, null, stampProvider, snippetReflection, platformConfig, metaAccessExtensionProvider, null);
Replacements replacements = createReplacements(p, snippetReflection);
p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, snippetReflection, platformConfig, metaAccessExtensionProvider, null);
LoopsDataProvider loopsDataProvider = originalLoopsDataProvider;
p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, snippetReflection, platformConfig, metaAccessExtensionProvider, loopsDataProvider);
EnumMap<ConfigKind, SubstrateBackend> backends = new EnumMap<>(ConfigKind.class);
for (ConfigKind config : ConfigKind.values()) {
CodeCacheProvider codeCacheProvider = createCodeCacheProvider(registerConfigs.get(config));
Providers newProviders = createProviders(codeCacheProvider, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, snippetReflection, platformConfig, metaAccessExtensionProvider, loopsDataProvider);
backends.put(config, GraalConfiguration.runtimeInstance().createBackend(newProviders));
}
runtimeConfig = new RuntimeConfiguration(p, snippetReflection, backends, wordTypes);
return this;
}
use of com.oracle.svm.core.graal.meta.SubstrateRegisterConfig.ConfigKind 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());
}
}
Aggregations