Commit a956a116 authored by Camil Staps's avatar Camil Staps 🍃

Generate optimised ABC and bytecode for _system.abc in DLink step

parent 28d5ce7d
Pipeline #22800 passed with stage
in 56 seconds
......@@ -118,7 +118,7 @@ GenAsmProjectModule imp_pathname project setproject ps
| DQuitCompilers ![!ModuleDirAndName] !DriverCompilingInfo !DriverStateRecord
| DGene ![!ModuleDirAndName] !DriverCodeGenerationInfo !DriverStateRecord
| DOptimiseABC ![!ModuleDirAndName] !DriverStateRecord
| DGenerateByteCode !Int ![!ModuleDirAndName] !DriverStateRecord
| DGenerateByteCode ![!ModuleDirAndName] !DriverStateRecord
| DLink !DriverStateRecord
| DDone
......@@ -131,6 +131,7 @@ GenAsmProjectModule imp_pathname project setproject ps
, ok :: !Bool
, newpaths :: !Bool
, modpaths :: ![!ModuleDirAndName]
, bytecode_version :: !Int
}
BringProjectUptoDate :: !Bool CleanupCont !*GeneralSt -> *GeneralSt
......@@ -240,6 +241,7 @@ MakeTheProject force fileinfo libsinfo abccache project continue ps
, ok = True
, newpaths = False
, modpaths = [!]
, bytecode_version = -1
}
= step False (DComp force dircache compinfo rest ds) ps
where
......@@ -756,7 +758,7 @@ step intr (DOptimiseABC [!mdn:rest] ds) ps
# cgo = PR_GetCodeGenOptions ds.project
| not ds.ok || not cgo.optimise_abc
# (paths,ds) = ds!modpaths
= step intr (DGenerateByteCode -1 paths ds) ps
= 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
......@@ -764,9 +766,9 @@ step intr (DOptimiseABC [!mdn:rest] ds) ps
= cont (DOptimiseABC rest ds, ps)
step intr (DOptimiseABC [!] ds) ps
# (paths,ds) = ds!modpaths
= step intr (DGenerateByteCode -1 paths ds) ps
= step intr (DGenerateByteCode paths ds) ps
step intr (DGenerateByteCode -1 paths ds) ps
step intr (DGenerateByteCode paths ds=:{bytecode_version= -1}) ps
| not ds.ok
= step intr (DLink ds) ps
# cgo = PR_GetCodeGenOptions ds.project
......@@ -787,17 +789,17 @@ step intr (DGenerateByteCode -1 paths ds) ps
| not ok
# ps = showInfo (Level1 "Linking...") ps
= step intr (DLink ds) ps
= step intr (DGenerateByteCode version paths ds) ps
step intr (DGenerateByteCode version [!mdn:rest] ds) ps
= step intr (DGenerateByteCode paths {ds & bytecode_version=version}) ps
step intr (DGenerateByteCode [!mdn:rest] ds) ps
| not ds.ok
= step intr (DLink ds) ps
# cgo = PR_GetCodeGenOptions ds.project
# (tp,ps) = getCurrentProc ps
# ((modinfo,abccache,fileinfo),ps) = FI_GetFileInfo tp mdn ds.abccache ds.fileinfo ps
# (ok,ps) = ByteCodeGen version cgo.optimise_abc mdn modinfo.abcpath ps
# (ok,ps) = ByteCodeGen ds.bytecode_version cgo.optimise_abc mdn modinfo.abcpath ps
# ds & abccache=abccache, fileinfo=fileinfo, ok=ok
= cont (DGenerateByteCode version rest ds,ps)
step intr (DGenerateByteCode _ [!] ds) ps
= cont (DGenerateByteCode rest ds,ps)
step intr (DGenerateByteCode [!] ds) ps
| not ds.ok
= step intr (DLink ds) ps
#! ps = showInfo (Level1 "Linking...") ps
......@@ -861,6 +863,15 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
| not ok
= continue False newpaths False fileinfo libsinfo modpaths project intr (abccache, ps)
// optimise ABC and generate bytecode for _system if necessary
# cgo = PR_GetCodeGenOptions ds.project
# (ok,ps) = if cgo.optimise_abc (OptimiseABC system_mdn full_sys sys_date ps) (True,ps)
| not ok
= continue False newpaths False fileinfo libsinfo modpaths project intr (abccache, ps)
# (ok,ps) = if cgo.generate_bytecode (ByteCodeGen ds.bytecode_version cgo.optimise_abc system_mdn full_sys ps) (True,ps)
| not ok
= continue False newpaths False fileinfo libsinfo modpaths project intr (abccache, ps)
# ((ok,_,_,_,sys_objs,sys_libs,abccache),ps)
= accFiles (ParseABCDependencies` abcpath sys_date abccache) ps
| not ok
......
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