use of org.graalvm.compiler.hotspot.HotSpotGraalCompiler in project graal by oracle.
the class TestIntrinsicCompiles method test.
@Test
@SuppressWarnings("try")
public void test() throws ClassNotFoundException {
HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) JVMCI.getRuntime().getCompiler();
HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
HotSpotProviders providers = rt.getHostBackend().getProviders();
Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
EconomicMap<String, List<Binding>> bindings = invocationPlugins.getBindings(true);
HotSpotVMConfigStore store = rt.getVMConfig().getStore();
List<VMIntrinsicMethod> intrinsics = store.getIntrinsics();
OptionValues options = getInitialOptions();
DebugContext debug = getDebugContext(options);
for (VMIntrinsicMethod intrinsic : intrinsics) {
InvocationPlugin plugin = CheckGraalIntrinsics.findPlugin(bindings, intrinsic);
if (plugin != null) {
if (plugin instanceof MethodSubstitutionPlugin) {
ResolvedJavaMethod method = CheckGraalIntrinsics.resolveIntrinsic(getMetaAccess(), intrinsic);
if (!method.isNative()) {
StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, INVALID_COMPILATION_ID, options, debug);
getCode(method, graph);
}
}
}
}
}
Aggregations