OSDN Git Service

Add support for Baker read barriers in UnsafeCASObject intrinsics.
authorRoland Levillain <rpl@google.com>
Wed, 26 Oct 2016 12:03:38 +0000 (13:03 +0100)
committerRoland Levillain <rpl@google.com>
Wed, 26 Oct 2016 12:03:38 +0000 (13:03 +0100)
commita1aa3b1f40e496d6f8b3b305a4f956ddf2e425fc
treeefe3dd581dbe9fb33e615d1608f0571ec3984208
parent188edb3a3ec36ad5fc42373b1e1bed3a85b4f112
Add support for Baker read barriers in UnsafeCASObject intrinsics.

Prior to doing the compare-and-swap operation, ensure the
expected reference stored in the holding object's field is
in the to-space by loading it, emitting a read barrier and
updating that field with a strong compare-and-set operation
with relaxed memory synchronization ordering (if needed).

Test: ART host and target tests and Nexus 5X boot test with Baker read barriers.
Bug: 29516905
Bug: 12687968
Change-Id: I480f6a9b59547f11d0a04777406b9bfeb905bfd2
15 files changed:
compiler/optimizing/code_generator_arm.cc
compiler/optimizing/code_generator_arm.h
compiler/optimizing/code_generator_arm64.cc
compiler/optimizing/code_generator_arm64.h
compiler/optimizing/code_generator_x86.cc
compiler/optimizing/code_generator_x86.h
compiler/optimizing/code_generator_x86_64.cc
compiler/optimizing/code_generator_x86_64.h
compiler/optimizing/intrinsics_arm.cc
compiler/optimizing/intrinsics_arm64.cc
compiler/optimizing/intrinsics_x86.cc
compiler/optimizing/intrinsics_x86_64.cc
runtime/interpreter/unstarted_runtime.cc
runtime/native/sun_misc_Unsafe.cc
runtime/read_barrier-inl.h