This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: locks on X86
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Subject: Re: locks on X86
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Wed, 14 Mar 2001 11:37:43 +1300
- CC: "'green at redhat dot com'" <green at redhat dot com>, Jeff Sturm <jsturm at one-point dot com>, java at gcc dot gnu dot org, drepper at redhat dot com
- References: <140D21516EC2D3119EE7009027876644049B5CA8@hplex1.hpl.hp.com>
"Boehm, Hans" wrote:
> Inlining all of this really wins if you can move the thread id and hash
> address calculation out of a loop. But that won't happen for a synchronized
> method call unless the method itself is also inlined.
Couldn't we change the calling convention so that synchronization happens
_before_ making a synchronized call? This wont help for code which uses a
synchronized block inside the method rather than the synchronized modifier, but
presumably the modifier is a common case. There is a speed-size tradeoff of
course, but synchronizing first gives a lot more opportunity for optimizations
without inlining (synchronizing once for consecutive calls to the same object,
moving synchronization out of a loop, etc).
regards
[ bryce ]