[interp] Avoid using full barriers for volatile operations
commit0102263645b73422d84dbe7fac3bdee65c7447a7
authorVlad Brezae <brezaevlad@gmail.com>
Wed, 16 Oct 2019 20:01:54 +0000 (16 23:01 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Thu, 17 Oct 2019 09:53:19 +0000 (17 12:53 +0300)
treef08e1d473c0a0143f1ab08e5959d3175896c345a
parent4f8a82c9fdebd7e9dcc5392a8b3a0fd129789bc0
[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.
mono/mini/interp/transform.c