From 7087b55e814035f001c0256b1bf764a56e21d6f3 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Sun, 12 Jun 2011 01:29:48 -0300 Subject: [PATCH] Add new mono byte code for memory barriers --- mono/cil/opcode.def | 1 + mono/mini/method-to-ir.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/mono/cil/opcode.def b/mono/cil/opcode.def index c23e6978a58..ed9d26e6d9c 100644 --- a/mono/cil/opcode.def +++ b/mono/cil/opcode.def @@ -307,6 +307,7 @@ OPDEF(CEE_MONO_NOT_TAKEN, "mono_not_taken", Pop0, Push0, InlineNone, X, 2, 0xF0, OPDEF(CEE_MONO_TLS, "mono_tls", Pop0, PushI, InlineI, X, 2, 0xF0, 0x0D, NEXT) OPDEF(CEE_MONO_ICALL_ADDR, "mono_icall_addr", Pop0, PushI, InlineI, X, 2, 0xF0, 0x0E, NEXT) OPDEF(CEE_MONO_DYN_CALL, "mono_dyn_call", Pop0, PushI, InlineI, X, 2, 0xF0, 0x0F, NEXT) +OPDEF(CEE_MONO_MEMORY_BARRIER, "mono_memory_barrier", Pop0, Push0, InlineI, X, 2, 0xF0, 0x10, NEXT) #ifndef OPALIAS #define _MONO_CIL_OPALIAS_DEFINED_ #define OPALIAS(a,s,r) diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 4256b198f98..1005893c6e7 100644 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -10009,6 +10009,12 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b break; } + case CEE_MONO_MEMORY_BARRIER: { + CHECK_OPSIZE (5); + emit_memory_barrier (cfg, (int)read32 (ip + 1)); + ip += 5; + break; + } default: g_error ("opcode 0x%02x 0x%02x not handled", MONO_CUSTOM_PREFIX, ip [1]); break; -- 2.11.4.GIT