public ILInstruction(InstructionKind kind, OpCode opCode, ILInstructionParameter parameter, ILInstructionComment comment) { Kind = kind; OpCode = opCode; Parameter = parameter; Comment = comment; }
public static void Mutate(OpCode opCode, GroboIL il, ILInstructionParameter parameter, ref EvaluationStack stack) { StackMutator stackMutator; if (opCode.Size == 0) { stackMutator = markLabelStackMutator; } else if (!stackMutators.TryGetValue(opCode, out stackMutator)) { throw new NotSupportedException("OpCode '" + opCode + "' is not supported"); } stackMutator.Mutate(il, parameter, ref stack); }
public int Append(OpCode opCode, ILInstructionParameter parameter, ILInstructionComment comment) { var lastInstructionPrefix = Count > 0 ? instructions[Count - 1] as ILInstructionPrefix : null; if (lastInstructionPrefix == null) { instructions.Add(new ILInstruction(InstructionKind.Instruction, opCode, parameter, comment)); return(Count++); } instructions[Count - 1] = new ILInstruction(InstructionKind.Instruction, opCode, parameter, comment) { Prefixes = lastInstructionPrefix.Prefixes }; return(Count - 1); }
public int AppendPrefix(OpCode prefix, ILInstructionParameter parameter) { var lastInstructionPrefix = instructions[Count - 1] as ILInstructionPrefix; if (lastInstructionPrefix != null) { lastInstructionPrefix.Prefixes.Add(new KeyValuePair <OpCode, ILInstructionParameter>(prefix, parameter)); return(Count - 1); } instructions.Add(new ILInstructionPrefix { Prefixes = new List <KeyValuePair <OpCode, ILInstructionParameter> > { new KeyValuePair <OpCode, ILInstructionParameter>(prefix, parameter) } }); return(Count++); }
public abstract void Mutate(GroboIL il, ILInstructionParameter parameter, ref EvaluationStack stack);