Пример #1
0
 public override CodeNode VisitSkipAssignmentIfFlagSet(SkipAssignmentIfFlagSetNode node)
 {
     _Writer.WriteStartElement("SkipAssignmentIfFlagSet");
     _Writer.WriteAttributeString("FlagFieldIndex", node.FlagFieldIndex.ToString());
     _Writer.WriteAttributeString("FlagMask", string.Format("0x{0:x}", node.FlagMask));
     _Writer.WriteEndElement();
     return(node);
 }
Пример #2
0
        public override CodeNode VisitSkipAssignmentIfFlagSet(SkipAssignmentIfFlagSetNode node)
        {
            if (!_InFieldAssignment)
            {
                throw new InvalidOperationException("SkipAssignmentIfFlagSetNode must be in a FieldAssignmentNode");
            }
            //get the flag field
            LocalBuilder flag = _FieldLocals[node.FlagFieldIndex];

            //TODO: assert that it's a byte?
            ILGen.Ldloc(flag);
            ILGen.Ldc_I4_S(node.FlagMask);
            ILGen.And();
            //skip assignment if the flag is set
            ILGen.Brtrue(_SkipAssignmentLabel);
            return(node);
        }
Пример #3
0
 public virtual CodeNode VisitSkipAssignmentIfFlagSet(SkipAssignmentIfFlagSetNode node)
 {
     return(node);
 }