Пример #1
0
        public void MarkLabel(Sigil.Label label)
        {
            InstructionSizes.Add(() => InstructionSize.MarkLabel());

            LengthCache.Clear();

            Buffer.Add(
                (il, logOnly, log) =>
            {
                if (!logOnly)
                {
                    var l = label.LabelDel(il);
                    il.MarkLabel(l);
                }

                log.AppendLine();
                log.AppendLine(label + ":");
            }
                );

            TraversableBuffer.Add(new BufferedILInstruction {
                MarksLabel = label
            });

            Operations.Add(null);
        }
Пример #2
0
        public void Emit(OpCode op, Sigil.Label label, out UpdateOpCodeDelegate update)
        {
            var localOp = op;

            update =
                newOpcode =>
            {
                LengthCache.Clear();

                localOp = newOpcode;
            };

            InstructionSizes.Add(() => InstructionSize.Get(localOp));

            LengthCache.Clear();

            Buffer.Add(
                (il, logOnly, log) =>
            {
                if (!logOnly)
                {
                    var l = label.LabelDel(il);
                    il.Emit(localOp, l);
                }

                log.AppendLine(localOp + " " + label);
            }
                );

            TraversableBuffer.Add(new BufferedILInstruction {
                IsInstruction = op
            });

            Operations.Add(new Operation <DelegateType> {
                OpCode = op, Parameters = new object[] { label }
            });
        }