Compiled call version seems to be slower

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Mon Nov 30 10:10:04 PST 2009


>>>> 
>>>>>> Additionally I'm wondering why the finally block is copy-and-pasted
>>>>>> for 
>>>>>> each separate return.
>>>>>> Is that as disired ?
>>>>>> 
>> 
>> Sorry about asking once more. Would it be so hard to avoid the 6-times 
>> redundancy of the finally block, or are there other reasons?
> 
> Well, I guess no, but everyone is busy with more important stuff.  But
> hey, it's open source :-)

The 6 copies of the finally block are there in the bytecodes.  It's not something hotspot is creating.  A finally is executed on every return path so a copy of that code is needed at every return.  Conceivably javac could merge all the return paths through a single return with a single copy of the code but it doesn't do that.  You could reshape your code to look like that if you wanted to avoid multiple copies.

tom


> 
> -- Christian
> 



More information about the hotspot-compiler-dev mailing list