internal WorkerThread(CodeAssembly asm) { Assembly = asm; Module = asm.GetRootModule(); CallStack = new CallStack(); Context = new ExecutionContext(); }
internal CompiledAssembly(Document rootDoc, CodeAssembly asm) { Assembly = asm; Units = Assembly.EnumerateModules() .Select(n => Assembly.GetModule(Assembly.GetModuleHandle(n))) .Select(m => new CompiledUnit(new VirtualDocument(m.File), m)) .ToList(); var root = Assembly.GetRootModule(); MainUnit = new CompiledUnit(rootDoc, root); }
internal LinkerResult(CodeAssembly asm, bool success, IEnumerable <ElaMessage> messages) : base(success, messages) { Assembly = asm; }
internal ElaDebugger(CodeAssembly asm) { Assembly = asm; }
internal LinkerResult(CodeAssembly asm, bool success, IEnumerable<ElaMessage> messages) : base(success, messages) { Assembly = asm; }
//GIT private static void Warmup(CodeAssembly asm) { helper.PrintExecuteFirstTime(); new ElaMachine(asm).Run(); helper.PrintExecuteSecondTime(); }
private static int Execute(CodeAssembly asm, bool interactive) { var mod = asm.GetRootModule(); if (opt.ShowEil) { var gen = new EilGenerator(mod); Console.WriteLine("EIL ({0}-{1}):", lastOffset, mod.Ops.Count - 1); Console.Write(gen.Generate(lastOffset)); lastOffset = mod.Ops.Count; } else if (opt.ShowSymbols != SymTables.None) { var gen = new DebugReader(mod.Symbols); helper.PrintSymTables(gen); lastOffset = mod.Ops.Count; } else { try { if (vm == null) vm = new ElaMachine(asm); else { vm.RefreshState(); vm.Recover(); } if (opt.ShowTime && !interactive) Warmup(asm); //GIT var os = lastOffset; lastOffset = mod.Ops.Count; var sw = new Stopwatch(); sw.Start(); var exer = vm.Run(os); sw.Stop(); if (opt.ShowTime && !interactive) Console.WriteLine("Execution time: {0}", sw.Elapsed); if (exer.ReturnValue.TypeCode != ElaTypeCode.None && exer.ReturnValue.TypeCode != ElaTypeCode.Unit) Console.WriteLine(vm.PrintValue(exer.ReturnValue)); } catch (ElaException ex) { helper.PrintError(ex.ToString()); return R_ERR; } } return R_OK; }
internal virtual ElaValue Untag(CodeAssembly asm, ExecutionContext ctx, int index) { ctx.Fail(new ElaError(ElaRuntimeError.InvalidTypeArgument, "<>", GetTypeName(), index + 1)); return Default(); }