internal ZCompilerResult(ZRoutine routine, ZRoutineCall[] calls, ZRoutineCode code, RoutineCompilationStatistics statistics) { if (routine == null) { throw new ArgumentNullException("routine"); } if (calls == null) { throw new ArgumentNullException("calls"); } if (code == null) { throw new ArgumentNullException("code"); } if (statistics == null) { throw new ArgumentNullException("statistics"); } this.Routine = routine; this.Calls = calls; this.Code = code; this.Statistics = statistics; }
public VariableView GetViewForLocal(ZRoutine routine, int localIndex) { var index = new KeyValuePair <int, int>(routine.Address, localIndex); VariableView result = null; localsViews.TryGetValue(index, out result); return(result); }
private static DynamicMethod CreateDynamicMethod(ZRoutine routine) { return(new DynamicMethod( name: string.Format("{0:x4}_{1}_locals", routine.Address, routine.Locals.Length), returnType: typeof(ushort), parameterTypes: Types.Array <CompiledZMachine, byte[], ushort[], ushort[], int, ZRoutineCall[], int>(), owner: typeof(CompiledZMachine), skipVisibility: true)); }
private ControlFlowGraph(ZRoutine routine) { this.routine = routine; this.entry = new Block(isEntry: true); this.exit = new Block(isExit: true); var instructions = new InstructionLinkedList(routine); this.codeBlocks = new List <CodeBlock>(BuildGraph(instructions)); }
public InstructionLinkedList(ZRoutine routine) : base(routine.Instructions) { this.addressToNodeMap = new IntegerMap <LinkedListNode <Instruction> >(); var node = this.First; while (node != null) { addressToNodeMap.Add(node.Value.Address, node); node = node.Next; } }
internal ZCompilerResult Compile(ZRoutine routine) { ZCompilerResult result; if (!compilationResults.TryGetValue(routine.Address, out result)) { result = ZCompiler.Compile(routine, machine: this); compilationResults.Add(routine.Address, result); if (profiler != null) { profiler.RoutineCompiled(result.Statistics); } } return(result); }
internal RoutineCompilationStatistics( ZRoutine routine, int opcodeCount, int localCount, int size, TimeSpan compileTime, int calculatedLoadVariableCount, int calculatedStoreVariableCount, List <InstructionStatistics> instructionSizes) { this.routine = routine; this.opcodeCount = opcodeCount; this.localCount = localCount; this.size = size; this.compileTime = compileTime; this.calculatedLoadVariableCount = calculatedLoadVariableCount; this.calculatedStoreVariableCount = calculatedStoreVariableCount; this.instructionSizes = new ReadOnlyCollection <InstructionStatistics>(instructionSizes); }
internal ushort[] GetLocalArray(ZRoutine routine) { var result = localArrayPool.Count > 0 ? localArrayPool.Pop() : new ushort[15]; if (Version < 5) { var localCount = routine.Locals.Length; for (int i = 0; i < localCount; i++) { var localValue = routine.Locals[i]; if (localValue > 0) { result[i] = localValue; } } } return(result); }
public ZRoutineCall(ZRoutine routine, CompiledZMachine machine) { this.Machine = machine; this.Routine = routine; }
public static ZCompilerResult Compile(ZRoutine routine, CompiledZMachine machine) { return(new ZCompiler(routine, machine).Compile()); }
private ZCompiler(ZRoutine routine, CompiledZMachine machine, bool debugging = false) { this.routine = routine; this.machine = machine; this.debugging = debugging; }
public DisassemblyRoutineHeaderLineViewModel(ZRoutine routine) { this.routine = routine; }
public static ControlFlowGraph Build(ZRoutine routine) { return(new ControlFlowGraph(routine)); }
public void SetViewForLocal(ZRoutine routine, int localIndex, VariableView view) { SetViewForLocal(routine.Address, localIndex, view); }
public RoutineNameChangedEventArgs(ZRoutine routine) { this.routine = routine; }
public DisassemblyAddressGapLineViewModel(ZRoutine start, ZRoutine end) { this.start = start; this.end = end; }