use of org.graalvm.compiler.hotspot.meta.HotSpotMetaAccessExtensionProvider 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);
}
}
Aggregations