public int CompareTo(InstructionBlock block)
 {
     return(first.Offset - block.First.Offset);
 }
Exemplo n.º 2
0
 void RegisterBlock(InstructionBlock block)
 {
     blocks.Add(block.First.Offset, block);
 }
		static int GetBlockId (ControlFlowGraph cfg, InstructionBlock block)
		{
			return ((IList<InstructionBlock>) cfg.Blocks).IndexOf (block) + 1;
		}
Exemplo n.º 4
0
        void ComputeInstructionData(HashSet <InstructionBlock> visited, int stackHeight, InstructionBlock block)
        {
            if (visited.Contains(block))
            {
                return;
            }

            visited.Add(block);

            foreach (var instruction in block)
            {
                stackHeight = ComputeInstructionData(stackHeight, instruction);
            }

            foreach (var successor in block.Successors)
            {
                ComputeInstructionData(visited, stackHeight, successor);
            }
        }