public static void InitializeFields(CodeContext context, Type type, bool reusable) { if (type == null) { return; } const string slotStorageName = "#SlotStorage"; foreach (FieldInfo fi in type.GetFields()) { if (fi.Name.StartsWith(slotStorageName)) { object value; if (reusable) { value = ConstantPool.GetConstantDataReusable(Int32.Parse(fi.Name.Substring(slotStorageName.Length))); } else { value = ConstantPool.GetConstantData(Int32.Parse(fi.Name.Substring(slotStorageName.Length))); } Debug.Assert(value != null); FastDynamicSite fds = value as FastDynamicSite; if (fds != null) { fds.Context = context; } fi.SetValue(null, value); } } }