summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/code_generator_arm64.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2018-08-08 15:15:33 +0100
committerVladimir Marko <vmarko@google.com>2018-08-14 16:36:39 +0100
commit94796f8e1b1d920c6107ffddf4efdabcf85e1da4 (patch)
treee6c068b622bc60b1570eb1c54d3ddeea4972b1a2 /compiler/optimizing/code_generator_arm64.h
parent248141f724cbb9d436f13181b5301172c4385cc2 (diff)
downloadart-94796f8e1b1d920c6107ffddf4efdabcf85e1da4.tar.gz
art-94796f8e1b1d920c6107ffddf4efdabcf85e1da4.tar.bz2
art-94796f8e1b1d920c6107ffddf4efdabcf85e1da4.zip
ARM64: Reimplement the UnsafeCASObject intrinsic.
For the UnsafeCASObject with Baker read barriers, drop the old code updating the field. Perform the main path CAS loop and redirect the flow for failure to a slow path that marks the old value and compares it with the expected value (if not marking, this is just a few instructions to determine that they differ). If it's the same, the old value is known to be the from-space reference to the expected object and the slow path performs a modified CAS loop checking for both expected object references (from-space and to-space). Test: Already covered by the 160-read-barrier-stress. Test: m test-art-host-gtest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --64 Test: ART_HEAP_POISONING=true testrunner.py --target --optimizing --64 Bug: 36141117 Change-Id: I175806dbc003640c9bb6759be6788311bcc9310c
Diffstat (limited to 'compiler/optimizing/code_generator_arm64.h')
-rw-r--r--compiler/optimizing/code_generator_arm64.h33
1 files changed, 3 insertions, 30 deletions
diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h
index f3f5079f0a..4f6a44fe4d 100644
--- a/compiler/optimizing/code_generator_arm64.h
+++ b/compiler/optimizing/code_generator_arm64.h
@@ -671,6 +671,9 @@ class CodeGeneratorARM64 : public CodeGenerator {
uint32_t offset,
vixl::aarch64::Label* fixup_label,
ReadBarrierOption read_barrier_option);
+ // Generate MOV for the `old_value` in UnsafeCASObject and mark it with Baker read barrier.
+ void GenerateUnsafeCasOldValueMovWithBakerReadBarrier(vixl::aarch64::Register marked,
+ vixl::aarch64::Register old_value);
// Fast path implementation of ReadBarrier::Barrier for a heap
// reference field load when Baker's read barriers are used.
// Overload suitable for Unsafe.getObject/-Volatile() intrinsic.
@@ -698,36 +701,6 @@ class CodeGeneratorARM64 : public CodeGenerator {
vixl::aarch64::Register temp,
bool needs_null_check);
- // Generate code checking whether the the reference field at the
- // address `obj + field_offset`, held by object `obj`, needs to be
- // marked, and if so, marking it and updating the field within `obj`
- // with the marked value.
- //
- // This routine is used for the implementation of the
- // UnsafeCASObject intrinsic with Baker read barriers.
- //
- // This method has a structure similar to
- // GenerateReferenceLoadWithBakerReadBarrier, but note that argument
- // `ref` is only as a temporary here, and thus its value should not
- // be used afterwards.
- void UpdateReferenceFieldWithBakerReadBarrier(HInstruction* instruction,
- Location ref,
- vixl::aarch64::Register obj,
- Location field_offset,
- vixl::aarch64::Register temp,
- bool needs_null_check,
- bool use_load_acquire);
-
- // Generate a heap reference load (with no read barrier).
- void GenerateRawReferenceLoad(HInstruction* instruction,
- Location ref,
- vixl::aarch64::Register obj,
- uint32_t offset,
- Location index,
- size_t scale_factor,
- bool needs_null_check,
- bool use_load_acquire);
-
// Emit code checking the status of the Marking Register, and
// aborting the program if MR does not match the value stored in the
// art::Thread object. Code is only emitted in debug mode and if