OSDN Git Service

Don't pay for filename/line number lookup unless you need to.
authorElliott Hughes <enh@google.com>
Fri, 4 Nov 2011 01:17:19 +0000 (18:17 -0700)
committerElliott Hughes <enh@google.com>
Fri, 4 Nov 2011 01:17:19 +0000 (18:17 -0700)
commit9d420d4ed7b9e5315bc4e4248cef42034ec47530
tree89dd19327c1e3fb14b6f73c87602a1ca564bb394
parentc4102d6647043591bd89bba75454cc04d23753bd
Don't pay for filename/line number lookup unless you need to.

This wasn't a regression; the code's always been like this. But this shows up
in profiles of anything doing a lot of synchronized stuff, even when there's
no contention.

There are two awkward cases. One is that the old code used to offer a variety
of special-case messages for failures to find the current frame, save area,
and Method*. I assume this was just to help in debugging and shouldn't happen
in practice, so I don't think we've lost anything there. The other case was
that on unlocking, we used to explicitly say "unlocked". But I'm not sure we
could get into a situation where we'd be reporting contention on a monitor
that wasn't locked when we tried to lock it. So I think that's okay too.

Change-Id: Ib4401c771f717e9c8cc9c4e5346ec7a5f46a1636
vm/Sync.cpp