This commit is contained in:
ig-sinicyn 2018-10-23 01:26:25 +03:00
Родитель aa9ff82e41
Коммит 351ca51f27
1 изменённых файлов: 2 добавлений и 8 удалений

Просмотреть файл

@ -70,8 +70,8 @@ namespace BenchmarkDotNet.IntegrationTests.InProcess.EmitTests
{ {
var bodyInstructions = method.Body.GetILProcessor().Body.Instructions; var bodyInstructions = method.Body.GetILProcessor().Body.Instructions;
// There's something wrong with ldloc with index >= 255. The c# compiler emits random nops for them. // There's something wrong with ldloc/ldarg with index >= 255. The c# compiler emits random nops for them.
var compareNops = method.Body.Variables.Count < 255; var compareNops = method.Body.Variables.Count < 255 && method.Parameters.Count < 255;
var result = new List<Instruction>(bodyInstructions.Count); var result = new List<Instruction>(bodyInstructions.Count);
foreach (var instruction in bodyInstructions) foreach (var instruction in bodyInstructions)
{ {
@ -373,12 +373,6 @@ namespace BenchmarkDotNet.IntegrationTests.InProcess.EmitTests
var variables2 = method2.Body.Variables.ToList(); var variables2 = method2.Body.Variables.ToList();
var diffMax = Math.Min(variables1.Count, variables2.Count); var diffMax = Math.Min(variables1.Count, variables2.Count);
var op2ToOp1Map = variables1.Take(diffMax)
.Zip(
variables2.Take(diffMax),
(i1, i2) => (i1, i2))
.ToDictionary(x => x.i2, x => x.i1);
for (var i = 0; i < diffMax; i++) for (var i = 0; i < diffMax; i++)
{ {
DiffSignature(variables1[i], variables2[i], method1); DiffSignature(variables1[i], variables2[i], method1);