On Mon, Feb 1, 2010 at 8:20 PM, John Rose <john.r...@sun.com> wrote: > 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. > > One bit of engineering that needs investigation is how to build up DLR-style > call sites incrementally without doing quadratic recompilation work.
I'll have another look and offer any suggestions I might have :) > Yes; this is probably the enduring use of anonk as it stands. > > Interestingly, I just learned (from a link on Lambda-the-ultimate) that > Microsoft just put the equivalent feature into .NET 4. It's called > Collectible Assemblies: > http://msdn.microsoft.com/en-us/library/dd554932%28VS.100%29.aspx I think this is slightly different, though it's not clear from browsing docs. CLR already had DynamicMethods, which allowed them to generate callable code bodies that could be collected once they were no longer used. Collectible Assemblies seem to be an analog to either being able to ditch a whole classloader (which we already have) or being able to dynamically generate, use, and unload a module/superpackage in the upcoming modularization stuff. I'm not really clear on why they needed this with DynamicMethod already available. The use cases they list for dynamically generating assemblies (http://msdn.microsoft.com/en-us/library/tt9483fk(VS.100).aspx) don't really clarify things for me, but they don't really sound like the use case of regenerating individual method bodies. Hmm...perhaps it's for generating whole interconnected type graphs? DynamicMethod would suite *my* needs and the needs of the DLR fine, but it wouldn't really allow you to reify an entire mostly-settled set of Ruby classes into a live type graph with more "static" call paths, or something along those lines. Any JRockit or J9 folks out there know whether your classloaders hold hard reference to loaded classes as well? In general, I believe Code Generation Cures All, but the cost of iteratively regenerating and reoptimizing code is really high without AnonymousClassloader :( Oh, and while we're at it, can we get OSR, so I can swap out methods on the fly? :) (or perhaps someone has a suggestion for how to do aggressive optimizations in e.g. JRuby but still be able to bail out if necessary with live method activations in flight) - Charlie _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev