x86_64: Implement VarHandle.get() for static and instance fields.
The implementation follows code structure for arm64.
VarHandle{Acquire,Opaque,Volatile}.get() have the same implementaiton as
VarHandle.get() on x86-64 due to the x86 memory model.
Benchmarks improvements (using benchmarks provided by
https://android-review.googlesource.com/1420959):
benchmark before after
--------------------------------------------
GetStaticFieldInt 2.277 0.00179
GetStaticFieldString 2.307 0.00214
GetFieldInt 2.532 0.00173
GetFieldString 2.587 0.00203
GetAcquireStaticFieldInt 2.279 0.00177
GetAcquireStaticFieldString 2.358 0.00214
GetAcquireFieldInt 2.548 0.00173
GetAcquireFieldString 2.612 0.00202
GetOpaqueStaticFieldInt 2.274 0.00177
GetOpaqueStaticFieldString 2.348 0.00213
GetOpaqueFieldInt 2.554 0.00172
GetOpaqueFieldString 2.619 0.00207
GetVolatileStaticFieldInt 2.252 0.00177
GetVolatileStaticFieldString 2.343 0.00214
GetVolatileFieldInt 2.550 0.00172
GetVolatileFieldString 2.617 0.00202
Bug: 65872996
Test: lunch aosp_cf_x86_64_phone-userdebug \
&& art/test.py --host -r -t 712-varhandle-invocations --64
Test: Repeat with ART_USE_READ_BARRIER=false.
Test: Repeat with ART_HEAP_POISONING=true.
Change-Id: I1796faf6cb86b6882de459a02f5728ea56e4b668
diff --git a/compiler/optimizing/code_generator_x86_64.h b/compiler/optimizing/code_generator_x86_64.h
index 6038223..c566edf 100644
--- a/compiler/optimizing/code_generator_x86_64.h
+++ b/compiler/optimizing/code_generator_x86_64.h
@@ -231,6 +231,17 @@
X86_64Assembler* GetAssembler() const { return assembler_; }
+ // Generate a GC root reference load:
+ //
+ // root <- *address
+ //
+ // while honoring read barriers based on read_barrier_option.
+ void GenerateGcRootFieldLoad(HInstruction* instruction,
+ Location root,
+ const Address& address,
+ Label* fixup_label,
+ ReadBarrierOption read_barrier_option);
+
private:
// Generate code for the given suspend check. If not null, `successor`
// is the block to branch to if the suspend check is not needed, and after
@@ -286,16 +297,6 @@
Location obj,
uint32_t offset,
ReadBarrierOption read_barrier_option);
- // Generate a GC root reference load:
- //
- // root <- *address
- //
- // while honoring read barriers based on read_barrier_option.
- void GenerateGcRootFieldLoad(HInstruction* instruction,
- Location root,
- const Address& address,
- Label* fixup_label,
- ReadBarrierOption read_barrier_option);
void PushOntoFPStack(Location source, uint32_t temp_offset,
uint32_t stack_adjustment, bool is_float);