コード例 #1
0
 private InstructionBlock FindMostDistantSuccessor(InstructionBlock currentBlock)
 {
     V_0 = null;
     V_1 = currentBlock.get_Successors();
     V_2 = 0;
     while (V_2 < (int)V_1.Length)
     {
         V_3 = V_1[V_2];
         if (!InstructionBlock.op_Equality(V_0, null))
         {
             if (V_3.get_Index() > V_0.get_Index())
             {
                 V_0 = V_3;
             }
         }
         else
         {
             if (V_3.get_Index() > currentBlock.get_Index())
             {
                 V_0 = V_3;
             }
         }
         V_2 = V_2 + 1;
     }
     return(V_0);
 }
コード例 #2
0
 private bool BFSRemoveBlocks()
 {
     V_0 = new Queue <InstructionBlock>();
     V_1 = this.toBeRemoved.GetEnumerator();
     try
     {
         while (V_1.MoveNext())
         {
             V_2 = V_1.get_Current();
             if (V_2.get_Predecessors().get_Count() != 0)
             {
                 continue;
             }
             V_0.Enqueue(V_2);
         }
     }
     finally
     {
         ((IDisposable)V_1).Dispose();
     }
     while (V_0.get_Count() > 0)
     {
         V_3 = V_0.Dequeue();
         if (V_3.get_Index() == -1)
         {
             continue;
         }
         stackVariable22 = V_3.get_Successors();
         this.theCFG.RemoveBlockAt(V_3.get_Index());
         V_4 = stackVariable22;
         V_5 = 0;
         while (V_5 < (int)V_4.Length)
         {
             V_6 = V_4[V_5];
             if (V_6.get_Predecessors().get_Count() == 0 && InstructionBlock.op_Inequality(V_6, this.newEntryBlock))
             {
                 V_0.Enqueue(V_6);
             }
             V_5 = V_5 + 1;
         }
         dummyVar0 = this.toBeRemoved.Remove(V_3);
     }
     return(this.toBeRemoved.get_Count() == 0);
 }
コード例 #3
0
		private void RecursiveDfs(InstructionBlock currentBlock, int[] initialStack)
		{
			this.traversed[currentBlock.get_Index()] = true;
			this.blockToInitialStackMap[currentBlock.get_Index()] = initialStack;
			this.ComputeStackUsage(currentBlock);
			V_0 = this.blockToExitStackMap[currentBlock.get_Index()];
			V_1 = currentBlock.get_Successors();
			V_2 = 0;
			while (V_2 < (int)V_1.Length)
			{
				V_3 = V_1[V_2];
				if (this.traversed[V_3.get_Index()])
				{
					this.UpdateCurrentStackVariables(currentBlock, V_3);
				}
				else
				{
					this.RecursiveDfs(V_3, V_0);
				}
				V_2 = V_2 + 1;
			}
			return;
		}