diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java @ 8458:5d0296347367

Use ServiceLoader to make installation of MethodSubstitutions extensible.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 25 Mar 2013 15:39:32 +0100
parents 8ed80723c13b
children 54f0a88e4523 ca29d921a53a
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Mon Mar 25 15:39:31 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Mon Mar 25 15:39:32 2013 +0100
@@ -152,7 +152,9 @@
                     // to be valid for the entire run of the VM.
                     Assumptions assumptions = new Assumptions(false);
                     ReplacementsInstaller installer = new HotSpotReplacementsInstaller(runtime, assumptions, runtime.getGraalRuntime().getTarget());
-                    GraalMethodSubstitutions.installIntrinsics(installer);
+                    for (ReplacementsProvider provider : ServiceLoader.loadInstalled(ReplacementsProvider.class)) {
+                        provider.installReplacements(installer);
+                    }
                     runtime.installReplacements(graalRuntime.getBackend(), installer, assumptions);
                 }
             });