Compiler\FileLayoutOptimizer.cs (40)
80List<MethodWithGCInfo> methods = new List<MethodWithGCInfo>();
83if (node is MethodWithGCInfo method)
93List<MethodWithGCInfo> sortedMethodsList = methods;
95foreach (var methodNode in sortedMethodsList)
115foreach (var method in sortedMethodsList)
161private List<MethodWithGCInfo> ApplyMethodSort(List<MethodWithGCInfo> methods)
171int sortMethodWithGCInfoByWeight(MethodWithGCInfo left, MethodWithGCInfo right)
178methods.MergeSortAllowDuplicates((MethodWithGCInfo left, MethodWithGCInfo right) => ComputeHotColdRegion(left).CompareTo(ComputeHotColdRegion(right)));
180int ComputeHotColdRegion(MethodWithGCInfo method)
187methods.MergeSortAllowDuplicates((MethodWithGCInfo left, MethodWithGCInfo right) => (_profileData[left.Method] != null).CompareTo(_profileData[right.Method] != null));
191methods.MergeSortAllowDuplicates((MethodWithGCInfo left, MethodWithGCInfo right) => ComputeHotWarmColdRegion(left).CompareTo(ComputeHotWarmColdRegion(right)));
193int ComputeHotWarmColdRegion(MethodWithGCInfo method)
226MethodWithGCInfo temp = methods[i];
233var nameMap = new Dictionary<string, MethodWithGCInfo>(methods.Count);
234var order = new Dictionary<MethodWithGCInfo, int>(methods.Count);
249|| !nameMap.TryGetValue(symbolName, out MethodWithGCInfo m))
256methods.MergeSortAllowDuplicates((MethodWithGCInfo left, MethodWithGCInfo right) => order[left].CompareTo(order[right]));
266private double MethodWithGCInfoToWeight(MethodWithGCInfo method)
300private List<MethodWithGCInfo> MethodCallFrequencySort(List<MethodWithGCInfo> methodsToPlace)
307Dictionary<MethodDesc, MethodWithGCInfo> methodMap = new Dictionary<MethodDesc, MethodWithGCInfo>();
308foreach (MethodWithGCInfo methodWithGCInfo in methodsToPlace)
323List<MethodWithGCInfo> outputMethods = new List<MethodWithGCInfo>();
328if (methodMap.TryGetValue(call.Caller, out MethodWithGCInfo callerWithGCInfo) && callerWithGCInfo != null)
333if (methodMap.TryGetValue(call.Callee, out MethodWithGCInfo calleeWithGCInfo) && calleeWithGCInfo != null)
350private List<MethodWithGCInfo> PettisHansenSort(List<MethodWithGCInfo> methodsToPlace)
355foreach (MethodWithGCInfo method in methodsToPlace)
363foreach (MethodWithGCInfo method in methodsToPlace)
391List<MethodWithGCInfo> result = new List<MethodWithGCInfo>(methodsToPlace.Count);