コード例 #1
0
        public override bool Branch(Label pc, Label target, bool leavesExceptionBlock, BlockWithLabels <Label> currentBlock)
        {
            currentBlock.AddLabel(pc);
            CurrentSubroutine.AddSuccessor(currentBlock, EdgeTag.Branch, CurrentSubroutine.GetTargetBlock(target));

            return(true);
        }
コード例 #2
0
        public override bool Return(Label pc, Dummy source, BlockWithLabels <Label> currentBlock)
        {
            currentBlock.AddLabel(pc);
            CurrentSubroutine.AddSuccessor(currentBlock, EdgeTag.Return, CurrentSubroutine.Exit);
            CurrentSubroutine.AddReturnBlock(currentBlock);

            return(true);
        }
コード例 #3
0
        private bool HandleConditionalBranch(Label pc, Label target, bool isTrueBranch, BlockWithLabels <Label> currentBlock)
        {
            currentBlock.AddLabel(pc);
            EdgeTag trueTag  = isTrueBranch ? EdgeTag.True : EdgeTag.False;
            EdgeTag falseTag = isTrueBranch ? EdgeTag.False : EdgeTag.True;

            AssumeBlock <Label> trueBlock = CurrentSubroutine.NewAssumeBlock(pc, trueTag);

            this.builder.RecordInformationSameAsOtherBlock(trueBlock, this.current_block);
            CurrentSubroutine.AddSuccessor(currentBlock, trueTag, trueBlock);
            CurrentSubroutine.AddSuccessor(trueBlock, EdgeTag.FallThrough, CurrentSubroutine.GetTargetBlock(target));

            AssumeBlock <Label> falseBlock = CurrentSubroutine.NewAssumeBlock(pc, falseTag);

            this.builder.RecordInformationSameAsOtherBlock(falseBlock, this.current_block);
            CurrentSubroutine.AddSuccessor(currentBlock, falseTag, falseBlock);
            this.current_block = falseBlock;

            return(false);
        }
コード例 #4
0
 public override bool EndFinally(Label pc, BlockWithLabels <Label> currentBlock)
 {
     currentBlock.AddLabel(pc);
     CurrentSubroutine.AddSuccessor(currentBlock, EdgeTag.EndSubroutine, CurrentSubroutine.Exit);
     return(true);
 }
コード例 #5
0
 public override bool Rethrow(Label pc, BlockWithLabels <Label> currentBlock)
 {
     currentBlock.AddLabel(pc);
     return(true);
 }
コード例 #6
0
 public override bool Throw(Label pc, Dummy exception, BlockWithLabels <Label> currentBlock)
 {
     currentBlock.AddLabel(pc);
     return(true);
 }
コード例 #7
0
 public override bool DefaultVisit(Label pc, BlockWithLabels <Label> currentBlock)
 {
     currentBlock.AddLabel(pc);
     return(false);
 }