Le 02/02/2010 03:20, John Rose a écrit : > On Jan 31, 2010, at 11:19 PM, Charles Oliver Nutter wrote: > > >> The other use case, which I did not attempt, was in regenerating call >> sites a la the DLR's DynamicSite logic (which repeatedly regenerates a >> call site with a series of instanceof checks, to specialize the call >> paths iteratively). Again, InvokeDynamic potentially handles this >> better? >> > It is designed to do this; e.g., see section 5.3 in my VMIL paper. >
CallSite.setTarget() is your friend :) > One bit of engineering that needs investigation is how to build up DLR-style > call sites incrementally without doing quadratic recompilation work. > In general, the full adapter blob is created before the compilation is triggered. Otherwise a way to do this is to provide a specific mutable adapter : public class MethodHandles { /** create a dispatch table */ public static DispatchMethodHandle dispatchTable(MethodType type, int pos) } public class DispatchTable extends MethodHandle { public addTarget(Class<?> clazz, MethodHandle mh) { ... } } Rémi _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev