/// <summary> /// 返回FieldInfo实例反射优化后的GetValue调用结果 /// </summary> /// <param name="fieldInfo">FieldInfo对象实例</param> /// <param name="obj">调用参数,用于数组索引器等成员</param> /// <returns>调用结果</returns> public static object FastGetValue(this FieldInfo fieldInfo, object obj) { if (fieldInfo == null) { throw new ArgumentNullException("fieldInfo"); } GetValueDelegate getter = (GetValueDelegate)s_getterDict[fieldInfo]; if (getter == null) { getter = DynamicMethodFactory.CreateFieldGetter(fieldInfo); s_getterDict[fieldInfo] = getter; } return(getter(obj)); }