public void Compile(bool skipFinalization = false) { Setup(); if (!CompilerSettings.MethodScanner) { ScheduleAll(); } lock (_lock) { if (Stage != CompileStage.Ready) { return; } Stage = CompileStage.Executing; } var maxThreads = CompilerSettings.MaxThreads != 0 ? CompilerSettings.MaxThreads : (int)(Environment.ProcessorCount * 1.2); Compiler.ExecuteCompile(maxThreads); lock (_lock) { Stage = CompileStage.Ready; } if (!skipFinalization) { Finalization(); } }
public void Compile(bool skipFinalization = false) { Setup(); if (!CompilerSettings.MethodScanner) { ScheduleAll(); } lock (_lock) { if (Stage != CompileStage.Ready) { return; } Stage = CompileStage.Executing; } Compiler.ExecuteCompile(); lock (_lock) { Stage = CompileStage.Ready; } if (!skipFinalization) { Finalization(); } }
protected void LoadAssembly(string filename, bool includeTestComponents, string platform) { Compiler.CompilerOptions.Architecture = GetArchitecture(cbPlatform.Text); var moduleLoader = new MosaModuleLoader(); if (includeTestComponents) { moduleLoader.AddPrivatePath(System.IO.Directory.GetCurrentDirectory()); moduleLoader.LoadModuleFromFile("mscorlib.dll"); moduleLoader.LoadModuleFromFile("Mosa.Platform.Internal." + platform + ".dll"); moduleLoader.LoadModuleFromFile("Mosa.Kernel.x86Test.dll"); } moduleLoader.AddPrivatePath(Path.GetDirectoryName(filename)); moduleLoader.LoadModuleFromFile(filename); var metadata = moduleLoader.CreateMetadata(); Compiler.Load(TypeSystem.Load(metadata)); UpdateTree(); Stage = CompileStage.Loaded; }
private void PreCompile() { if (Stage == CompileStage.Loaded) { SetCompilerOptions(); Compiler.Initialize(); Compiler.PreCompile(); Stage = CompileStage.PreCompiled; } }
public void LoadAssembly(string filename, string includeDirectory = null) { LoadAssembly(filename, cbPlatform.Text, includeDirectory); CreateTree(); Stage = CompileStage.Loaded; methodStore.Clear(); SetStatus("Assemblies Loaded!"); }
public void Initialize() { lock (_lock) { if (Stage != CompileStage.Loaded) { return; } Compiler = new Compiler(this); Stage = CompileStage.Initialized; } }
public void Load(TypeSystem typeSystem) { lock (_lock) { TypeSystem = typeSystem; Platform = PlatformRegistry.GetPlatform(CompilerSettings.Platform); TypeLayout = new MosaTypeLayout(typeSystem, Platform.NativePointerSize, Platform.NativeAlignment); Compiler = null; Stage = CompileStage.Loaded; } }
public void Finalization() { lock (_lock) { if (Stage != CompileStage.Ready) { return; } Compiler.Finalization(); Stage = CompileStage.Completed; } }
public void Setup() { Initialize(); lock (_lock) { if (Stage != CompileStage.Initialized) { return; } Compiler.Setup(); Stage = CompileStage.Ready; } }
private void CompileCompleted() { toolStrip1.Enabled = true; Stage = CompileStage.Compiled; SetStatus("Compiled!"); tabControl1.SelectedTab = tbStages; rbLog.Text = compileLog.ToString(); rbErrors.Text = errorLog.ToString(); rbGlobalCounters.Text = counterLog.ToString(); rbException.Text = exceptionLog.ToString(); UpdateTree(); }
protected void LoadAssembly(string filename, string platform) { Compiler.CompilerOptions.Architecture = GetArchitecture(cbPlatform.Text); var moduleLoader = new MosaModuleLoader(); moduleLoader.AddPrivatePath(Path.GetDirectoryName(filename)); moduleLoader.LoadModuleFromFile(filename); var metadata = moduleLoader.CreateMetadata(); Compiler.Load(TypeSystem.Load(metadata)); UpdateTree(); Stage = CompileStage.Loaded; }
public CompileError(CompileStage stage, Position position, string message) { Stage = stage; Position = position; Message = message; }