[ast-optimizer-branch] simplifying C++

Tom Tromey tromey@redhat.com
Mon Jun 17 15:27:00 GMT 2002


>>>>> "rth" == Richard Henderson <rth@redhat.com> writes:

rth> The difference would be: can you branch out of the "finally" part
rth> of the Java finally block?

Yes.

rth> Java has "synchronized" methods, which iirc grab a mutex
rth> associated with the object on entry to the function, and release
rth> it on exit.  At heart this is just another cleanup-block with
rth> some specific function calls inside.  However, this is
rth> interesting in that post-inlining we may be able to eliminate
rth> redundant locks.

Yes (you can also synchronize a block instead of the entire method).
Re-acquiring an already acquired lock is apparently a common operation
in Java.  So this is a useful optimization to perform.

Tom



More information about the Gcc mailing list