Ejemplo n.º 1
0
 protected override void InlineInBlocks()
 {
     V_0 = this.methodContext.get_Expressions().get_BlockExpressions().GetEnumerator();
     try
     {
         while (V_0.MoveNext())
         {
             V_1 = V_0.get_Current();
             V_2 = V_1.get_Value();
             V_3 = new Boolean[V_2.get_Count()];
             V_4 = (int)this.methodContext.get_ControlFlowGraph().get_InstructionToBlockMapping().get_Item(V_1.get_Key()).get_Successors().Length > 1;
             V_5 = V_2.get_Count() - 2;
             V_6 = V_5 + 1;
             while (V_5 >= 0)
             {
                 V_7 = V_2.get_Item(V_5) as BinaryExpression;
                 if (V_7 == null || !V_7.get_IsAssignmentExpression() || V_7.get_Left().get_CodeNodeType() != 26)
                 {
                     V_6 = V_5;
                 }
                 else
                 {
                     V_8 = (V_7.get_Left() as VariableReferenceExpression).get_Variable().Resolve();
                     if (this.variablesToInline.Contains(V_8))
                     {
                         V_9 = V_7.get_Right();
                         if (this.IsEnumeratorGetCurrent(V_9) || this.IsQueryInvocation(V_9) || V_8.get_VariableType() != null && V_8.get_VariableType().get_IsPinned())
                         {
                             V_6 = V_5;
                         }
                         else
                         {
                             V_10 = new List <Instruction>(V_7.get_MappedInstructions());
                             V_10.AddRange(V_7.get_Left().get_UnderlyingSameMethodInstructions());
                             stackVariable78 = this.inliner;
                             stackVariable79 = V_8;
                             stackVariable82 = V_9.CloneAndAttachInstructions(V_10);
                             stackVariable85 = V_2.get_Item(V_6);
                             if (!V_4)
                             {
                                 stackVariable87 = false;
                             }
                             else
                             {
                                 stackVariable87 = V_6 + 1 == V_2.get_Count();
                             }
                             if (!stackVariable78.TryInlineVariable(stackVariable79, stackVariable82, stackVariable85, stackVariable87, out V_11))
                             {
                                 V_6 = V_5;
                             }
                             else
                             {
                                 V_2.set_Item(V_6, (Expression)V_11);
                                 V_3[V_5] = true;
                             }
                         }
                     }
                     else
                     {
                         V_6 = V_5;
                     }
                 }
                 V_5 = V_5 - 1;
             }
             this.FastRemoveExpressions(V_2, V_3);
         }
     }
     finally
     {
         ((IDisposable)V_0).Dispose();
     }
     return;
 }