public OptimizingCallDelegate/*!*/ AddWarning(OptimizingCallDelegate/*!*/ result) { if(_conditionDelegate != null) { return delegate(object[] callArgs, out bool shouldOptimize) { if (_conditionDelegate()) { PythonOps.Warn((CodeContext)callArgs[0], _type, _message, ArrayUtils.EmptyObjects); } return result(callArgs, out shouldOptimize); }; } return delegate(object[] callArgs, out bool shouldOptimize) { PythonOps.Warn((CodeContext)callArgs[0], _type, _message, ArrayUtils.EmptyObjects); return result(callArgs, out shouldOptimize); }; }
/// <summary> /// Wraps a call to a MethodInfo with profiling capture for that MethodInfo /// </summary> internal OptimizingCallDelegate AddProfiling(OptimizingCallDelegate /*!*/ callDelgate, MethodBase /*!*/ method) { if ((method is DynamicMethod) || IgnoreMethod(method)) { return(callDelgate); } int profileIndex = GetProfilerIndex(method); return(delegate(object[] callArgs, out bool shouldOptimize) { long callStart = StartCall(profileIndex); try { return callDelgate(callArgs, out shouldOptimize); } finally { FinishCall(profileIndex, callStart); } }); }
public OptimizingCallDelegate /*!*/ AddWarning(OptimizingCallDelegate /*!*/ result) { if (_conditionDelegate != null) { return(delegate(object[] callArgs, out bool shouldOptimize) { if (_conditionDelegate()) { PythonOps.Warn((CodeContext)callArgs[0], _type, _message, ArrayUtils.EmptyObjects); } return result(callArgs, out shouldOptimize); }); } return(delegate(object[] callArgs, out bool shouldOptimize) { PythonOps.Warn((CodeContext)callArgs[0], _type, _message, ArrayUtils.EmptyObjects); return result(callArgs, out shouldOptimize); }); }