Пример #1
0
        public MosaMethod CompileMethod(MosaMethod method, int threadID = 0)
        {
            lock (method)
            {
                CompileMethod(method, null, threadID);
            }

            CompilerTrace.UpdatedCompilerProgress(
                CompilationScheduler.TotalMethods,
                CompilationScheduler.TotalMethods - CompilationScheduler.TotalQueuedMethods);

            return(method);
        }
Пример #2
0
        private MosaMethod CompileMethod(MosaMethod method, int threadID)
        {
            if (method.IsCompilerGenerated)
            {
                return(method);
            }

            lock (method)
            {
                CompileMethod(method, null, threadID);
            }

            CompilerTrace.UpdatedCompilerProgress(
                MethodScheduler.TotalMethods,
                MethodScheduler.TotalMethods - MethodScheduler.TotalQueuedMethods);

            return(method);
        }
Пример #3
0
        private void ExecuteCompilePass()
        {
            while (true)
            {
                var method = CompilationScheduler.GetMethodToCompile();

                if (method == null)
                {
                    return;
                }

                CompileMethod(method, null, 0);

                CompilerTrace.UpdatedCompilerProgress(
                    CompilationScheduler.TotalMethods,
                    CompilationScheduler.TotalMethods - CompilationScheduler.TotalQueuedMethods
                    );
            }
        }
Пример #4
0
        private void CompileWorker(int threadID)
        {
            while (true)
            {
                var method = CompilationScheduler.GetMethodToCompile();

                if (method == null)
                {
                    return;
                }

                // only one method can be compiled at a time
                lock (method)
                {
                    CompileMethod(method, null, threadID);
                }

                CompilerTrace.UpdatedCompilerProgress(CompilationScheduler.TotalMethods, CompilationScheduler.TotalMethods - CompilationScheduler.TotalQueuedMethods);
            }
        }