Re: AnonymousClassLoader in JRuby

2008-04-27 Thread Charles Oliver Nutter
Rémi Forax wrote: > I've perhaps found why there is no difference in your test. > I've re-read the code of your ruby Classoader and someting is weird, > the last instruction of the static block should be Some actual numbers now, showing difference. The test instantiates 100k new Ruby methods and

Re: AnonymousClassLoader in JRuby

2008-04-27 Thread Charles Oliver Nutter
Rémi Forax wrote: > I've perhaps found why there is no difference in your test. > I've re-read the code of your ruby Classoader and someting is weird, > the last instruction of the static block should be > > ANONYMOUS_SUPPORTED = true; > and not > ANONYMOUS_SUPPORTED = false; Good lord, you're ri

Re: AnonymousClassLoader in JRuby

2008-04-27 Thread Rémi Forax
Charles Oliver Nutter a écrit : > Rémi Forax wrote: >> In my opinion, there is one AnonymousClassloader by host class to >> share security check. > > I'm not sure I see how to use a single java.dyn.AnonymousClassLoader > to load multiple classes, since it seems to want the class bytes on > const

Re: AnonymousClassLoader in JRuby

2008-04-27 Thread Charles Oliver Nutter
Rémi Forax wrote: > In my opinion, there is one AnonymousClassloader by host class to share > security check. I'm not sure I see how to use a single java.dyn.AnonymousClassLoader to load multiple classes, since it seems to want the class bytes on construction. Looking at source now. > Else, wh

Re: AnonymousClassLoader in JRuby

2008-04-26 Thread Rémi Forax
Charles Oliver Nutter a écrit : > I've managed to wire the AnonymousClassLoader into JRuby. A patch is > attached, that will probably be rather confusing to anyone unfamiliar > with JRuby. > > ClassCache is basically a smart class-loading utility that can be used > to share loaded classes across

Re: AnonymousClassLoader in JRuby

2008-04-26 Thread Charles Oliver Nutter
Another thought occurs about how/where this would be useful. Consider it a "duh" moment for me, given that much of this work is being driven by JSR292... ACL will be incredibly useful for generating inexpensive method handles. Duh. So you have a template that represents the general way in whic

Re: AnonymousClassLoader in JRuby

2008-04-26 Thread Charles Oliver Nutter
Ok, reading back over some notes and anonk.txt I think I understand a bit better. Tell me if I'm understanding things right. java.dyn.AnonymousClassLoader is not a java.lang.ClassLoader itself. It bypasses the normal classloading chain by calling the new Unsafe method that allocates and loads a

AnonymousClassLoader in JRuby

2008-04-26 Thread Charles Oliver Nutter
I've managed to wire the AnonymousClassLoader into JRuby. A patch is attached, that will probably be rather confusing to anyone unfamiliar with JRuby. ClassCache is basically a smart class-loading utility that can be used to share loaded classes across JRuby instances without keeping hard ref