@Override public Backend getHostBackend() { return GraalSupport.getRuntimeConfig().getBackendForNormalMethod(); }
@Override public <T extends Architecture> Backend getBackend(Class<T> arch) { assert arch.isInstance(GraalSupport.getRuntimeConfig().getBackendForNormalMethod().getTarget().arch); return GraalSupport.getRuntimeConfig().getBackendForNormalMethod(); } }
public static Suites createFirstTierSuites(FeatureHandler featureHandler, RuntimeConfiguration runtimeConfig, SnippetReflectionProvider snippetReflection, boolean hosted) { SubstrateBackend backend = runtimeConfig.getBackendForNormalMethod(); OptionValues options = hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton(); Suites suites = GraalConfiguration.instance().createFirstTierSuites(options, hosted); return modifySuites(backend, suites, featureHandler, runtimeConfig, snippetReflection, hosted, true); }
public static Suites createSuites(FeatureHandler featureHandler, RuntimeConfiguration runtimeConfig, SnippetReflectionProvider snippetReflection, boolean hosted) { SubstrateBackend backend = runtimeConfig.getBackendForNormalMethod(); OptionValues options = hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton(); Suites suites = GraalConfiguration.instance().createSuites(options, hosted); return modifySuites(backend, suites, featureHandler, runtimeConfig, snippetReflection, hosted, false); }
public CompileFunction createCustomCompileFunction() { return (debug, method, identifier, reason, config) -> { SubstrateBackend backend = config.getBackendForNormalMethod(); VMError.guarantee(backend.getTarget().arch instanceof AMD64, "currently only implemented on AMD64"); // Determine register for jmethodID argument HostedProviders providers = (HostedProviders) config.getProviders(); List<JavaType> parameters = new ArrayList<>(); parameters.add(providers.getMetaAccess().lookupJavaType(JNIEnvironment.class)); parameters.add(providers.getMetaAccess().lookupJavaType(JNIObjectHandle.class)); if (nonVirtual) { parameters.add(providers.getMetaAccess().lookupJavaType(JNIObjectHandle.class)); } parameters.add(providers.getMetaAccess().lookupJavaType(JNIMethodId.class)); ResolvedJavaType returnType = providers.getWordTypes().getWordImplType(); CallingConvention callingConvention = backend.getCodeCache().getRegisterConfig().getCallingConvention( SubstrateCallingConventionType.NativeCall, returnType, parameters.toArray(new JavaType[0]), backend); RegisterValue methodIdArg = (RegisterValue) callingConvention.getArgument(parameters.size() - 1); return backend.createJNITrampolineMethod(method, identifier, methodIdArg, getFieldOffset(providers)); }; }
@Platforms(Platform.HOSTED_ONLY.class) public static void setRuntimeConfig(RuntimeConfiguration runtimeConfig, Suites suites, LIRSuites lirSuites, Suites firstTierSuites, LIRSuites firstTierLirSuites) { get().runtimeConfig = runtimeConfig; get().suites = suites; get().lirSuites = lirSuites; get().firstTierSuites = firstTierSuites; get().firstTierLirSuites = firstTierLirSuites; get().firstTierProviders = runtimeConfig.getBackendForNormalMethod().getProviders(); }
@Platforms(Platform.HOSTED_ONLY.class) @Override public SubstrateTruffleCompiler newTruffleCompiler() { GraalFeature graalFeature = ImageSingletons.lookup(GraalFeature.class); SnippetReflectionProvider snippetReflectionProvider = graalFeature.getHostedProviders().getSnippetReflection(); return new SubstrateTruffleCompiler(this, graalFeature.getHostedProviders().getGraphBuilderPlugins(), GraalSupport.getSuites(), GraalSupport.getLIRSuites(), GraalSupport.getRuntimeConfig().getBackendForNormalMethod(), GraalSupport.getFirstTierSuites(), GraalSupport.getFirstTierLirSuites(), GraalSupport.getFirstTierProviders(), snippetReflectionProvider); }
@Platforms(Platform.HOSTED_ONLY.class) public SubstrateTruffleCompiler initTruffleCompiler() { assert truffleCompiler == null : "Cannot re-initialize Substrate TruffleCompiler"; GraalFeature graalFeature = ImageSingletons.lookup(GraalFeature.class); SnippetReflectionProvider snippetReflection = graalFeature.getHostedProviders().getSnippetReflection(); SubstrateTruffleCompiler compiler = new SubstrateTruffleCompiler(this, graalFeature.getHostedProviders().getGraphBuilderPlugins(), GraalSupport.getSuites(), GraalSupport.getLIRSuites(), GraalSupport.getRuntimeConfig().getBackendForNormalMethod(), GraalSupport.getFirstTierSuites(), GraalSupport.getFirstTierLirSuites(), GraalSupport.getFirstTierProviders(), snippetReflection); truffleCompiler = compiler; return compiler; }
OptionValues options = hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton(); Providers runtimeCallProviders = runtimeConfig != null ? runtimeConfig.getBackendForNormalMethod().getProviders() : providers; SubstrateForeignCallsProvider foreignCallsProvider = (SubstrateForeignCallsProvider) providers.getForeignCalls(); for (SubstrateForeignCallDescriptor descriptor : SnippetRuntime.getRuntimeCalls()) {