Пример #1
0
 protected MethodContractSubroutine(SubroutineFacade subroutineFacade,
                                    Method method,
                                    SimpleSubroutineBuilder <Label> builder,
                                    Label startLabel) : base(subroutineFacade, startLabel, builder)
 {
     this.method = method;
 }
Пример #2
0
 protected SubroutineBase(SubroutineFacade subroutineFacade)
 {
     this.SubroutineFacade = subroutineFacade;
     this.entry            = new EntryBlock <Label> (this, ref this.BlockIdGenerator);
     this.exit             = new EntryExitBlock <Label> (this, ref this.BlockIdGenerator);
     this.exception_exit   = new CatchFilterEntryBlock <Label> (this, ref this.BlockIdGenerator);
 }
Пример #3
0
 public EnsuresSubroutine(SubroutineFacade subroutineFacade,
                          Method method, IImmutableSet <Subroutine> inherited) : base(subroutineFacade, method)
 {
     this.inferred_old_label_reverse_map = new Dictionary <int, Pair <CFGBlock, TypeNode> > ();
     AddSuccessor(Entry, EdgeTag.Entry, Exit);
     AddBaseEnsures(Entry, Exit, inherited);
     Commit();
 }
Пример #4
0
 public EnsuresSubroutine(SubroutineFacade subroutineFacade,
                          Method method,
                          SimpleSubroutineBuilder <Label> builder, Label startLabel, IImmutableSet <Subroutine> inherited)
     : base(subroutineFacade, method, builder, startLabel)
 {
     this.inferred_old_label_reverse_map = new Dictionary <int, Pair <CFGBlock, TypeNode> > ();
     AddBaseEnsures(Entry, GetTargetBlock(startLabel), inherited);
 }
Пример #5
0
 public SimpleSubroutine(int stackDelta, SubroutineFacade subroutineFacade,
                         Label startLabel, SimpleSubroutineBuilder <Label> builder)
     : base(subroutineFacade, startLabel, builder)
 {
     this.stack_delta = stackDelta;
     builder.BuildBlocks(startLabel, this);
     Commit();
 }
Пример #6
0
 public RequiresSubroutine(SubroutineFacade subroutineFacade,
                           Method method,
                           SimpleSubroutineBuilder <TLabel> builder,
                           TLabel entryLabel,
                           IImmutableSet <Subroutine> inheritedRequires)
     : base(subroutineFacade, method, builder, entryLabel)
 {
     AddBaseRequires(this.GetTargetBlock(entryLabel), inheritedRequires);
 }
Пример #7
0
 public RequiresSubroutine(SubroutineFacade subroutineFacade,
                           Method method,
                           IImmutableSet <Subroutine> inherited)
     : base(subroutineFacade, method)
 {
     AddSuccessor(Entry, EdgeTag.Entry, Exit);
     AddBaseRequires(Exit, inherited);
     Commit();
 }
Пример #8
0
        protected SubroutineBase(SubroutineFacade SubroutineFacade,
                                 Label startLabel, SubroutineBuilder <Label> builder)
            : this(SubroutineFacade)
        {
            this.StartLabel           = startLabel;
            Builder                   = builder;
            CodeProvider              = builder.CodeProvider;
            this.entry_after_requires = GetTargetBlock(startLabel);

            AddSuccessor(this.entry, EdgeTag.Entry, this.entry_after_requires);
        }
Пример #9
0
        public MethodSubroutine(SubroutineFacade SubroutineFacade,
                                Method method, Label startLabel,
                                SubroutineWithHandlersBuilder <Label, Handler> builder) : base(SubroutineFacade, startLabel, builder)
        {
            this.method = method;
            IMetaDataProvider metaDataProvider = this.SubroutineFacade.MetaDataProvider;

            builder.BuildBlocks(startLabel, this);
            BlockWithLabels <Label> targetBlock = GetTargetBlock(startLabel);

            Commit();

            TypeNode   type      = metaDataProvider.DeclaringType(method);
            Subroutine invariant = this.SubroutineFacade.GetInvariant(type);

            if (invariant != null && !metaDataProvider.IsConstructor(method) && !metaDataProvider.IsStatic(method))
            {
                AddEdgeSubroutine(Entry, targetBlock, invariant, EdgeTag.Entry);
                Subroutine requires = this.SubroutineFacade.GetRequires(method);
                if (requires != null)
                {
                    AddEdgeSubroutine(Entry, targetBlock, requires, EdgeTag.Entry);
                }
            }
            else
            {
                AddEdgeSubroutine(Entry, targetBlock, this.SubroutineFacade.GetRequires(method), EdgeTag.Entry);
            }

            if (this.blocks_ending_in_return_point == null)
            {
                return;
            }

            Subroutine ensures = this.SubroutineFacade.GetEnsures(method);
            bool       putInvariantAfterExit = !metaDataProvider.IsStatic(method) &&
                                               !metaDataProvider.IsFinalizer(method) && !metaDataProvider.IsDispose(method);

            foreach (var block in this.blocks_ending_in_return_point)
            {
                if (putInvariantAfterExit)
                {
                    AddEdgeSubroutine(block, Exit, invariant, EdgeTag.Exit);
                }
                AddEdgeSubroutine(block, Exit, ensures, EdgeTag.Exit);
            }

            if (ensures != null)
            {
                throw new NotImplementedException();
            }

            this.blocks_ending_in_return_point = null;
        }
 protected FaultFinallySubroutineBase(SubroutineFacade subroutineFacade, Label startLabel, SubroutineBuilder <Label> builder)
     : base(subroutineFacade, startLabel, builder)
 {
 }
Пример #11
0
 protected MethodContractSubroutine(SubroutineFacade subroutineFacade,
                                    Method method) : base(subroutineFacade)
 {
     this.method = method;
 }
Пример #12
0
 public MethodSubroutine(SubroutineFacade subroutineFacade, Method method)
     : base(subroutineFacade)
 {
     this.method = method;
 }
Пример #13
0
 public OldValueSubroutine(SubroutineFacade subroutineFacade, Method method,
                           SimpleSubroutineBuilder <TLabel> builder, TLabel startLabel)
     : base(subroutineFacade, method, builder, startLabel)
 {
 }
Пример #14
0
 protected SubroutineWithHandlers(SubroutineFacade subroutineFacade,
                                  Label startLabel,
                                  SubroutineBuilder <Label> builder)
     : base(subroutineFacade, startLabel, builder)
 {
 }
Пример #15
0
 protected SubroutineWithHandlers(SubroutineFacade subroutineFacade)
     : base(subroutineFacade)
 {
 }
Пример #16
0
 public FaultSubroutine(SubroutineFacade subroutineFacade, Label startLabel,
                        SubroutineBuilder <Label> builder) : base(subroutineFacade, startLabel, builder)
 {
 }