void ProcessOneInstruction(Mono.Cecil.Cil.Instruction cilInst) { #if DEBUGDIAG var(stack1, stack2) = stackMap.FrameToString(); Console.WriteLine($"LOCALS [{stack1}] STACK [{stack2}]"); Console.WriteLine(cilInst); #endif int instructionsCount = code.Instructions.Count; code.SetLabel((ushort)cilInst.Offset); this.cilInst = cilInst; this.cilOp = cilInst.OpCode.Code; exceptions.CheckAndSaveFrame(cilInst); var genericMark = CilMain.GenericStack.Mark(); CallInstructionTranslator(); CilMain.GenericStack.Release(genericMark); while (instructionsCount < code.Instructions.Count) { var newInst = code.Instructions[instructionsCount++]; #if DEBUGDIAG newInst.Line = (ushort)(lineNumber != 0 ? lineNumber : cilInst.Offset); #else newInst.Line = (ushort)lineNumber; #endif } }
public InstructionAttribute(Mono.Cecil.Cil.Code code) { this.code = code; }