Esempio n. 1
0
        public JSRuntime(JSRuntimeConfiguration configuration)
            : base(configuration)
        {
            //We need to first set the Instance since the rest may use it!
            JSRuntime.Instance = this;

#if DEBUG
            if (configuration.EnableCodeDump)
            {
                var scriptFileName = "__Debug.js";
                if (configuration.ScriptFileNames.Count > 0)
                {
                    scriptFileName = configuration.ScriptFileNames[0];
                }

                AsmGenerator = new ILGen.CppAsmGenerator(scriptFileName, configuration.OutputDir);
            }
            else if (configuration.EnableDiagIL)
            {
                AsmGenerator = new ILGen.CppAsmGenerator();// CodeAsmGenerator();
            }
            else
#endif
            AsmGenerator = new ILGen.DynamicAsmGenerator();

            AsmGenerator.BeginAssembly();
        }
Esempio n. 2
0
        public JSEngine(JSRuntimeConfiguration configuration)
            : base(configuration)
        {
            if ((configuration.EnableCounters || configuration.EnableTimers) && configuration.ProfilerOutput != null)
            {
                using (var output = File.CreateText(configuration.ProfilerOutput))
                {
                    output.WriteLine("<Results>");
                    output.WriteLine("  <JSArgs>{0}</JSArgs>", string.Join(" ", configuration.Arguments));
                }
            }
            int minWorker, minIOC;

            System.Threading.ThreadPool.GetMinThreads(out minWorker, out minIOC);
            System.Threading.ThreadPool.SetMinThreads(4, minIOC);
        }