[corlib]Implement .net 4.0 ParameterInfo.
[mono.git] / mcs / class / corlib / System.Reflection.Emit / OpCodes.cs
index a0c78a94ec421c1480a94a6316a41de6e2397f66..840ee183ffcba131c010ab00eda22b672c6631a2 100644 (file)
@@ -1,9 +1,8 @@
+#if !FULL_AOT_RUNTIME
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
-#if NET_2_0
        [ComVisible (true)]
-#endif
        public class OpCodes {
 
                internal OpCodes () {
@@ -474,9 +473,7 @@ namespace System.Reflection.Emit {
                        0xFF << 0 | 0x73 << 8 | (byte) StackBehaviour.Pushref << 16 | (byte) StackBehaviour.Varpop << 24,
                        1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineMethod << 16 | (byte) FlowControl.Call << 24);
 
-#if NET_2_0
        [ComVisible (true)]
-#endif
                public static readonly OpCode Castclass = new OpCode (
                        0xFF << 0 | 0x74 << 8 | (byte) StackBehaviour.Pushref << 16 | (byte) StackBehaviour.Popref << 24,
                        1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
@@ -656,27 +653,18 @@ namespace System.Reflection.Emit {
                public static readonly OpCode Stelem_Ref = new OpCode (
                        0xFF << 0 | 0xA2 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popref_popi_popref << 24,
                        1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineNone << 16 | (byte) FlowControl.Next << 24);
-#if NET_2_0 || BOOTSTRAP_NET_2_0
-               public static readonly OpCode Ldelem_Any = new OpCode (
-                       0xFF << 0 | 0xA3 << 8 | (byte) StackBehaviour.Push1 << 16 | (byte) StackBehaviour.Popref_popi << 24,
-                       1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
-
-               public static readonly OpCode Stelem_Any = new OpCode (
-                       0xFF << 0 | 0xA4 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popref_popi_popref << 24,
-                       1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
-
                public static readonly OpCode Ldelem = new OpCode (
                        0xFF << 0 | 0xA3 << 8 | (byte) StackBehaviour.Push1 << 16 | (byte) StackBehaviour.Popref_popi << 24,
                        1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
 
                public static readonly OpCode Stelem = new OpCode (
-                       0xFF << 0 | 0xA4 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popref_popi_popref << 24,
+                       0xFF << 0 | 0xA4 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popref_popi_pop1 << 24,
                        1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
 
                public static readonly OpCode Unbox_Any = new OpCode (
                        0xFF << 0 | 0xA5 << 8 | (byte) StackBehaviour.Push1 << 16 | (byte) StackBehaviour.Popref << 24,
                        1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
-#endif
+
                public static readonly OpCode Conv_Ovf_I1 = new OpCode (
                        0xFF << 0 | 0xB3 << 8 | (byte) StackBehaviour.Pushi << 16 | (byte) StackBehaviour.Pop1 << 24,
                        1 << 0 | (byte) OpCodeType.Primitive << 8 | (byte) OperandType.InlineNone << 16 | (byte) FlowControl.Next << 24);
@@ -900,11 +888,11 @@ namespace System.Reflection.Emit {
                public static readonly OpCode Initobj = new OpCode (
                        0xFE << 0 | 0x15 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popi << 24,
                        2 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
-#if NET_2_0 || BOOTSTRAP_NET_2_0
+
                public static readonly OpCode Constrained = new OpCode (
                        0xFE << 0 | 0x16 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Pop0 << 24,
-                       2 << 0 | (byte) OpCodeType.Prefix << 8 | (byte) OperandType.InlineTok << 16 | (byte) FlowControl.Next << 24);
-#endif
+                       2 << 0 | (byte) OpCodeType.Prefix << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Meta << 24);
+
                public static readonly OpCode Cpblk = new OpCode (
                        0xFE << 0 | 0x17 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popi_popi_popi << 24,
                        2 << 0 | (byte) OpCodeType.Primitive << 8 | (byte) OperandType.InlineNone << 16 | (byte) FlowControl.Next << 24);
@@ -925,6 +913,10 @@ namespace System.Reflection.Emit {
                        0xFE << 0 | 0x1D << 8 | (byte) StackBehaviour.Pushi << 16 | (byte) StackBehaviour.Pop1 << 24,
                        2 << 0 | (byte) OpCodeType.Primitive << 8 | (byte) OperandType.InlineNone << 16 | (byte) FlowControl.Next << 24);
 
+               public static readonly OpCode Readonly = new OpCode (
+                       0xFE << 0 | 0x1E << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Pop0 << 24,
+                       2 << 0 | (byte) OpCodeType.Prefix << 8 | (byte) OperandType.InlineNone << 16 | (byte) FlowControl.Meta << 24);
+
                 public static bool TakesSingleByteArgument (OpCode inst)
                 {
                        OperandType t = inst.OperandType;
@@ -937,3 +929,4 @@ namespace System.Reflection.Emit {
                }
        }
 }
+#endif