コード例 #1
0
        public override BoundNode VisitSpillBlock(BoundSpillBlock node)
        {
            var newStatements = ArrayBuilder <BoundStatement> .GetInstance();

            spillFieldAllocator.AllocateFields(node.SpillTemps);

            newStatements.AddRange(VisitList(node.Statements));

            // Release references held by the spill temps:
            foreach (var spill in node.SpillTemps)
            {
                if (spill.Type.IsManagedType)
                {
                    var field = spillFieldAllocator.GetField(spill);
                    newStatements.Add(F.Assignment(F.Field(F.This(), field), F.NullOrDefault(field.Type)));
                }

                spillFieldAllocator.Free(spill);
            }

            return(F.Block(node.Locals, newStatements.ToReadOnlyAndFree()));
        }
        public override BoundNode VisitSpillBlock(BoundSpillBlock node)
        {
            var newStatements = ArrayBuilder<BoundStatement>.GetInstance();

            spillFieldAllocator.AllocateFields(node.SpillTemps);

            newStatements.AddRange(VisitList(node.Statements));

            // Release references held by the spill temps:
            foreach (var spill in node.SpillTemps)
            {
                if (spill.Type.IsManagedType)
                {
                    var field = spillFieldAllocator.GetField(spill);
                    newStatements.Add(F.Assignment(F.Field(F.This(), field), F.NullOrDefault(field.Type)));
                }

                spillFieldAllocator.Free(spill);
            }

            return F.Block(node.Locals, newStatements.ToReadOnlyAndFree());
        }
コード例 #3
0
 public override BoundNode VisitSpillBlock(BoundSpillBlock node)
 {
     throw Contract.Unreachable;
 }