Verified Commit 5fbd5168 authored by Camil Staps's avatar Camil Staps 🐨

Create separate stages for optimising ABC and generating bytecode, so that the...

Create separate stages for optimising ABC and generating bytecode, so that the timestamps of these files differ for large projects
parent 99209c4d
......@@ -117,6 +117,8 @@ GenAsmProjectModule imp_pathname project setproject ps
| DComp !Bool !*DirCache !DriverCompilingInfo ![!ModuleDirAndName] !DriverStateRecord
| DQuitCompilers ![!ModuleDirAndName] !DriverCompilingInfo !DriverStateRecord
| DGene ![!ModuleDirAndName] !DriverCodeGenerationInfo !DriverStateRecord
| DOptimiseABC ![!ModuleDirAndName] !DriverStateRecord
| DGenerateByteCode ![!ModuleDirAndName] !DriverStateRecord
| DLink !DriverStateRecord
| DDone
......@@ -550,27 +552,29 @@ step intr state=:(DQuitCompilers modpaths (AsyncWin current async_win_compiling_
-> cont (state, ps) // -> doesn't occur on win
step intr (DGene [!] SyncCodeGeneration ds) ps
#! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
# (paths,ds) = ds!modpaths
= step intr (DOptimiseABC paths ds) ps
step intr (DGene [!] (ASyncCodeGeneration [] {unknown_finished_processors=NoUnknownFinishedProcessors,compiler_process_ids}) ds) ps
# ps = setCompilerProcessIds compiler_process_ids ps
#! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
# (paths,ds) = ds!modpaths
= step intr (DOptimiseABC paths ds) ps
step intr (DGene [!] (ASyncCodeGenerationWin [] _) ds) ps
#! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
# (paths,ds) = ds!modpaths
= step intr (DOptimiseABC paths ds) ps
step intr (DGene [!mdn:rest] SyncCodeGeneration ds) ps
| not ds.ok || intr
# ds = {ds & ok = False}
= step intr (DLink ds) ps
# (paths,ds) = ds!modpaths
= step intr (DOptimiseABC paths ds) ps
# (abccache,fileinfo,gen,abcpath,ps) = check_object_file_out_of_date mdn False ds.abccache ds.fileinfo ds.project ps
# (ps,abccache,fileinfo,project,ok,_) = GenCodeTheProjectModule gen False CodeGeneration mdn abcpath abccache fileinfo ds.project ps
# ds = {ds & abccache = abccache, fileinfo = fileinfo, project = project, ok = ok}
| not ok
= step intr (DLink ds) ps
# (paths,ds) = ds!modpaths
= step intr (DOptimiseABC paths ds) ps
= cont (DGene rest SyncCodeGeneration ds, ps)
step intr (DGene paths (ASyncCodeGeneration busy_processes {max_n_processes,compiler_process_ids,unknown_finished_processors}) ds) ps
......@@ -748,6 +752,34 @@ step intr (DGene paths (ASyncCodeGenerationWin busy_processes win_max_n_processe
# ds = {ds & fileinfo = fileinfo, abccache = abccache, ok = ok}
= cont (DGene paths (ASyncCodeGenerationWin busy_processes win_max_n_processes) ds, ps)
step intr (DOptimiseABC [!mdn:rest] ds) ps
# cgo = PR_GetCodeGenOptions ds.project
| not cgo.optimise_abc
# (paths,ds) = ds!modpaths
= step intr (DGenerateByteCode paths ds) ps
# (tp,ps) = getCurrentProc ps
# ((modinfo,abccache,fileinfo),ps) = FI_GetFileInfo tp mdn ds.abccache ds.fileinfo ps
# (ok,ps) = OptimiseABC mdn modinfo.abcpath modinfo.abcdate ps
# ds & abccache=abccache, fileinfo=fileinfo, ok=ok
= cont (DOptimiseABC rest ds, ps)
step intr (DOptimiseABC [!] ds) ps
# (paths,ds) = ds!modpaths
= step intr (DGenerateByteCode paths ds) ps
step intr (DGenerateByteCode [!mdn:rest] ds) ps
# cgo = PR_GetCodeGenOptions ds.project
| not cgo.generate_bytecode
#! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
# (tp,ps) = getCurrentProc ps
# ((modinfo,abccache,fileinfo),ps) = FI_GetFileInfo tp mdn ds.abccache ds.fileinfo ps
# (ok,ps) = ByteCodeGen cgo.optimise_abc mdn modinfo.abcpath ps
# ds & abccache=abccache, fileinfo=fileinfo, ok=ok
= cont (DGenerateByteCode rest ds,ps)
step intr (DGenerateByteCode [!] ds) ps
#! ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, project, continue}) ps
// Check whether executable is out of date and relink it if required.
| intr || not ok
......@@ -1474,10 +1506,6 @@ GenCodeTheProjectModule outofdate sys genAsmOrCode mdn abc_path abccache fileinf
# (proc,ps) = getCurrentProc ps
# cgo = PR_GetCodeGenOptions project
# ((info,abccache,fileinfo), ps) = FI_GetFileInfo proc mdn abccache fileinfo ps
# (ok,ps) = if cgo.optimise_abc (OptimiseABC mdn abc_path info.abcdate ps) (True,ps)
| not ok = (ps, abccache, fileinfo, project, ok, info.objpath)
# (ok,ps) = if cgo.generate_bytecode (ByteCodeGen cgo.optimise_abc mdn abc_path ps) (True,ps)
| not ok = (ps, abccache, fileinfo, project, ok, info.objpath)
| not outofdate
= (ps,abccache,fileinfo,project,True,info.objpath)
# ps = showInfo (Level2 ("Generating code for '" +++ module_name +++ "'.")) ps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment