Inheritance: System.Compiler.Block
Exemplo n.º 1
0
 private AtomicBlock VisitAtomic(AtomicBlock atomic)
 {
     WriteStart("atomic");
     return (AtomicBlock)this.VisitBlock((Block)atomic);
 }
Exemplo n.º 2
0
 private AtomicBlock VisitAtomic(AtomicBlock atomic)
 {
     return (AtomicBlock)this.VisitBlock((Block)atomic);
 }
Exemplo n.º 3
0
        private AtomicBlock VisitAtomic(AtomicBlock atomic)
        {
            Debug.Assert(!insideAtomicBlock);

            // Create a block to cause the current atomic block to end. The atomicity
            // level brings us to this block atomically. We do nothing here, but our
            // atomicity level goes back to zero, so we get a state transition at the
            // end of this empty block.
            BasicBlock exitBlock = AddBlock(new BasicBlock(null, CurrentContinuation));
            CurrentContinuation = exitBlock;

            insideAtomicBlock = true;
            this.VisitBlock((Block)atomic);
            insideAtomicBlock = false;

            // The following test is needed in case the atomic block does not have any statements
            // in it. In that case, CurrentContinuation is the block following the atomic block.
            if (CurrentContinuation.RelativeAtomicLevel > 0)
            {
                CurrentContinuation.IsAtomicEntry = true;
            }

            return atomic;
        }
Exemplo n.º 4
0
 private AtomicBlock VisitAtomic(AtomicBlock atomic)
 {
     if (atomic == null) return null;
     AtomicBlock result = (AtomicBlock)this.VisitBlock(atomic);
     return result;
 }
Exemplo n.º 5
0
        private Block VisitAtomic(AtomicBlock atomic)
        {
            Block newAtomic = null;
            if (atomic == null) return null;

            if (((ZMethod)this.currentMethod).Atomic)
            {
                this.HandleError(atomic, Error.AtomicBlockInAtomicMethod);
                return null;
            }

            if (this.insideAtomic)
            {
                this.HandleError(atomic, Error.AtomicBlockNested);
                return null;
            }

            this.insideAtomic = true;
            newAtomic = this.VisitBlock((Block)atomic);
            this.insideAtomic = false;

            return newAtomic;
        }