예제 #1
0
        public List <InstructionNode> Run()
        {
            int  runCounter  = 0;
            bool shouldRerun = true;
            bool isFirstRun  = true;

            BranchProperties.BaseBranch.AddTwoWay(InstructionNodes);
            SetInstructionIndexes();
            while (shouldRerun)
            {
                Console.WriteLine("run counter is " + runCounter);
                _programFlowManager.AddFlowConnections(InstructionNodes);
                if (isFirstRun)
                {
                    try
                    {
                        _backTraceManager.DataTraceInFunctionBounds(InstructionNodes);
                    }
                    catch (StackPopException stackPopException)
                    {
                        return(stackPopException.problematicRoute);
                    }
                }

                InlineFunctionCalls();
                SetInstructionIndexes();

                TraceDynamicData();

                bool shouldRunDynamicTrace;
                //MergeSingleOperationNodes();
                ResolveVirtualMethods(out shouldRerun, out shouldRunDynamicTrace);
                //shouldRerun = false;

                //SetInstructionIndexes();
                isFirstRun = false;
                runCounter++;
            }
            RecursionFix();
            RemoveHelperCodes();
            //RemoveAndStitchDynamicDataConnections();

            _backTraceManager.ForwardDynamicData(InstructionNodes);
            MergeSimilarInstructions();
            MergeEquivilentPairs();
            BranchProperties.BaseBranch.RemoveAllTwoWay();
            //Verify();
            return(InstructionNodes);
        }