internal void GenerateStore(FieldStructure field) { var fb = field.GainField(); if (fb.IsStatic) { Generator.Emit(OpCodes.Stsfld, fb); } else { Generator.Emit(OpCodes.Stfld, fb); } }
internal FieldInfo RenewField(FieldStructure field) { if (Info.GetType().Name == "TypeBuilderInstantiation") { return TypeBuilder.GetField(Info, field.GainField()); } else { var f = field.GainField(); var ret = Info.GetField(f.Name); if(ret == null) { throw new InvalidOperationException(); } return ret; } }
internal void GenerateLoadAddress(FieldStructure field) { var fb = field.GainField(); if (fb.IsStatic) { Generator.Emit(OpCodes.Ldsflda, fb); } else { Generator.Emit(OpCodes.Ldflda, fb); } }