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)));
}
}
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;
}
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);
}
}
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;
}
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);
}
Aggregations