[interp] Avoid using full barriers for volatile operations
authorVlad Brezae <brezaevlad@gmail.com>
Wed, 16 Oct 2019 20:01:54 +0000 (23:01 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Thu, 17 Oct 2019 09:53:19 +0000 (12:53 +0300)
commit7f33e4ca1002210c4730883760652ab8b73440fb
treed5b2556792a165ae8cb68201189bb59525258cae
parent18450a660cd7152a61f68534c861f788c994dab6
[interp] Avoid using full barriers for volatile operations

This commit avoid unnecessary memory barriers on x86 and amd64.

Volatile writes have release semantics, volatile reads have acquire semantics. Organize the code a little bit to indicate this. On x86 and amd64 we don't require barrier for acquire and release semantics since they are provided by the arch, so we can skip them. Ideally we should have 3 memory barrier interp instructions for each type, but, currently, they would all seem to call mono_memory_barrier so it is useless at this point.

Commit migrated from https://github.com/mono/mono/commit/0102263645b73422d84dbe7fac3bdee65c7447a7
src/mono/mono/mini/interp/transform.c