use of org.graalvm.compiler.options.OptionDescriptorsMap in project graal by oracle.
the class Target_org_graalvm_compiler_truffle_compiler_hotspot_libgraal_TruffleToLibGraalEntryPoints method duringSetup.
@Override
public void duringSetup(DuringSetupAccess access) {
JNIRuntimeAccess.JNIRuntimeAccessibilitySupport registry = ImageSingletons.lookup(JNIRuntimeAccess.JNIRuntimeAccessibilitySupport.class);
ImageClassLoader imageClassLoader = ((DuringSetupAccessImpl) access).getImageClassLoader();
registerJNIConfiguration(registry, imageClassLoader);
EconomicMap<String, OptionDescriptor> descriptors = EconomicMap.create();
for (Class<? extends OptionDescriptors> optionsClass : imageClassLoader.findSubclasses(OptionDescriptors.class, false)) {
if (!Modifier.isAbstract(optionsClass.getModifiers()) && !OptionDescriptorsMap.class.isAssignableFrom(optionsClass)) {
try {
for (OptionDescriptor d : optionsClass.getDeclaredConstructor().newInstance()) {
if (!(d.getOptionKey() instanceof HostedOptionKey)) {
descriptors.put(d.getName(), d);
}
}
} catch (ReflectiveOperationException ex) {
throw VMError.shouldNotReachHere(ex);
}
}
}
OptionsParser.setCachedOptionDescriptors(Collections.singletonList(new OptionDescriptorsMap(descriptors)));
}
Aggregations