public InstructionNode(Instruction instruction, MethodDefinition method) { Instruction = instruction; Method = method; // TODO rework, this must precede StackPopCount for now, yuck DataFlowBackRelated = new DataFlowBackArgList(this); StackPushCount = GetStackPushCount(instruction); StackPopCount = GetStackPopCount(instruction); MemoryReadCount = MemoryProperties.GetMemReadCount(instruction.OpCode.Code); MemoryStoreCount = MemoryProperties.GetMemStoreCount(instruction.OpCode.Code); ProgramFlowBackRoutes = new ProgramFlowBackRoutes(this); ProgramFlowForwardRoutes = new ProgramFlowForwardRoutes(this); DataFlowForwardRelated = new DataFlowForwardArgList(this); SingleUnitBackRelated = new SingleUnitBackRelated(this); SingleUnitForwardRelated = new SingleUnitForwardRelated(this); SingleUnitNodes = new List <InstructionNode>(); MethodNameForSerilization = method.Name; MyGuid = Guid.NewGuid(); _BranchProperties = new BranchProperties(this); BranchProperties.BaseBranch.AddTwoWay(this); }
public static int GetMemReadCount(Code code) { return(MemoryProperties.GetMemReadCount(code)); }