Search in sources :

Example 6 with Platforms

use of org.graalvm.nativeimage.Platforms in project graal by oracle.

the class JNIAccessibleMethod method resolveJavaCallWrapper.

@Platforms(HOSTED_ONLY.class)
void resolveJavaCallWrapper(CompilationAccessImpl access) {
    HostedUniverse hUniverse = access.getUniverse();
    AnalysisUniverse aUniverse = access.getUniverse().getBigBang().getUniverse();
    varargsCallWrapper = MethodPointer.factory(hUniverse.lookup(aUniverse.lookup(varargsCallWrapperMethod)));
    arrayCallWrapper = MethodPointer.factory(hUniverse.lookup(aUniverse.lookup(arrayCallWrapperMethod)));
    valistCallWrapper = MethodPointer.factory(hUniverse.lookup(aUniverse.lookup(valistCallWrapperMethod)));
    if (!isStatic()) {
        varargsNonvirtualCallWrapper = MethodPointer.factory(hUniverse.lookup(aUniverse.lookup(varargsNonvirtualCallWrapperMethod)));
        arrayNonvirtualCallWrapper = MethodPointer.factory(hUniverse.lookup(aUniverse.lookup(arrayNonvirtualCallWrapperMethod)));
        valistNonvirtualCallWrapper = MethodPointer.factory(hUniverse.lookup(aUniverse.lookup(valistNonvirtualCallWrapperMethod)));
    }
}
Also used : HostedUniverse(com.oracle.svm.hosted.meta.HostedUniverse) AnalysisUniverse(com.oracle.graal.pointsto.meta.AnalysisUniverse) Platforms(org.graalvm.nativeimage.Platforms)

Example 7 with Platforms

use of org.graalvm.nativeimage.Platforms in project graal by oracle.

the class RuntimeOptionParser method updateRuntimeOptions.

@Platforms(Platform.HOSTED_ONLY.class)
public boolean updateRuntimeOptions(Set<OptionDescriptor> newRuntimeOptions) {
    boolean result = false;
    for (OptionDescriptor descriptor : newRuntimeOptions) {
        String name = descriptor.getName();
        if (!sortedOptions.containsKey(name)) {
            sortedOptions.put(name, descriptor);
            result = true;
        } else {
            assert descriptor == sortedOptions.get(name);
        }
    }
    return result;
}
Also used : OptionDescriptor(org.graalvm.compiler.options.OptionDescriptor) Platforms(org.graalvm.nativeimage.Platforms)

Example 8 with Platforms

use of org.graalvm.nativeimage.Platforms in project graal by oracle.

the class JavaNetSubstitutions method addURLStreamHandler.

@Platforms(Platform.HOSTED_ONLY.class)
static void addURLStreamHandler(String protocol) {
    try {
        Method method = URL.class.getDeclaredMethod("getURLStreamHandler", String.class);
        method.setAccessible(true);
        imageHandlers.put(protocol, (URLStreamHandler) method.invoke(null, protocol));
    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException ex) {
        throw new Error(ex);
    }
}
Also used : VMError(com.oracle.svm.core.util.VMError) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException) Platforms(org.graalvm.nativeimage.Platforms)

Example 9 with Platforms

use of org.graalvm.nativeimage.Platforms in project graal by oracle.

the class SubstratePartialEvaluator method createDecodingInvocationPlugins.

@Platforms(Platform.HOSTED_ONLY.class)
@Override
protected InvocationPlugins createDecodingInvocationPlugins(Plugins parent) {
    InvocationPlugins decodingInvocationPlugins = new InvocationPlugins();
    registerTruffleInvocationPlugins(decodingInvocationPlugins, false);
    decodingInvocationPlugins.closeRegistration();
    return decodingInvocationPlugins;
}
Also used : InvocationPlugins(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins) Platforms(org.graalvm.nativeimage.Platforms)

Example 10 with Platforms

use of org.graalvm.nativeimage.Platforms in project graal by oracle.

the class SubstrateTruffleRuntime method newTruffleCompiler.

@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(), snippetReflectionProvider);
}
Also used : SnippetReflectionProvider(org.graalvm.compiler.api.replacements.SnippetReflectionProvider) GraalFeature(com.oracle.svm.graal.hosted.GraalFeature) Platforms(org.graalvm.nativeimage.Platforms)

Aggregations

Platforms (org.graalvm.nativeimage.Platforms)10 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)3 GraalFeature (com.oracle.svm.graal.hosted.GraalFeature)2 HashMap (java.util.HashMap)2 SnippetReflectionProvider (org.graalvm.compiler.api.replacements.SnippetReflectionProvider)2 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)2 InvocationPlugins (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins)2 AnalysisUniverse (com.oracle.graal.pointsto.meta.AnalysisUniverse)1 VMError (com.oracle.svm.core.util.VMError)1 HostedUniverse (com.oracle.svm.hosted.meta.HostedUniverse)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 Map (java.util.Map)1 Snippet (org.graalvm.compiler.api.replacements.Snippet)1 UnsafeArrayTypeWriter (org.graalvm.compiler.core.common.util.UnsafeArrayTypeWriter)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 GraphEncoder (org.graalvm.compiler.nodes.GraphEncoder)1 InvocationPlugin (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin)1 MethodCallTargetNode (org.graalvm.compiler.nodes.java.MethodCallTargetNode)1 OptionDescriptor (org.graalvm.compiler.options.OptionDescriptor)1