public override void FieldReference(FieldReferenceOpcode opcode, FieldInfo field) { OpCode emitOpCode; opcode.GetReflectionEmitOpCode(out emitOpCode); generator.Emit(emitOpCode, field); }
public override void FieldReference(FieldReferenceOpcode opcode, FieldInfo field) { if (opcode.IsStatic && !field.IsStatic) { throw Error("Static field reference to non-static field {0}.", GetFullName(field)); } if (field.DeclaringType.IsGenericTypeDefinition) { throw Error("Field reference to a field from a generic type definition: {0}.", GetFullName(field)); } if (opcode.ReferenceKind == LocationReferenceKind.Store) { stack.PopAssignableTo(opcode, field.FieldType); } if (!field.IsStatic) { stack.PopAssignableTo(opcode, field.DeclaringType); } if (opcode.ReferenceKind == LocationReferenceKind.Load) { stack.Push(field.FieldType); } else if (opcode.ReferenceKind == LocationReferenceKind.LoadAddress) { var managedPointerType = field.FieldType.MakeByRefType(); // InitOnly fields are loaded a controlled-mutability managed pointers unless in the constructor bool mutable = !field.IsInitOnly || (method is ConstructorInfo && method.DeclaringType == field.DeclaringType); stack.PushManagedPointer(managedPointerType, mutable); } if (sink != null) { sink.FieldReference(opcode, field); } }
public override void VisitFieldReference(FieldReferenceOpcode opcode, VisitorParam param) { throw RequiresSymbolicOverload(opcode); }
public override void FieldReference(FieldReferenceOpcode opcode, FieldInfo field) { stringBuilder.AppendLine(opcode.Name + ' ' + field.DeclaringType.FullName + '.' + field.Name); }
public abstract void FieldReference(FieldReferenceOpcode opcode, FieldInfo field);