/// <summary> /// /// </summary> /// <returns></returns> public IMethodBody MinimizeLocals() { //First eliminate redundant store load pairs //now run a post order traversal of blocks, and a reverse traversal of instructions in each block. Once a write to an SSA local is processed, return its //minimized local to a pool of available locals. var methodBody = this.cdfg.MethodBody; var ilGenerator = new ILGenerator(host, methodBody.MethodDefinition); var converter = new ILConverter(this.cdfg, ilGenerator, this.localScopeProvider, this.sourceLocationProvider); converter.PopulateILGenerator(); return(new ILGeneratorMethodBody(ilGenerator, methodBody.LocalsAreZeroed, converter.MaxStack, methodBody.MethodDefinition, converter.Locals.AsReadOnly(), Enumerable <ITypeDefinition> .Empty)); }
public Benchmarks() { _testClass = new TestClass { String = "Hello, World!", Int = 1234, SomeIntegers = new[] { 1, 2, 8, 9, 20, 15 }, LongInt = 1106300L, UltraLongInt = 11063002uL, Identifier = 0xFF, SuperUselessByte = 0x0A, }; _data = DConverter <TestClass> .Serialize(_testClass); _pm = new ProtocolMessage.ProtocolMessageManager(); if (!(new ConverterContainer().RequestConverter <TestClass>() is ILConverter <TestClass> ilConv)) { throw new Exception($"IL is not fully spported for the benchmarks yet."); } _tc = ilConv; foreach (var benchmark in GetType() .GetMethods() .Where(x => x.GetCustomAttributes(true) .OfType <BenchmarkAttribute>() .Count() > 0)) { benchmark.Invoke(this, null); } }
public static bool TryGetILConverter(OpCode opCode, out ILConverter ilc) => ilConverters.TryGetValue(opCode, out ilc);
public ILBody(Label label, ILConverter ilc, ICodeInformation code) { this.Label = label; this.ILConverter = ilc; this.Code = code; }
public void Reset() { il_converter = null; }
private ILConverter il_converter; //=new NETGenerator.ILConverter(); public void Compile(IProgramNode ProgramTree, string TargetFileName, string SourceFileName, CompilerOptions options, Hashtable StandartDirectories, string[] ResourceFiles) { il_converter = new ILConverter(StandartDirectories); il_converter.ConvertFromTree(ProgramTree, TargetFileName, SourceFileName, options, ResourceFiles); }
public ILBody(Label label, ILConverter ilc, object operand) { this.Label = label; this.ILConverter = ilc; this.Operand = operand; }
public static void Main(string[] args) { WriteLine($"from ast import *\nroot = {ILConverter.Convert(typeof(PsxCpu)).ToPython()}"); }
public static bool TryGetILConverter(OpCode opCode, out ILConverter ilc) { return(ilConverters.TryGetValue(opCode, out ilc)); }