protected override void EmitInstruction(InstructionNode node, BaseCodeEmitter codeEmitter) { long start = codeEmitter.CurrentPosition; base.EmitInstruction(node, codeEmitter); long end = codeEmitter.CurrentPosition; var instruction = simAdapter.Convert(node, MethodCompiler.Method, BasicBlocks, (byte)(end - start)); if (instruction != null) { simLinker.AddInstruction(symbol, start, instruction); } simLinker.AddSourceInformation(symbol, start, node.SlotNumber.ToString() + "\t0x" + node.SlotNumber.ToString("X") + "\t" + node.Block.ToString() + "\t" + symbol + "\t" + node.ToString()); }
/// <summary> /// Logs the instructions in the given enumerable to the trace. /// </summary> /// <param name="traceLog">The trace log.</param> /// <param name="node">The context.</param> private static void LogInstructions(TraceLog traceLog, InstructionNode node) { for (; !node.IsBlockEndInstruction; node = node.Next) { if (node.IsEmpty) continue; traceLog.Log(node.ToString()); if (node.IsBlockEndInstruction) return; } }
/// <summary> /// Emits the specified platform instruction. /// </summary> /// <param name="node">The context.</param> /// <param name="emitter">The emitter.</param> protected override void Emit(InstructionNode node, MachineCodeEmitter emitter) { Debug.Assert(node.Result == node.Operand1, node.ToString()); OpCode opCode = ComputeOpCode(node.Result, node.Operand1, node.Operand2); emitter.Emit(opCode, node.Result, node.Operand2); }