Request for reviews (XL): 6919934: JSR 292 needs to support x86 C1

Christian Wimmer wimmer at ssw.jku.at
Mon Mar 29 23:03:24 PDT 2010


On Mar 29, 2010, at 11:28 AM, Tom Rodriguez wrote:

>
> On Mar 29, 2010, at 5:46 AM, Christian Thalinger wrote:
>
>> On Wed, 2010-03-24 at 13:57 -0700, Christian Wimmer wrote:
>>> Hi Christian, Tom,
>>>
>>> This changeset modifies the GraphBuilder such that now every method
>>> has a synthetic exception handler that covers the whole method.
>>> Previously, it was only necessary for synchronized methods (and with
>>> dtrace). I added the relevant diff below - note that the "if" is
>>> remoed by the patch.
>>> I think this affects the speed of C1 negatively, and perhaps also  
>>> the
>>> generated code (it might slow down the exception dispatch). Why is
>>> this change necessary?
>>
>> Tom would know better as he did the changes, but we changed the  
>> code so
>> that C1 has the same unwinding mechanism as C2 does.  This makes  
>> the C1
>> code a bit simpler.
>
> Otherwise the unwind code has to do a call into the runtime to find  
> out the nmethod frame_size so that it can take the frame off the  
> stack properly.  I just didn't like doing that and never liked that  
> C1 and C2 did these differently for no good reason so it seemed  
> easiest to make it work the same.

That sounds reasonable, at first I thought that is a change that is  
related to invokedynamic.
When every exception dispatch goes through this exception handler,  
then this means that all of the "unwind" code (especially the unwind  
stub in the C1 runtime) can also go away?
>
>>
>> Regarding performance, why do you think it affects performance
>> negatively?
>
> I don't see any reason that this should hurt performance, at least  
> enough to matter.  The unwind path is changed to a jump to a tiny  
> trampoline in the nmethod that adjusts sp and jumps to the unwind  
> handler, so you don't go directly to the unwind handler but it's  
> pretty minimal.  Are there are other code generation effects that  
> would be expected?

Exception stack unwinding will be a bit slower, but I guess that  
doesn't matter at all.

I'm more concerned about the compilation speed of C1. Back in the  
days, I optimized under the assumption that most of the blocks don't  
have exception edges. This is now no longer true, since nearly every  
block now has an exception edge to the synthetic exception handler.  
Did you see an impact on the compilation time?

Christian


More information about the hotspot-compiler-dev mailing list