OSDN Git Service

Replace cxa_guard fences with acquire loads
authorHans Boehm <hboehm@google.com>
Wed, 22 Feb 2017 23:34:29 +0000 (15:34 -0800)
committerHans Boehm <hboehm@google.com>
Thu, 23 Feb 2017 19:50:58 +0000 (11:50 -0800)
commit963daed78044724547ff1c7c35b34a4d50a0b867
treee8293055d696d79e994e7094dfb58cce2957963f
parentc9a840ac76c7cdbe6028ac91cdb8eb6698f0a854
Replace cxa_guard fences with acquire loads

This seemed to be the only place in bionic where a fence on a
performance-critical path could be easily replaced by a stronger
load/store order constraint. Do so.

On x86 this should generate the same code either way. Based on
microbenchmarks of the relevant ARM instructions, this is currently
performance-neutral in this kind of context. But in the future, the
newly generated acquire loads should give us a performance benefit.

Test: Booted AOSP
Change-Id: I7823e11d6ae4fd58e0425244c293262e2320fd81
libc/bionic/__cxa_guard.cpp