Eugene Kuleshov wrote:
>   Correct. However it is just my observation and it may also depend on
> what methods are being analyzed. I've been testing computation of
> StackMap when transforming all classes from rt.jar, and on my machine,
> with Java 6, it takes ~2.5 extra seconds to compute frames for 24,000
> classes (~2 times slower then computing max stack).
>   But, your experience may be different. So, I would recommend to take
> my comment with grain of salt and maybe do a quick time measurement of
> the performance with and without StackMap calculation. Though to
> actually see the difference you may need to generate and then load
> large number of unique classes.

I think the case for us isn't particularly dire. Even the largest Ruby 
methods will only generate several thousand bytes of bytecode, and the 
verification cost is going to pale in comparison to all the Ruby 
overhead. So it will really make a huge difference either way.

Under Java 7 anonymous classloading, however, we could be spending a lot 
more time generating and regenerating code. So we'll eventually need to 
look into the real cost.

>   Another thing I should remind about StackMap calculation in ASM is
> that ClassWriter is by default loading classes to identify if two
> given types have common super type. When transforming existing
> bytecode from within custom class loader or Java agent, this may cause
> side effects and unexpected classloading. In that case
> ClassWriter.getCommonSuperClass() need to be overwritten and
> reimplemented without using Class.forName(..), e.g. see
> org.objectweb.asm.ClassWriterComputeFramesTest that has naive non-
> caching implementation that uses ASM to extract required information
> from classes.

Ahh, that's interesting, thanks for that. For the most part JRuby's code 
generation has been designed to work as little islands, with no compiled 
script having references to any code outside JRuby proper. So I think 
that's probably not going to be an issue, but I'll keep it in mind as we 
improve and advance JRuby's compiler.

- Charlie

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to