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.cc b/compiler/optimizing/code_generator_x86_64.cc
index d54484c..ae6c159 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -509,8 +509,7 @@
instruction_->IsLoadString() ||
instruction_->IsInstanceOf() ||
instruction_->IsCheckCast() ||
- (instruction_->IsInvokeVirtual() && instruction_->GetLocations()->Intrinsified()) ||
- (instruction_->IsInvokeStaticOrDirect() && instruction_->GetLocations()->Intrinsified()))
+ (instruction_->IsInvoke() && instruction_->GetLocations()->Intrinsified()))
<< "Unexpected instruction in read barrier marking slow path: "
<< instruction_->DebugName();