IBC.MethodData ReadMethod() { var result = new IBC.MethodData(); int size; long startPosition = ReadSizeAndGetStart(out size); if (!minified) { reader.ReadUInt32(); // Number of "detail" items. Ignored. } result.Token = ReadTokenWithMemory(ref lastTokens.LastMethodToken); result.ILSize = ReadSmallUInt(); if (minified) { uint firstBlockHitCount = reader.Read7BitEncodedUInt(); result.BasicBlocks.Add(new IBC.BasicBlockData { ILOffset = 0, ExecutionCount = firstBlockHitCount }); } uint numberOfBlocks = ReadSmallUInt(); ReadBlocks(result.BasicBlocks, numberOfBlocks); SeekTo(startPosition + size); // Usually a no-op return(result); }
IBC.MethodData ReadV1Method() { var result = new IBC.MethodData(); result.ILSize = 0; reader.ReadUInt32(); // Header size. Ignored. result.Token = reader.ReadUInt32(); // V1 files stored the size of the block count data in bytes. For each // block an offset and a count are stored, both as uints. uint blockDataSize = reader.ReadUInt32(); uint numberOfBlocks = blockDataSize / (2 * sizeof(uint)); ReadBlocks(result.BasicBlocks, numberOfBlocks); return(result); }