Пример #1
0
 public InliningEvent(MethodJitInliningFailedAnsiTraceData data)
 {
     Succeeded            = false;
     InlinerNamespace     = data.InlinerNamespace;
     InlinerName          = data.InlinerName;
     InlinerNameSignature = data.InlinerNameSignature;
     InlineeNamespace     = data.InlineeNamespace;
     InlineeName          = data.InlineeName;
     InlineeNameSignature = data.InlineeNameSignature;
     FailReason           = data.FailReason;
     FailAlways           = data.FailAlways;
 }
Пример #2
0
        private void Clr_MethodInliningFailedAnsi(MethodJitInliningFailedAnsiTraceData data)
        {
            if (!_isEnabled)
            {
                return;
            }

            var inlinerMethod = _assemblyCallGraph.GetOrAddMethod(data.InlinerNamespace, data.InlinerName, data.InlinerNameSignature);

            if (_currentAsyncMethod != null)
            {
                inlinerMethod = _currentAsyncMethod;
            }

            var calledMethod = _assemblyCallGraph.GetOrAddMethod(data.InlineeNamespace, data.InlineeName, data.InlineeNameSignature);

            var methodCall = new MethodCall
            {
                Source     = inlinerMethod,
                Target     = calledMethod,
                IsInlined  = false,
                FailReason = data.FailReason
            };

            inlinerMethod.MethodCalls.Add(methodCall);
            calledMethod.CalledBy.Add(methodCall);

            if (data.FailAlways)
            {
                calledMethod.InlineFailsAlways = true;
            }

            if (_recordEventDetails)
            {
                _assemblyCallGraph.EventDetails.Add(new InliningEvent(data));
            }

            _lastMethod = inlinerMethod;
        }