x86_64: Factor out common part of VarHandle.getAnd{Set,Add,Bitwise*}.

Prepare for the implementation of get-and-update methods for arrays and
byte array views. Some of these methods may need a byte-swap, which is
handled on the slow path. This CL makes it easier to generate slow path
code by providing a commmon function for all get-and-update methods.

There is one change in the generated code (probably insignificant): the
`kAnyAny` memory barrier in getAndBitwise* operations was previously
done before sign-extension, and now it is done after it (since it was
factored out into the common part).

Bug: 71781600
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: I337c501688d71a73bd7aa9723b9ce15b09bdf1db
1 file changed