OSDN Git Service

Improve aarch64 MonitorEntry/Exit assembly code
authorHans Boehm <hboehm@google.com>
Tue, 17 Jan 2017 23:03:38 +0000 (15:03 -0800)
committerHans Boehm <hboehm@google.com>
Tue, 21 Feb 2017 22:53:48 +0000 (14:53 -0800)
commit67eda383545518e79a6aa5185ae8cd841e0a4eec
tree96e2a118a1057cb6a63452ee796ac27f11cc8897
parentea36aaf1ebd5342e24ea414d0b797b25eb8d7936
Improve aarch64 MonitorEntry/Exit assembly code

We make two kinds of changes:

1) We remove some redundant moves, which appeared to have been copied
from some architecture with a 2 address instruction format.

2) We avoid the use of dmb barrier instructions, and instead use
acquire/release instructions for the actual lock loads/updates.

(2) is a clear win on A53/A57, where there seems to be very little
additional cost associated with acquire/release when
used with "exclusive" memory operations, as they are here.
On the cores used in 2016 Pixel phones, the story is more mixed.
But the addition of acquire/release to a pair of exclusive load/store
operations still seems to cost enough less than 2 dmb's, so that
even if 10% of lock acquisitions are nested and unnecessarily
enforce ordering, we come out slightly ahead. ARM's advice for
the future is also to move in this direction.

Test: AOSP boots. AOSP art test failures seem attributable to other
issues.

Change-Id: I2399baeab3df93196471e65612c00d95ad4e2b62
runtime/arch/arm64/quick_entrypoints_arm64.S