Ejemplo n.º 1
0
        public static FieldReferenceOpcode FieldReference(LocationReferenceKind referenceKind, bool @static)
        {
            switch (referenceKind)
            {
            case LocationReferenceKind.Load: return(@static ? Opcode.Ldsfld : Opcode.Ldfld);

            case LocationReferenceKind.LoadAddress: return(@static ? Opcode.Ldsflda : Opcode.Ldflda);

            case LocationReferenceKind.Store: return(@static ? Opcode.Stsfld : Opcode.Stfld);

            default: throw new ArgumentException("referenceKind");
            }
        }
Ejemplo n.º 2
0
        public static VariableReferenceOpcode ArgumentReference(LocationReferenceKind referenceKind, int index)
        {
            switch (referenceKind)
            {
            case LocationReferenceKind.Load: return(LoadArgument(index));

            case LocationReferenceKind.LoadAddress: return(LoadArgumentAddress(index));

            case LocationReferenceKind.Store: return(StoreArgument(index));

            default: throw new ArgumentException("referenceKind");
            }
        }
Ejemplo n.º 3
0
 public static VariableReferenceOpcode VariableReference(LocationReferenceKind referenceKind, VariableLocation location)
 {
     return(location.IsLocal ? LocalReference(referenceKind, location.Index) : ArgumentReference(referenceKind, location.Index));
 }
Ejemplo n.º 4
0
 public void FieldReference(LocationReferenceKind referenceKind, FieldInfo field)
 {
     Contract.Requires(field != null);
     FieldReference(Opcode.FieldReference(referenceKind, field.IsStatic), field);
 }