Schedules compilation of types/methods.
Example #1
0
        public void Load(TypeSystem typeSystem)
        {
            TypeSystem = typeSystem;

            TypeLayout = new MosaTypeLayout(typeSystem, CompilerOptions.Architecture.NativePointerSize, CompilerOptions.Architecture.NativeAlignment);

            CompilationScheduler = new CompilationScheduler();
        }
Example #2
0
        public void ExecuteCompile()
        {
            ExecuteCompilePass();

            while (CompilationScheduler.StartNextPass())
            {
                ExecuteCompilePass();
            }
        }
Example #3
0
        public void ExecuteThreadedCompile(int threads)
        {
            ExecuteThreadedCompilePass(threads);

            while (CompilationScheduler.StartNextPass())
            {
                ExecuteThreadedCompilePass(threads);
            }
        }
Example #4
0
        private MosaMethod CompilerMethodInQueue(int threadID = 0)
        {
            var method = CompilationScheduler.GetMethodToCompile();

            if (method == null)
            {
                return(null);
            }

            return(CompileMethod(method, threadID));
        }
Example #5
0
        public void ScheduleAll()
        {
            //HACK - for debugging
            // Mosa.Platform.Internal.x86.Runtime::GetProtectedRegionEntryByAddress
            //var type = TypeSystem.GetTypeByName("Mosa.Platform.Internal.x86", "Runtime");
            //var method = type.FindMethodByName("GetProtectedRegionEntryByAddress");
            //CompilationScheduler.Schedule(method);
            //ENDHACK

            CompilationScheduler.ScheduleAll(TypeSystem);
        }
Example #6
0
        public void Load(TypeSystem typeSystem)
        {
            lock (_lock)
            {
                //if (Stage != CompileStage.Initial)
                //	return;

                TypeSystem = typeSystem;
                TypeLayout = new MosaTypeLayout(typeSystem, CompilerOptions.Architecture.NativePointerSize, CompilerOptions.Architecture.NativeAlignment);

                Linker   = null;
                Compiler = null;

                CompilationScheduler = new CompilationScheduler();

                Stage = CompileStage.Loaded;
            }
        }
Example #7
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
                    );
            }
        }
Example #8
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);
            }
        }
Example #9
0
 public void Schedule(MosaMethod method)
 {
     CompilationScheduler.Schedule(method);
 }
Example #10
0
 public void Schedule(MosaType type)
 {
     CompilationScheduler.Schedule(type);
 }
Example #11
0
 public void ScheduleAll()
 {
     CompilationScheduler.ScheduleAll(TypeSystem);
 }
Example #12
0
        public void Load(TypeSystem typeSystem)
        {
            TypeSystem = typeSystem;

            TypeLayout = new MosaTypeLayout(typeSystem, CompilerOptions.Architecture.NativePointerSize, CompilerOptions.Architecture.NativeAlignment);

            CompilationScheduler = new CompilationScheduler();
        }