Beispiel #1
0
 private void replaceNodeByPop(Node node)
 {
     BasicBlock block = node.Options[BasicBlock.BASIC_BLOCK_OPTION] as BasicBlock;
     Node n = newRemoveStackTop(block);
     block.Body[block.Body.IndexOf(node)] = n;
     node.ReplaceByNode(n);
     n.Next = node.Next;
 }
Beispiel #2
0
        protected override void DispatchNode(Node upNode, object o)
        {
            State state = this.upDownNodes.GetState(upNode);
            Node downNode = this.upDownNodes[upNode];
            LiftTask task = o as LiftTask;

            if (task is StackLiftTask)
            {
                int depth = (task as StackLiftTask).Depth;
                for (int i = 0; i < depth; i++)
                    if ((state.Stack[i] as BTValue).BTType == BTType.Dynamic)
                    {
                        foreach (Node prevUp in upNode.PrevArray)
                        {
                            DepthContainer cnt = new DepthContainer(depth);
                            this.CallVisitorMethod(prevUp, cnt);
                            this.AddTask(prevUp, new StackLiftTask(cnt.Depth));
                        }
                        upNode.ReplaceByNode(null);
                        goto CleanGraph;
                    }
            }

            Node liftUp = new Lift(task);
            this.upDownNodes.SetUpAndDownNode(downNode, state, liftUp);
            this.aVisitor.AddTask(liftUp, state);
            upNode.ReplaceByNode(liftUp);

            CleanGraph:
                this.cVisitor.CleanGraph();
        }