Esempio n. 1
0
        internal static BlockStatement DecompileYieldStateMachine(this MethodBody body, DecompilationContext enclosingContext,
            out YieldData yieldData)
        {
            DecompilationContext decompilationContext;
            BlockStatement theBlockStatement = body.DecompileStateMachine(enclosingContext, new RemoveYieldStateMachineStep(),
                (DecompilationContext context) => context.MethodContext.YieldData, out decompilationContext);

            yieldData = decompilationContext.MethodContext.YieldData;
            return theBlockStatement;
        }
Esempio n. 2
0
 internal MethodSpecificContext(DecompilationAnalysisResults analysisResults, YieldData yieldData, AsyncData asyncData,
                                bool isMethodBodyChanged, Dictionary <string, Statement> gotoLabels, List <GotoStatement> gotoStatements,
                                StackUsageData stackData, bool isBaseConstructorInvokingConstructor, bool enableEventAnalysis,
                                MethodBody body, Collection <VariableDefinition> variables, ControlFlowGraph controlFlowGraph,
                                ExpressionDecompilerData expressions, BlockLogicalConstruct logicalConstructsTree, LogicalFlowBuilderContext logicalConstructsContext,
                                MethodInvocationExpression ctorInvokeExpression, Dictionary <Statement, ILogicalConstruct> statementToLogicalConstruct,
                                Dictionary <ILogicalConstruct, List <Statement> > logicalConstructToStatements, Dictionary <VariableDefinition, string> variableDefinitionToNameMap,
                                HashSet <string> variableNamesCollection, Dictionary <ParameterDefinition, string> parameterDefinitionToNameMap,
                                HashSet <VariableDefinition> variablesToRename, Dictionary <FieldDefinition, Expression> fieldToExpression,
                                int lambdaVariablesCount, Dictionary <VariableDefinition, AssignmentType> variableAssignmentData, List <ParameterDefinition> outParametersToAssign,
                                bool isDestructor, BlockStatement destructorStatements, HashSet <VariableDefinition> undeclaredLinqVariables,
                                Dictionary <VariableReference, Dictionary <FieldDefinition, Expression> > closureVariableToFieldValue,
                                HashSet <VariableDefinition> variablesToNotDeclare, CompilerOptimizedSwitchByStringData switchByStringData)
 {
     this.AnalysisResults     = analysisResults;
     this.YieldData           = yieldData;
     this.AsyncData           = asyncData;
     this.IsMethodBodyChanged = isMethodBodyChanged;
     this.GotoLabels          = gotoLabels;
     this.GotoStatements      = gotoStatements;
     this.StackData           = stackData;
     this.IsBaseConstructorInvokingConstructor = isBaseConstructorInvokingConstructor;
     this.EnableEventAnalysis = enableEventAnalysis;
     this.Body                         = body;
     this.Variables                    = variables;
     this.ControlFlowGraph             = controlFlowGraph;
     this.Expressions                  = expressions;
     this.LogicalConstructsTree        = logicalConstructsTree;
     this.LogicalConstructsContext     = logicalConstructsContext;
     this.CtorInvokeExpression         = ctorInvokeExpression;
     this.StatementToLogicalConstruct  = statementToLogicalConstruct;
     this.LogicalConstructToStatements = logicalConstructToStatements;
     this.VariableDefinitionToNameMap  = variableDefinitionToNameMap;
     this.VariableNamesCollection      = variableNamesCollection;
     this.ParameterDefinitionToNameMap = parameterDefinitionToNameMap;
     this.VariablesToRename            = variablesToRename;
     this.FieldToExpression            = fieldToExpression;
     this.LambdaVariablesCount         = lambdaVariablesCount;
     this.VariableAssignmentData       = variableAssignmentData;
     this.OutParametersToAssign        = outParametersToAssign;
     this.IsDestructor                 = isDestructor;
     this.DestructorStatements         = destructorStatements;
     this.UndeclaredLinqVariables      = undeclaredLinqVariables;
     this.ClosureVariableToFieldValue  = closureVariableToFieldValue;
     this.VariablesToNotDeclare        = variablesToNotDeclare;
     this.SwitchByStringData           = switchByStringData;
 }
 internal MethodSpecificContext(DecompilationAnalysisResults analysisResults, YieldData yieldData, AsyncData asyncData,
     bool isMethodBodyChanged, Dictionary<string, Statement> gotoLabels, List<GotoStatement> gotoStatements,
     StackUsageData stackData, bool isBaseConstructorInvokingConstructor, bool enableEventAnalysis,
     MethodBody body, Collection<VariableDefinition> variables, ControlFlowGraph controlFlowGraph,
     ExpressionDecompilerData expressions, BlockLogicalConstruct logicalConstructsTree, LogicalFlowBuilderContext logicalConstructsContext,
     MethodInvocationExpression ctorInvokeExpression, Dictionary<Statement, ILogicalConstruct> statementToLogicalConstruct,
     Dictionary<ILogicalConstruct, List<Statement>> logicalConstructToStatements, Dictionary<VariableDefinition, string> variableDefinitionToNameMap,
     HashSet<string> variableNamesCollection, Dictionary<ParameterDefinition, string> parameterDefinitionToNameMap,
     HashSet<VariableDefinition> variablesToRename, Dictionary<FieldDefinition, Expression> fieldToExpression,
     int lambdaVariablesCount, Dictionary<VariableDefinition, AssignmentType> variableAssignmentData, List<ParameterDefinition> outParametersToAssign,
     bool isDestructor, BlockStatement destructorStatements, HashSet<VariableDefinition> undeclaredLinqVariables,
     Dictionary<VariableReference, Dictionary<FieldDefinition, Expression>> closureVariableToFieldValue,
     HashSet<VariableDefinition> variablesToNotDeclare)
 {
     this.AnalysisResults = analysisResults;
     this.YieldData = yieldData;
     this.AsyncData = asyncData;
     this.IsMethodBodyChanged = isMethodBodyChanged;
     this.GotoLabels = gotoLabels;
     this.GotoStatements = gotoStatements;
     this.StackData = stackData;
     this.IsBaseConstructorInvokingConstructor = isBaseConstructorInvokingConstructor;
     this.EnableEventAnalysis = enableEventAnalysis;
     this.Body = body;
     this.Variables = variables;
     this.ControlFlowGraph = controlFlowGraph;
     this.Expressions = expressions;
     this.LogicalConstructsTree = logicalConstructsTree;
     this.LogicalConstructsContext = logicalConstructsContext;
     this.CtorInvokeExpression = ctorInvokeExpression;
     this.StatementToLogicalConstruct = statementToLogicalConstruct;
     this.LogicalConstructToStatements = logicalConstructToStatements;
     this.VariableDefinitionToNameMap = variableDefinitionToNameMap;
     this.VariableNamesCollection = variableNamesCollection;
     this.ParameterDefinitionToNameMap = parameterDefinitionToNameMap;
     this.VariablesToRename = variablesToRename;
     this.FieldToExpression = fieldToExpression;
     this.LambdaVariablesCount = lambdaVariablesCount;
     this.VariableAssignmentData = variableAssignmentData;
     this.OutParametersToAssign = outParametersToAssign;
     this.IsDestructor = isDestructor;
     this.DestructorStatements = destructorStatements;
     this.UndeclaredLinqVariables = undeclaredLinqVariables;
     this.ClosureVariableToFieldValue = closureVariableToFieldValue;
     this.VariablesToNotDeclare = variablesToNotDeclare;
 }
Esempio n. 4
0
 internal static BlockStatement DecompileYieldStateMachine(this MethodBody body, DecompilationContext enclosingContext, out YieldData yieldData)
 {
     stackVariable0 = body;
     stackVariable1 = enclosingContext;
     stackVariable2 = new RemoveYieldStateMachineStep();
     stackVariable3 = Extensions.u003cu003ec.u003cu003e9__7_0;
     if (stackVariable3 == null)
     {
         dummyVar0      = stackVariable3;
         stackVariable3 = new Func <DecompilationContext, IStateMachineData>(Extensions.u003cu003ec.u003cu003e9.u003cDecompileYieldStateMachineu003eb__7_0);
         Extensions.u003cu003ec.u003cu003e9__7_0 = stackVariable3;
     }
     stackVariable5 = stackVariable0.DecompileStateMachine(stackVariable1, stackVariable2, stackVariable3, out V_0);
     yieldData      = V_0.get_MethodContext().get_YieldData();
     return(stackVariable5);
 }